Magento Bundle Product 於 JavaScript 控制台顯示錯誤

You are here:
< All Topics

使用 Ultimo,在 JavaScript 控制台中 Bundle Product 會出現兩個錯誤訊息

media/js/opti-frontend-base-default-js-bundle.js:10 Uncaught ReferenceError: taxCalcMethod is not defined

dainichi-fw-5616l-set.html:15 Uncaught TypeError: Cannot read property ‘reloadPrice’ of undefined

如果組合產品內容有多種選項,會無法正常顯示價格(也就是價格會顯示為 0 )

解決方法是修正相關檔案

vim /usr/share/nginx/html/app/design/frontend/ultimo/default/template/bundle/catalog/product/view/type/bundle.phtml

<script type="text/javascript">
//<![CDATA[
 var skipTierPricePercentUpdate = true;
 var bundle = new Product.Bundle(<?php echo $this->getJsonConfig() ?>);

之後加入

 var taxCalcMethod = "<?php echo Mage::helper('tax')->getConfig()->getAlgorithm($_product->getStore()) ?>";
 var CACL_UNIT_BASE = "<?php echo Mage_Tax_Model_Calculation::CALC_UNIT_BASE ?>";
 var CACL_ROW_BASE = "<?php echo Mage_Tax_Model_Calculation::CALC_ROW_BASE ?>";
 var CACL_TOTAL_BASE = "<?php echo Mage_Tax_Model_Calculation::CALC_TOTAL_BASE ?>";

重新清除 OPCache 後就可以解決了

參考資料:

https://stackoverflow.com/questions/21127500/magento-1-8-1-bundled-products-price-does-not-update

Previous Magento API Integration Calling Parameter Do Not Match Signature
Next Magento system log 中出現: Warning: simplexml_load_string(): Entity: line 151: parser error
Table of Contents