At the product details page I display the sales price twice because I have many custom extra fields and the user goes way down and the price is not shown.
When a user adds something that alters the price the JSON recalculate works fine but only the top price is updated.
Both prices have the same class PricesalesPrice
I have tried adding this code at vmprices.js but I am getting errors
for (var i = 0; i < 2; i++) {
var tech = $("span.Price"+key)[i];
prices.find(tech).show().html(value);
}
Then I added manually the following code but still with no success
prices.find(("span.Price"+key)[1]).show().html(value);
prices.find(("span.Price"+key)[2]).show().html(value);
I would appreciate your help
Anyone? Is there a way to update 2 classes with the same name?
I added this code
prices.find("span.Price"+key).each(function(){
$(this).show().html(value);
});
but I am getting the error
SyntaxError: expected expression, got ')'
I am very close
prices.each(function() {
jQuery(this).find("span.Price"+key).each(function() {
jQuery(this).show().each(function() {
jQuery(this).html(value);
});
});
});
I found what the problem was
My code last worked fine but I had renamed a class at the bottom price in order to decorate it at the page and from "product-price" was now "product-price-bottom"
So I have now
var prices = form.parents(".productdetails").find(".product-price");
var pricesbottom = form.parents(".productdetails").find(".product-price-bottom");
if ((0 == prices.length) || (0 == pricesbottom.length)) {
prices = jQuery("#productPrice" + id);
pricesbottom = jQuery("#productPrice" + id);
}
and at line 84
prices.find("span.Price"+key).show().html(value);
pricesbottom.find("span.Price"+key).show().html(value);