Use custom input text (instead of :price one)

- 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`
This commit is contained in:
Jean-Baptiste Bellet
2021-04-02 15:21:41 +02:00
parent d7cadde0a1
commit 76fbb2be84
2 changed files with 4 additions and 2 deletions

View File

@@ -62,7 +62,8 @@
"question-mark-with-tooltip-placement" => "top",
"question-mark-with-tooltip-animation" => true,
key: "'js.admin.unit_price_tooltip'"}
= f.text_field :price, {"class" => 'fullwidth', "disabled" => true, "ng-model" => "unit_price"}
%input{ "type" => "text", "id" => "product_unit_price", "name" => "product[unit_price]",
"class" => 'fullwidth', "disabled" => true, "ng-model" => "unit_price"}
%div{style: "color: black"}
= t(".unit_price_legend")
.sixteen.columns.alpha

View File

@@ -46,7 +46,8 @@
"question-mark-with-tooltip-placement" => "top",
"question-mark-with-tooltip-animation" => true,
key: "'js.admin.unit_price_tooltip'"}
= 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' => '' }