Thanks for the code. Works great except it doesn't display Text Attributes.
Anyone know how to modifiy it so text attributes display too?
Thanks for the code. Works great except it doesn't display Text Attributes.
Anyone know how to modifiy it so text attributes display too?
Yep, that works on my test site..... wonder why this is not standard code?
And, to put a line space between each item in the shopping cart sidebox:
$content .= '<ul><div style="font-size:75%;"> ' . "-" . $attributes->fields['products_options_values_name'] . '</div></ul><br/>';
instead of
$content .= '<ul><div style="font-size:75%;"> ' . "-" . $attributes->fields['products_options_values_name'] . '</div></ul>';
Thankyou for this, MASSIVE help with a module I've been developing.
Thankyou
THANKYOU!!!
I'd like also thank you !
if a product have different ie. color AND qty attributes/options,
I was problem to display the first attribute.
Only the qty was displayed.
After playing some hours with the code, I found the solution from php site:
foreach ($products[$i]['attributes'] as $option => $value) {
and
while (list($option, $value) = each($products[$i]['attributes'])) {
are functionally identical.
so I commented out the //while - loop and now all attributes and their values are displayed correctly!
I am not php guru, so maybe someone could confirm that this is correctly fixed.
www.vmtarvike.com
Is there a way to add products to a "temporary basket" sidebox and also show editable attributes in that basket that can be changed up until the user hits a button in that sidebox called add-to-cart. I guess it would be a sort of pseudo cart that must be confirmed by the user then they send it to the cart.[FONT=Times New Roman][FONT=Verdana][/FONT][/FONT]
I inserted the following code in tpl_shopping_cart.php as suggested in this thread. I managed to display in my shopping cart sidebox as follows:
1ea - myproductname
Model : mymodelnumber
Colour : ?????
Size : myattributesize
How do I get the colour attribute to be displayed as well? Can someone help me with this?
// BOF Display Attributes //
if (isset($products[$i]['attributes']) && is_array($products[$i]['attributes'])) {
reset($products[$i]['attributes']);
foreach ($products[$i]['attributes'] as $option => $value) {
while (list($option, $value) = each($products[$i]['attributes'])) {
$attributes_query = "select popt.products_options_name, poval.products_options_values_name,
pa.options_values_price, pa.price_prefix
from " . TABLE_PRODUCTS_OPTIONS . " popt,
" . TABLE_PRODUCTS_OPTIONS_VALUES . " poval,
" . TABLE_PRODUCTS_ATTRIBUTES . " pa
where pa.products_id = '" . (int)$products[$i]['id'] . "'
and pa.options_id = '" . (int)$option . "'
and pa.options_id = popt.products_options_id
and pa.options_values_id = '" . (int)$value . "'
and pa.options_values_id = poval.products_options_values_id
and popt.language_id = '" . (int)$_SESSION['languages_id'] . "'
and poval.language_id = '" . (int)$_SESSION['languages_id'] . "'";
$attributes = $db->Execute($attributes_query);
$content .= '<ul><div style="font-size: 12px; margin-left: -15px; color: #9f1c00;">' . 'Model : ' .$products[$i]['model'] .'<br>'. 'Colour : ' .'<br>'.'Size : ' .$attributes->fields['products_options_values_name'] . '</div></ul><br>';
}
}
}
// EOF Display Attributes //
Only shows te first attributes, anybody found a solution ?
Tnx.
Macbos
Post number 25 addresses this issue. Just remove the while loop and both attributes are shown correctly.
Bookmarks