Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

規格有の商品で、規格を選択した場合の挙動 #1500

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 16 additions & 13 deletions html/template/default/js/eccube.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
};

/**
* 規格の選択状態に応じて, フィールドを設定する.
* 規格の選択状態に応じて, フィールドを設定する.(20160219_詳細画面のみ使用)
*/
eccube.checkStock = function($form, product_id, classcat_id1, classcat_id2) {

Expand All @@ -469,9 +469,9 @@
classcat2 = eccube.classCategories[classcat_id1]['#' + classcat_id2];
}

// 商品コード
var $product_code_default = $form.find('[id^=product_code_default]');
var $product_code_dynamic = $form.find('[id^=product_code_dynamic]');
// 商品コード 実際はフォーム内要素ではない
var $product_code_default = $form.find('[id^=item_code_default]');
var $product_code_dynamic = $form.find('[id^=item_code_dynamic]');
if (classcat2 && typeof classcat2.product_code !== 'undefined') {
$product_code_default.hide();
$product_code_dynamic.show();
Expand All @@ -493,24 +493,27 @@
$cartbtn_default.show();
}

// 通常価格
var $price01_default = $form.find('[id^=price01_default]');
var $price01_dynamic = $form.find('[id^=price01_dynamic]');
if (classcat2 && typeof classcat2.price01 !== 'undefined' && String(classcat2.price01).length >= 1) {
// 通常価格 フォーム内要素ではない
var $price01_default = $('#detail_description_box__class_normal_range_price');
var $price01_dynamic = $('#detail_description_box__class_dynamic_range_price');

$price01_dynamic.text(classcat2.price01).show();
if (classcat2 && typeof classcat2.price01 !== 'undefined' && String(classcat2.price01).length >= 1) {
$price01_dynamic.children('.price01_dynamic').text(classcat2.price01);
$price01_dynamic.show();
$price01_default.hide();
} else {
$price01_dynamic.hide();
$price01_default.show();
}

// 販売価格
var $price02_default = $form.find('[id^=price02_default]');
var $price02_dynamic = $form.find('[id^=price02_dynamic]');
// 販売価格 フォーム内要素ではない
var $price02_default = $('#detail_description_box__class_range_sale_price');
var $price02_dynamic = $('#detail_description_box__class_range_dynamic_sale_price');

if (classcat2 && typeof classcat2.price02 !== 'undefined' && String(classcat2.price02).length >= 1) {

$price02_dynamic.text(classcat2.price02).show();
$price02_dynamic.children('.price02_dynamic').text('¥ ' + classcat2.price02 + ' ');
$price02_dynamic.show();
$price02_default.hide();
} else {
$price02_dynamic.hide();
Expand Down
12 changes: 7 additions & 5 deletions src/Eccube/Resource/template/default/Product/detail.twig
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,24 @@ $(function(){
<!--★通常価格★-->
{% if Product.hasProductClass -%}
{% if Product.getPrice01Min is not null and Product.getPrice01Min == Product.getPrice01Max %}
<p id="detail_description_box__class_normal_price" class="normal_price"> 通常価格:<span class="price01_default">{{ Product.getPrice01IncTaxMin|price }}</span> <span class="small">税込</span></p>
<p id="detail_description_box__class_normal_price" class="normal_price"> 通常価格:<span class="price01_default">{{ Product.getPrice01IncTaxMin|price }}</span> <span class="small">税込</span></p><p id="detail_description_box__class_normal_price" class="normal_price"> 通常価格:<span class="price01_default">{{ Product.getPrice01IncTaxMin|price }}</span> <span class="small">税込</span></p>
{% elseif Product.getPrice01Min is not null and Product.getPrice01Max is not null %}
<p id="detail_description_box__class_normal_range_price" class="normal_price"> 通常価格:<span class="price01_default">{{ Product.getPrice01IncTaxMin|price }}</span> ~ <span class="price01_default">{{ Product.getPrice01IncTaxMax|price }}</span> <span class="small">税込</span></p>
<p id="detail_description_box__class_normal_range_price" class="normal_price"> 通常価格:<span class="price01_default">{{ Product.getPrice01IncTaxMin|price }}</span> ~ <span class="price01_default">{{ Product.getPrice01IncTaxMax|price }}</span> <span class="small">税込</span></p>
<p id="detail_description_box__class_dynamic_range_price" class="dynamic_price"> 通常価格:<span class="price01_dynamic"></span> <span class="small">税込</span></p>
{% endif %}
{% else -%}
{% if Product.getPrice01Max is not null %}
<p id="detail_description_box__normal_price" class="normal_price"> 通常価格:<span class="price01_default">{{ Product.getPrice01IncTaxMin|price }}</span> <span class="small">税込</span></p>
<p id="detail_description_box__normal_price" class="normal_price"> 通常価格:<span class="price01_default">{{ Product.getPrice01IncTaxMin|price }}</span> <span class="small">税込</span></p>
{% endif %}
{% endif -%}

<!--★販売価格★-->
{% if Product.hasProductClass -%}
{% if Product.getPrice02Min == Product.getPrice02Max %}
<p id="detail_description_box__class_sale_price" class="sale_price text-primary"> <span class="price02_default">{{ Product.getPrice02IncTaxMin|price }}</span> <span class="small">税込</span></p>
<p id="detail_description_box__class_sale_price" class="sale_price text-primary"> <span class="price02_default">{{ Product.getPrice02IncTaxMin|price }}</span> <span class="small">税込</span></p>
{% else %}
<p id="detail_description_box__class_range_sale_price" class="sale_price text-primary"> <span class="price02_default">{{ Product.getPrice02IncTaxMin|price }}</span> ~ <span class="price02_default">{{ Product.getPrice02IncTaxMax|price }}</span> <span class="small">税込</span></p>
<p id="detail_description_box__class_range_sale_price" class="sale_price text-primary"> <span class="price02_default">{{ Product.getPrice02IncTaxMin|price }}</span> ~ <span class="price02_default">{{ Product.getPrice02IncTaxMax|price }}</span> <span class="small">税込</span></p>
<p id="detail_description_box__class_range_dynamic_sale_price" class="sale_price text-primary"> <span class="price02_dynamic"></span><span class="small">税込</span></p>
{% endif %}
{% else -%}
<p id="detail_description_box__sale_price" class="sale_price text-primary"> <span class="price02_default">{{ Product.getPrice02IncTaxMin|price }}</span> <span class="small">税込</span></p>
Expand Down