Zen Follower
- Join Date:
- Apr 2010
- Posts:
- 319
- Plugin Contributions:
- 0
Zen Follower
Oba-san
While this could confuse customers to see the break out of attribute prices mixed in the shopping cart, you could customize the file:
/includes/templates/your_templates_dir/templates/tpl_shopping_cart_default.php
and change the line:
<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li>
to read:
<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']) . ' [ ' . $value['price_prefix'] . $currencies->format($value['options_values_price']) . ' ]'; ?></li>
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Zen Follower
thanks for reply, ill experiment with it but appreciate what your saying,
thanks
Bryan
Oba-san
To allow for specials and such on Attributes, you will need this adjusted with editing the file:
/includes/modules/pages/shopping_cart.php
$attributes = "SELECT popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.attributes_discounted[B], pa.products_attributes_id[/B]
FROM " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
WHERE pa.products_id = :productsID
AND pa.options_id = :optionsID
AND pa.options_id = popt.products_options_id
AND pa.options_values_id = :optionsValuesID
AND pa.options_values_id = poval.products_options_values_id
AND popt.language_id = :languageID
AND poval.language_id = :languageID " . $options_order_by;
[B]// bof: show attribute price in cart
if ($attributes_values->fields['attributes_discounted'] == 1) {
// apply product discount to attributes if discount is on
// $new_attributes_price = $products_options->fields['options_values_price'];
$new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
$new_attributes_price = zen_get_discount_calc((int)$products[$i]['id'], true, $new_attributes_price);
} else {
// discount is off do not apply
$new_attributes_price = $attributes_values->fields['options_values_price'];
}
$attrArray[$option]['new_attributes_price'] = $new_attributes_price;
// eof: show attribute price in cart
[/B]
$attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name'];
and then you can use one and/or the other in the template:
<!-- ORIGINAL <li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name']); ?></li> -->
<li><?php echo $value['products_options_name'] . TEXT_OPTION_DIVIDER . nl2br($value['products_options_values_name'])[B] . ' [ ' . $value['price_prefix'] . $currencies->format($value['options_values_price']) . ' ] ' . $currencies->format($value['new_attributes_price'])[/B]; ?></li>
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Zen Follower
thanks for the help,
thanks
Bryan
Oba-san
You are most welcome ... :smile:
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Tell staff why this post should be reviewed.