Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento tier prices - class declaration for tier price in BUY x for Y - javascript
    primarykey
    data
    text
    <p>There is an outstanding bug in 1.6+ versions of Magento where the % savings for tier prices defaults to 100% when an option is selected. Other contributors have suggested changing product.js around line 747 from</p> <pre><code>for (var i = 0; i &lt; this.tierPrices.length; i++) { </code></pre> <p>to be</p> <pre><code>for (var i = 0; i &gt; this.tierPrices.length; i++) { </code></pre> <p>This resolves the issue with % savings but that code block is never executed. I am by no means a Javascript expert but this block appears to be updating the tier price and % savings when options are selected. I wanted to find the root of the issue, rather than 'commenting it out'. </p> <p>From my debugging in Firebug I noticed that the classes for tier price is wrong in product.js and therefore, a tier price of 0 is retrieved, which accounts for why % savings is always 100%. Firebug shows the price as</p> <pre><code>class="tier-prices product-pricing"&gt; Buy 10 for &lt;span class="price"&gt;$40.00&lt;/span&gt; </code></pre> <p>whereas product.js is attempting to retrieve the objects using</p> <pre><code>$$('.price.tier-' + i).each(function (el) { </code></pre> <p>If you change the above to </p> <pre><code>$$('.tier-prices .price).each(function (el) { </code></pre> <p>the tier price is retrieved, but for more than one tier price on a product, there is no way to refer to them individually. The class "price" above does not have a unique identifier or iterative number declared.</p> <p>Where is class="price" declared for the tier price? In the code of tierprices.phtml it looks like this</p> <pre><code>&lt;?php echo $this-&gt;__('Buy %1$s for %2$s each', $_price['price_qty'], $_price['formated_price'])?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload