Note that there are some explanatory texts on larger screens.

plurals
  1. POPrice updater not working properly in FF, Opera and Chrome
    primarykey
    data
    text
    <p>The described problem only occurs in FF and Chrome-Browser, other browsers like IE and Safari work fine. Opera used to work fine, too, but it doesn't now anymore, as I tested it a few minutes ago!</p> <p>I'm using the shop-system <strong>xtcModified-Version 1.06</strong> with some Modules, like a tabbing-module and a price-updater-module.</p> <p>Here's the code for the price-updater, where I think the problem is in:</p> <pre><code>var attributePriceUpdater; (function ($) { // BEGIN: attributePriceUpdater attributePriceUpdater = { // BEGIN: calculate calculate: function (This) { var newPrice = 0; var summe = 0; var symbolLeft = ''; var symbolRight = ''; var data = This.data('attrdata'); if ($('#optionen' + data.pid + ' select').length) { var el = ' option:selected'; //wenn selectfeld } else { var el = ' input:checked'; //wenn checkbox oder radio } $.each($('#optionen' + data.pid + el), function (index, item) { if (!$(this).parents('#optionen' + data.pid + ' [id^="pmatrix_v"]').attr('style')) { data = $(this).data('attrdata'); if (data.aprice != 0) { if (data.prefix == '-') { summe -= data.aprice; } else if (data.prefix == '+') { summe += data.aprice; } else if (data.prefix == '=') { summe += data.aprice - data.gprice; } } } }); newPrice = (summe + data.gprice).toFixed(2).toString().replace(/[.]/, ','); if (data.cleft) { symbolLeft = data.cleft + '&amp;nbsp;'; } if (data.cright) { symbolRight = '&amp;nbsp;' + data.cright; } // html schreiben $('#optionen' + data.pid + ' .calculatePrice span.cuPrice').html(data.vpe + '&amp;nbsp;' + symbolLeft + newPrice + symbolRight); $('div.product_price').html(symbolLeft + newPrice + symbolRight); // html schreiben }, // END: calculate // BEGIN: calculateAll calculateAll: function () { $.each($('div[id^="optionen"] input[type=radio]:checked, div[id^="optionen"] input[type=checkbox], div[id^="optionen"] option'), function (index, item) { attributePriceUpdater.calculate($(this)); }); } // END: calculateAll }; // END: attributePriceUpdater // BEGIN: $(document).ready $(document).ready(function () { attributePriceUpdater.calculateAll(); $(".javascriptOff").css({ display: "block" }); $('#tabbed_product_info2 a[href]').on("click", function () { $('.cuPrice').css('background', 'red'); }); $('div[id^="optionen"] select').click(function () { attributePriceUpdater.calculate($('option', this)); }); $('div[id^="optionen"] input').click(function () { attributePriceUpdater.calculate($(this)); }); }); // END: $(document).ready })(jQuery); </code></pre> <p>I have made my problem available in <strong>js-fiddle</strong>...it "works" and shows the problem I've got, but the layout is wrong. But that does not harm the problem...</p> <p><strong><a href="http://jsfiddle.net/t2UW5/1/" rel="nofollow">http://jsfiddle.net/t2UW5/1/</a></strong></p> <p>Normally the different dimensions should be arranged in tabs, in this example they are displayed one after each other. </p> <p>Now to the problem:</p> <p>The base-price of the article is 2,80 EUR.</p> <p>I choose for example the first option at the price of 4,20 EUR. Now I scroll down to the end and the correct price gets displayed. Now I choose the last option "160 x 90 cm", and the price gets updated. But not to the correct price of 72,00 EUR, it displays 73,40 EUR. </p> <p>First I've chosen the option at a price of 4,20 EUR. This minus the base-price of 2,80 EUR equals 1,40 EUR. That's the value the price is displayed including the new price (72,00 EUR + 1,40 EUR = 73,40 EUR). </p> <p>When I click the same option a second time, the price gets displayed correctly at 72 EUR. </p> <p>The same thing happens whenever I click another price in another tab, which can't be seen in this example as I described before). </p> <p>Another example: first selecting the first option (4,20 EUR), then the 4th last option "118.9 x 84.1 cm" at 60,00 EUR. Updated price is displayed with 61,40 EUR, so again the difference between the base-price and the first selected option...</p> <p>The absolutely strange thing about this is that the problem only occurs in Firefox, Opera and Chrome-Browser!!! I tested the same site and the js-fiddle in IE and Safari, there it works fine!</p> <p>I appreciate any kind of help on this! Thx in advance!</p>
    singulars
    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.
    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