Forums / Setting Up Categories, Products, Attributes / sticking a wrapper around attributes price

sticking a wrapper around attributes price

Views: 337

Results 1 to 1 of 1
16 Aug 2011, 11:16 AM
#1
duffeye avatar

duffeye

New Zenner

Join Date:
Nov 2009
Posts:
1
Plugin Contributions:
0

sticking a wrapper around attributes price

Hi Guys

Just thought id share some code that was making me go insane for ages in case anyone found it useful.

im currently developing a site that sells beds and has a load of different configurations for each product (mattress sizes etc)

im using the built in zen cart attributes for this - but the problem i had is that zen cart dosent stick wrappers around the price so you cant style the attributes price seperatley.

thankfully i found out how to!

in includes/modules/attributes.php find this code ```php
$products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
$currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX ;


then change it to this

```php
$products_options_display_price= '<div class="attribpricewrapper">' . ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
                          $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX . '</div>' ;

note that i called the wrapper attribpricewrapper but you can call it anything - you can then style it in your stylesheet.

hope this maybe of help to someone!