Can a style influence what is passed onto the cart page?
I am still working on hiding non-relevant select menus. For example, if items have no size option, the size selection menu should be hidden. The size value for these item is set to zero.
In order for the items still to be passed on to the cart page I used this code (suggested by Jason), with the respective recordsets put in place:
$ATC_itemSize = "".$row_rspricelookup['size'] .""?$row_rspricelookup['size']:($row_rspriceNoSize['size']!=""?$row_rspriceNoSize['size']:($row_rspriceNoVersion['size']!=""?$row_rspriceNoVersion['size']:$row_rspriceNoVersionNoSize['size']));// column binding
In order to hide the non-relevant menu, I am using a temporary style
<?php
if ( (!isset($row_rsversion['version_id'])) || ($row_rsversion['version_id'] == "13") )
{
$tmpElementClassVersion = "hide";
}
else
{
$tmpElementClassVersion = "show";
}
?>
<?php
if ( (!isset($row_rssizedefault['size_id'])) || ($row_rssizedefault['size_id'] == "8") )
{
$tmpElementClassSize = "hide";
}
else
{
$tmpElementClassSize = "show";
}
?>
8 and 13 represent the zero values.
With the style defined like this (I also tried display:none, display:block):
.hide {
visibility: hidden;}
.show {
visibility: visible}
And for the output:
<select class="<?php echo $tmpElementClassVersion; ?>
for the version select menu
and
<select class="<?php echo $tmpElementClassSize; ?>
for the size select menu.
The problem: with the style in place, the product is not correctly passed onto the cart (for example a product in sizes S, M and L, no matter what size I choose, size S is being passed on).
Is something wrong with the if-statement?
This was the original thread:
showthread.php?t=18996