1.5.7c
Follow-up of
https://www.zen-cart.com/showthread....ntity-for-them
I set up as suggested by dbltoe (post #2), and works fine.
"Problem" is that in the cart it displays the attributes quantities under the product column, and in the actual quantity column it displays 1.
Now I copied this snip to the quantity column, and it does display the attributes list (and quantities) in the quantity column as well.
PHP Code:
<?php
if ($product['flagShowFixedQuantity']) {
echo $product['showFixedQuantityAmount'] . '' . $product['flagStockCheck'] . '' . $product['showMinUnits'];
} else {
echo $product['quantityField'] . '' . $product['flagStockCheck'] . '' . $product['showMinUnits'];
}
?>
<?php // FZ taken from product column to show in quantity column
echo $product['attributeHiddenField'];
if (isset($product['attributes']) && is_array($product['attributes'])) {
echo '<ul>';
foreach ($product['attributes'] as $option => $value) {
?>
<li>
<?php
echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']);
?>
</li>
<?php
}
echo '</ul>';
}
?>
?>
With the above it displays 1 (for the actual item), and the corresponding values for the given attributes i.e.
1
small - 0
medium -2
large -1
My question:
Is there a simple snip I can add to have only
small - 0
medium -2
large -1
basically an if/elseif/else situation
I tried changing the else with elseif, and adding else for the attributes, but the page goes blank, so obviously I am missing something.
The ideal would be to have quantity fields to update the attributes quantity like you would have with the single product, but maybe another time ... don't want to push my luck, for now just removing the 1 is a step forward. ;)
Thank you
Bookmarks