Skip to content

Commit

Permalink
EC-CUBE#1500 の追加修正
Browse files Browse the repository at this point in the history
  • Loading branch information
chihiro-adachi committed Aug 22, 2016
1 parent 3939944 commit 74ae2a9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
16 changes: 10 additions & 6 deletions html/template/default/js/eccube.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,8 @@
$sele2.append(option);
}
}
eccube.checkStock($form, product_id, $sele1.val() ? $sele1.val() : '__unselected2',
$sele2.val() ? $sele2.val() : '');
}
eccube.checkStock($form, product_id, $sele1.val() ? $sele1.val() : '__unselected2', $sele2.val() ? $sele2.val() : '');
}
};

Expand Down Expand Up @@ -497,10 +496,15 @@
var $price01_default = $('#detail_description_box__class_normal_range_price');
var $price01_dynamic = $('#detail_description_box__class_dynamic_range_price');

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();
if (classcat2 && typeof classcat2.price01 !== 'undefined') {
if (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.hide();
}
} else {
$price01_dynamic.hide();
$price01_default.show();
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ public function getClassCategories()
'classcategory_id2' => $class_category_id2,
'name' => $class_category_name2,
'stock_find' => $ProductClass->getStockFind(),
'price01' => number_format($ProductClass->getPrice01IncTax()),
'price01' => $ProductClass->getPrice01() === null ? '' : number_format($ProductClass->getPrice01IncTax()),
'price02' => number_format($ProductClass->getPrice02IncTax()),
'product_class_id' => (string) $ProductClass->getId(),
'product_code' => $ProductClass->getCode(),
Expand Down
27 changes: 13 additions & 14 deletions src/Eccube/Resource/template/default/Product/detail.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

{% block javascript %}
<script>
eccube.classCategories = {{ Product.class_categories|json_encode|raw }};
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var $form = $(form);
var product_id = $form.find('input[name=product_id]').val();
var $sele1 = $form.find('select[name=classcategory_id1]');
var $sele2 = $form.find('select[name=classcategory_id2]');
eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
}
$(function(){
eccube.classCategories = {{ Product.class_categories|json_encode|raw }}
var classcat_id2_selected = '';
{% if form.classcategory_id2 is defined %}
fnSetClassCategories(
document.form1, {{ form.classcategory_id2.vars.value|json_encode|raw }}
);
classcat_id2_selected = {{ form.classcategory_id2.vars.value|json_encode|raw }};
{% endif %}
var $form = $(document.form1);
var product_id = $form.find('input[name=product_id]').val();
var $sele1 = $form.find('select[name=classcategory_id1]');
var $sele2 = $form.find('select[name=classcategory_id2]');
eccube.setClassCategories($form, product_id, $sele1, $sele2, classcat_id2_selected);
});
</script>

<script>
Expand Down Expand Up @@ -135,7 +134,7 @@ $(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_dynamic_range_price" class="dynamic_price"> 通常価格:<span class="price01_dynamic"></span> <span class="small">税込</span></p>
Expand Down

0 comments on commit 74ae2a9

Please sign in to comment.