function updatePriceDisplay() {
var priceInfo = (silent_form[1]).split(":");
document.getElementById("productCode").innerHTML = priceInfo[1];
document.getElementById("productPrice").innerHTML = "£" + priceInfo[0] + " inc. vat";
}
I Would change that to:
function updatePriceDisplay() {
var priceInfo = (silent_form[1]).split(":");
if(priceInfo[1] !="") { document.getElementById("productCode").innerHTML = priceInfo[1]; }
if(priceInfo[0] !="") { document.getElementById("productPrice").innerHTML = "£" + priceInfo[0] + " inc. vat"; }
}
so that the price displayed is only updated if a price is returned by the lookup.
That has resolved the issue with the product code and price disappearing, thank you. I'm still left with a problem though...
I have had to create "Parent" products in the products table so that users can view a product detail page but then HAVE to make selection from the variables menu in order to Add to Cart. Making a selection in the variables tables changes the product code and, if applicable, price so that the real product (not the parent) is added to basket.
This works fine for products that are available in all variations...
Cool White / Non-Dimmable
Warm White / Non-Dimmable
Cool White / Dimmable
Warm White / Dimmable
...however if a product isn't available in one of these combinations - lets say that it's not available in Cool White / Dimmable but is available in the other three variations - the user can still select Cool White / Dimmable because Cool White is available in the colour menu and Dimmable is available in the dimmable menu.
Here's an example of that in action:
http://www.ledwarehouseuk.com/LED-Lights-Bulbs.php?lbid=701
How do I prevent this as it is allowing the customer to add the parent product to the cart, which just doesn't work.
Thank you.
NJ