Forums / Setting Up Categories, Products, Attributes / Removing Parenthesis from Attribute Prices

Removing Parenthesis from Attribute Prices

Locked

Views: 4,260

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
21 Jun 2008, 3:42 AM
#1
beama avatar

beama

New Zenner

Join Date:
Jun 2008
Location:
Ontario, Canada
Posts:
54
Plugin Contributions:
0

Removing Parenthesis from Attribute Prices

Hello,
I am looking for a CURRENT answer on how to remove parenthesis from attribute prices. I've tried to research this question to the best of my ability and i have found some old answers
( http://www.zen-cart.com/forum/showthread.php?p=416028#post416028 )
that suggest customizing the code in the
includes/modules/attributes.php file. i've looked and looked and can not find where i am suppose to remove the () in the attributes.php file.

Help Please

21 Jun 2008, 6:55 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Removing Parenthesis from Attribute Prices

If you search through the attributes.php module you will find several references to:
$products_options_display_price

This is the price and how it will be displayed ...

There are parens added to surround the price and you would need to edit these so as not to have them showing ...

In v1.3.8 these were changed to constants for easier modification, the Developers Tool Kit would show on a search for:
$products_options_display_price

that it is used with:

/includes/modules/attributes.php

Line #145 : $products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .

Line #157 : $products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] . 

There is also in those same sections:
ATTRIBUTES_PRICE_DELIMITER_SUFFIX

A search on these would show where they are defined by product type ...

You can use your templates and overrides to change the defines and not need to touch the code ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!

21 Jun 2008, 11:33 PM
#3
polarbear avatar

polarbear

New Zenner

Join Date:
Jun 2008
Posts:
9
Plugin Contributions:
0

Re: Removing Parenthesis from Attribute Prices

Just so happens I was looking to do the same thing. I got it to work by commenting a line out around where the previous poster was pointing to.

I commented out:

else {
$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;
                        }

My editor is Coda and that is around line 158-161 or so.

3 Mar 2009, 11:22 PM
#4
addler avatar

addler

New Zenner

Join Date:
Mar 2009
Posts:
5
Plugin Contributions:
0

Re: Removing Parenthesis from Attribute Prices

Have been searching the forum all day (FAQs and Forum) and have tried different suggestions to remove the parenthesis around the attribute prices. Unfortunately, I must be interpreting the directions wrong... When I remove a "(" or comment out a line from includes/modules/attributes.php (example below), nothing works...

$products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .

Is there any way someone can post exactly how to do this with the parenthesis to be removed highlighted in a different color? Or perhaps provide a before and after example of the edits?

Any help will be greatly appreciated!

Zen Version: Zen Cart 1.3.8a

4 Mar 2009, 4:40 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Removing Parenthesis from Attribute Prices

Did you try customizing the file:

includes/languages/english/product_info.php
Line #42 : define('ATTRIBUTES_PRICE_DELIMITER_PREFIX', ' ( ');

And change to read:

define('ATTRIBUTES_PRICE_DELIMITER_PREFIX', ' ');

And the line:

/includes/languages/english/product_info.php
Line #43 : define('ATTRIBUTES_PRICE_DELIMITER_SUFFIX', ' )');

to read:

define('ATTRIBUTES_PRICE_DELIMITER_SUFFIX', ' ');

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!

4 Mar 2009, 5:04 AM
#6
addler avatar

addler

New Zenner

Join Date:
Mar 2009
Posts:
5
Plugin Contributions:
0

Re: Removing Parenthesis from Attribute Prices

Linda,

Thank you, thank you, thank you!! It worked!

4 Mar 2009, 5:41 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Removing Parenthesis from Attribute Prices

Thanks for the update that editing the language files was able to customize the look of the Attribute prices ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!

4 Sep 2010, 2:38 PM
#8
gian123 avatar

gian123

New Zenner

Join Date:
Sep 2010
Posts:
6
Plugin Contributions:
0

Re: Removing Parenthesis from Attribute Prices

polarbear:

Just so happens I was looking to do the same thing. I got it to work by commenting a line out around where the previous poster was pointing to.

I commented out:

else {
$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;
}

> 
> My editor is Coda and that is around line 158-161 or so.



THANK you soooo much it worked a treat on mine! i couldnt get the first post to work because the screen went blank.  But this was perfect 

Cheers
4 Sep 2010, 4:08 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Removing Parenthesis from Attribute Prices

Keep in mind that this is built into Zen Cart and can be changed in the language files with your templates and overrides rather than touching in the code files ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!