Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Removing brackets from around attributes price

Removing brackets from around attributes price

Views: 4,202

Results 1 to 12 of 12
2 Apr 2009, 9:21 PM
#1
g3steve avatar

g3steve

New Zenner

Join Date:
Nov 2007
Posts:
55
Plugin Contributions:
0

Removing brackets from around attributes price

Hello,

I've spent hours searching how to do this but cannot seem to find a solutions anywhere. Im wanting to remove the brackets from around my pricing attributes on the product listins, at the moment they look like this:

Each (+£1,200.00)

I want them to look like this:

£1,200.00 Each.

Can anyone advise on how to remove the ( ) from around the price?

I have managed to remove the + from the attributes controller and that solves that bit but i need to get rid of the brackets now!

Also, i want to swap it round so the price is displayed first and then the attribute name, can anyone tell me where this is declared?

Thanks alot for you time

Steve

3 Apr 2009, 10:17 AM
#3
g3steve avatar

g3steve

New Zenner

Join Date:
Nov 2007
Posts:
55
Plugin Contributions:
0

Re: Removing brackets from around attributes price

Hi

Thankyou for your reply but the two posts which you linked me to were made back in 2005 and the file layout seems to have changes somewhat so i cannot find the correct file, it refers to:

Im running version 1.3.8a and the following which the other treads refers to are not there:

includes/modules/pages/product_info/main_template_vars_attributes.php

Within the product_info folder that is no file called main_template_vars_attributes.php

I've looked at other threads which say /includes/modules/your_template_dir/attributes.php is the file im looking for but i cannot find the brackets in there either.

Can anyone provide code examples of what needs changing and where i can find the brackets as im at a total loss at the moment!

Thanks

steve

3 Apr 2009, 1:51 PM
#5
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Removing brackets from around attributes price

Steve,
includes/ modules/ attributes.php

if ($products_options->fields['options_values_price'] != '0' and ($products_options->fields['product_attribute_is_free'] != '1' and $product_info->fields['product_is_free'] != '1')) {
// show sale maker discount if a percentage
$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;

  1. Notice the highlighted red font above.
  2. This is what is controlling the ( )
  3. admin panel/ tools/ developers tool kit
  4. search for:
  5. the highlighted red font above
  6. you will see the .php file to edit
  7. or rewrite the code above to exclude the brackets
  8. remember the override system.
  9. includes/ modules/ your_template/ attributes.php
3 Apr 2009, 4:07 PM
#6
g3steve avatar

g3steve

New Zenner

Join Date:
Nov 2007
Posts:
55
Plugin Contributions:
0

Re: Removing brackets from around attributes price

Thankyou for you help, thats perfect!

I've managed to get rid of the bracket by removing ATTRIBUTES_PRICE_DELIMITER_SUFFIX from the attributes file.

But at the moment its displaying as:

Each£49.00

I need it to display as £49.00 Each

Could you advise how to swop the price and the option name around and also put a space inbetween them!

Thankyou again for all your help!

5 Apr 2009, 1:53 PM
#7
g3steve avatar

g3steve

New Zenner

Join Date:
Nov 2007
Posts:
55
Plugin Contributions:
0

Re: Removing brackets from around attributes price

Im really starting to bang my head against the wall now, i just cant seems to find now to swop the price and attribute name around as its still showing as:

Each£12.00

I really need to show it liek:

£12.00 Each

Can anyone help please, some code extracts?

5 Apr 2009, 4:46 PM
#8
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Removing brackets from around attributes price

g3steve:

Im really starting to bang my head against the wall now, i just cant seems to find now to swop the price and attribute name around as its still showing as:

Each£12.00

I really need to show it liek:

£12.00 Each

Can anyone help please, some code extracts?

G3,
Have this tried this yet:

https://www.zen-cart.com/tutorials/index.php?article=39

  1. Search for:
  2. Each
  3. this will locate the .php in which you will make the changes
5 Apr 2009, 8:12 PM
#9
g3steve avatar

g3steve

New Zenner

Join Date:
Nov 2007
Posts:
55
Plugin Contributions:
0

Re: Removing brackets from around attributes price

Hey,

Thanks again for your input, yes i've tried the developers tookit but it doesn't seem to be getting me anywhere.

The "each" is the option name which comes from the database so it doesn't show when i do a search im afraid :(

Ive found that:
$products_options_display_price - controls the price

$products_options_details - controls the option name e.g. Each

but ive searched for these and they are both defined in different files and not in the same file, one after each other. So im so confused what to do, can anyone provide instructions on whats needed?

6 Apr 2009, 11:12 AM
#10
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Removing brackets from around attributes price

How do you end up with the word Each in your attribute ? zc dosn't add that to attribute .. or am i missing something . ?

6 Apr 2009, 1:50 PM
#11
g3steve avatar

g3steve

New Zenner

Join Date:
Nov 2007
Posts:
55
Plugin Contributions:
0

Re: Removing brackets from around attributes price

"Each" is the name of the attribute, so when i originally added it and it displayed as an attribute is looked like this:

Each (+£14.99)

I've managed to remove the + and the () but now its displaying as:

Each£14.99 and i want it to display as:

£14.99 Each

Hope someone can help!

Thanks

steve

4 Feb 2010, 4:11 AM
#12
pooka avatar

pooka

New Zenner

Join Date:
Jan 2010
Posts:
10
Plugin Contributions:
0

Re: Removing brackets from around attributes price

I know this is an older thread but I needed the same thing and found a solution. Thought I'd post for anyone needed it...
This will put take out the Brackets around the attribute price and replace with spaces instead. The space is needed so the $Price is not butted right next to the option name.
Silver$50 ---> Silver $50

Attributes.php file:

Find this code:

$products_options_display_price= ' (' . $products_options->fields['price_prefix'] .
$currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ') ';

Change to THIS:

$products_options_display_price= '  ' . $products_options->fields['price_prefix'] .
$currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . '  ';

Basically just swapping out the (brackets) for a space.