Skip to content

Commit

Permalink
Use custom input text (instead of :price one)
Browse files Browse the repository at this point in the history
 - Use `variant_unit_price` for `id` attribute and `variant[unit_price]` for `name` attribute
 - Previously, there was an duplicated `#id` on the page because we used `:price`
  • Loading branch information
jibees committed Mar 29, 2021
1 parent 325ccdd commit 2b46378
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/views/spree/admin/products/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
"question-mark-with-tooltip-animation" => true,
key: "'js.admin.unit_price_tooltip'"}
%br/
= f.text_field :price, {"class" => 'fullwidth', "disabled" => true, "ng-model" => "unit_price"}
%input{ "type" => "text", "id" => "variant_unit_price", "name" => "variant[unit_price]",
"class" => 'fullwidth', "disabled" => true, "ng-model" => "unit_price"}
%div{style: "color: black"}
= t(".unit_price_legend")
.sixteen.columns.alpha
Expand Down
3 changes: 2 additions & 1 deletion app/views/spree/admin/variants/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"question-mark-with-tooltip-animation" => true,
key: "'js.admin.unit_price_tooltip'"}
%br/
= f.text_field :price, {"class" => 'fullwidth', "disabled" => true, "ng-model" => "unit_price"}
%input{ "type" => "text", "id" => "variant_unit_price", "name" => "variant[unit_price]",
"class" => 'fullwidth', "disabled" => true, "ng-model" => "unit_price"}
%div{style: "color: black"}
= t("spree.admin.products.new.unit_price_legend")
%div{ 'set-on-demand' => '' }
Expand Down

0 comments on commit 2b46378

Please sign in to comment.