Our site www.viart.com site is operated by latest Viart Shop 5 with default Clear design
Topic Information
charleshays
charleshays
Mod: Multiple Dynamic Prices in Product Template
 
Description: You can add the price information to multiple locations on a product detail page, and if product options are changed all locations of the price are updated, not just the first.
Example: Copy and paste any of the price elments in your template, such as (and all remain dynamic):
 
<span id="price_{item_id}" class="{price_class}">{price_control}</span>
 
File: js/shopping.js
Around line: 219
 
change:
 
if (priceControl) {
if (htmlControl) {
priceControl.innerHTML = cl + formatNumber(productPrice) + cr;
} else {
priceControl.value = cl + formatNumber(productPrice) + cr;
}
}
taxPriceControl = document.getElementById("tax_price_" + itemId);
if (taxPriceControl) {
taxPriceControl.innerHTML = cl + formatNumber(taxPrice) + cr;
}
 
to:
 
if (priceControl) {
if (htmlControl) {
totlen = document.getElementsByName("price_" + itemId).length;
for(i=0;i<totlen;i++) {
document.getElementsByName("price_" + itemId).innerHTML = cl + formatNumber(productPrice) + cr; }
} else {
priceControl.value = cl + formatNumber(productPrice) + cr;
}
}
taxPriceControl = document.getElementById("tax_price_" + itemId);
if (taxPriceControl) {
totlen = document.getElementsByName("tax_price_" + itemId).length;
for(i=0;i<totlen;i++) {
document.getElementsByName("tax_price_" + itemId).innerHTML = cl + formatNumber(taxPrice) + cr; }
}
 
steddyman
steddyman
Yesterday I added a product to my cart in UK pounds that I originally ser the price for in dollars. On the product details page the price showed as 1p less than when it was added to the cart. The cart seemed to do the rounding differently.
 
Would this mod help that problem?
 
charleshays
charleshays
No, this mod is for dipslaying the price more then once in the products details. This is normally not a problem and this mod is not needed except when you have options that vary the product price. Whena an option is chosen with a different value such as in a pull down the price would only be updated on the first instance of the call in the template to the price, any other calls to the price tag in the template would not get updated. That is what this mod is for fixing.
 
charleshays
charleshays
But this does sound like a rounding issue to me. And sorry I only use USD so haven't looked at how they deal with mltiple currencies very well except they use this formula of $base_price * $currency_rate = $price, and then trump at the decimal point. Which is basic but they impliment the same thing in so many different ways in so many different files I am not surprised some pages may show different amounts. It's sad really cause they should have adopted a more universal code design so that every call for said formula uses the same code, not rewritting it 20 different ways in 20 different files.
 
viacom123
viacom123
Hello,
 
Just read your forum...question for you...I ahve noticed that if a product has volume discount (VD) pricing, a customer ordering a VD product, they would never know the pricing levels unless a static table which displaced these prices were placed in the highlights section of the product details page (also, on the product listing page, the customer would also not know pricing volumes). Anyway, I see you mod above. I am wondering if your mod addresses this issue, the issue being, how to display dynamic price volume discounts either on the product listing page or on the product detail page...any idea how to do this?
 
Thanks,
 
Scott
 
charleshays
charleshays
Scott, I can't actually find where to add quantity selection to the product page, or if that is even supported. I also noticed that there is no way of telling products discount by VD on the products page. This is a couple very important missed feature by the ViArt team and I hope they look into it.
 
My mod won't work with VD however, it is intended to work with changes in prices according to product options. However you could choose to not use VD function and instead use product options to do the same thing in a limited hack kind of way and in that case it would work...sorta.