Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Remove/modify display of PRICE_PREFIX?

Remove/modify display of PRICE_PREFIX?

Locked

Views: 2,376

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
27 Apr 2007, 5:35 PM
#1
crosswraith avatar

crosswraith

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Remove/modify display of PRICE_PREFIX?

Seems like nobody has asked about this before, so I started a new thread, which I is posted in the right place (hmm, maybe a "coding customizations-forum" would be more relevant:smartalec: ).

I'm trying to modify/remove the display of PRICE_PREFIX. When you create menu's using for example radio buttons (which involves attributes), the parenthesis and +"price" is automatically added to every attribute-menu-choice. I'd like to remove the parenthesis, display some other "symbols" and remove the +sign.
Now PRICE_PREFIX has a functionality as well, and especially important is that I don't mess up with the database entries when doing this customization. Therefore the + has to be added into the database when new attributes are made. So I was wondering what file to edit (avoiding DB trouble:no: ), and where that line of code can be found.

Thanks in advance!:smile:

27 Apr 2007, 5:51 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,616
Plugin Contributions:
0

Re: Remove/modify display of PRICE_PREFIX?

Peek in the attributes template and module.

5 May 2007, 1:57 PM
#3
crosswraith avatar

crosswraith

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Remove/modify display of PRICE_PREFIX?

Kim:

Peek in the attributes template and module.

hmm couldn't see the + and/or the parenthesis in that file. But maybe I've misunderstood what PRICE_PREFIX really is. Ok whatever this + sign and parenthesis is called, where is it located (where can I remove it from displaying completely on the "product info pages" that the customers see when looking at single 1 product).

5 May 2007, 2:12 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Remove/modify display of PRICE_PREFIX?

If you don't want to see the + on the price ... then just do not add it to the Attribute ...

  • and blank are Adding to the price
  • is subtracting from the price
5 May 2007, 2:21 PM
#5
crosswraith avatar

crosswraith

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Remove/modify display of PRICE_PREFIX?

Ajeh:

If you don't want to see the + on the price ... then just do not add it to the Attribute ...

  • and blank are Adding to the price
  • is subtracting from the price

Allright, that means it's added into the database. And with that + would be the same as no symbol at all?

5 May 2007, 2:24 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Remove/modify display of PRICE_PREFIX?

That is correct ...

Product Price 15.00
Price Prefix +
Price 10.00

Price would be $25.00

Product Price 15.00
Price Prefix (blank)
Price 10.00

Price would be $25.00

Product Price 15.00
Price Prefix -
Price 10.00

Price would be $5.00

5 May 2007, 2:26 PM
#7
crosswraith avatar

crosswraith

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Remove/modify display of PRICE_PREFIX?

Yup I just found it :clap: :

the + sign is stored in the table called: zen_products_attributes
In the column called: price_prefix

Now I was wondering if I can just do a massupdate (I know how to do this massupdate, but is it safe to only change this value, or more values in other places have to be changed as well) in the database, by simply replacing all the + in that column (price_prefix)? Would I have to remove the + in any other place inside the database?

5 May 2007, 2:29 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Remove/modify display of PRICE_PREFIX?

You can replace all the price_prefix with blank where price_prefix = +

UPDATE products_attributes SET price_prefix = '' WHERE price_prefix = '+';

Then if you use any Priced by Attribute products, you would want to run the Tools ... Store Manager ... Update Product Price Sorter ...

5 May 2007, 4:15 PM
#9
crosswraith avatar

crosswraith

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Remove/modify display of PRICE_PREFIX?

Ajeh:

You can replace all the price_prefix with blank where price_prefix = +

UPDATE products_attributes SET price_prefix = '' WHERE price_prefix = '+';

> 
> Then if you use any Priced by Attribute products, you would want to run the Tools ... Store Manager ... Update Product Price Sorter ...

Thank you:hug: , but with this do you mean that this is the only place in the DB where the update is needed (just want to make sure so I avoid DB problems later on:ohmy: )?

Where can I remove that parenthesis that is displayed, see example (+$5.00).
Doing a search through all files, looking for "()" is not possible since there is the price in between:cry: . And "(" will be encountered in almost every PHP-file:wacko:  since the "()" is a very common part of the PHP coding-itself.
5 May 2007, 4:19 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Remove/modify display of PRICE_PREFIX?

You would need to edit the module for the attributes ...
/includes/modules/attributes.php

and copy to your templates and overrides directory:
/includes/modules/your_template_dir/attributes.php

Searching on:
' (
) '

should help you locate where those are set on the price ...

5 May 2007, 4:33 PM
#11
crosswraith avatar

crosswraith

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Remove/modify display of PRICE_PREFIX?

Ajeh:

You would need to edit the module for the attributes ...
/includes/modules/attributes.php

and copy to your templates and overrides directory:
/includes/modules/your_template_dir/attributes.php

Searching on:
' (
) '

should help you locate where those are set on the price ...

Yeah that just did the trick:cheers: And it makes perfectly sense with the enclosing, as this is PHP...:frusty:

And actually notice the space in between the enclosing and the (. For example:
'space(
or
)space'

There are several thousand files making up ZC, so pointing the right file to me was like a gift from the sky :cool: I guess doing that search through all files, would return a couple of hundred files containing that, so that saved med some time:thumbsup:

5 May 2007, 4:35 PM
#12
crosswraith avatar

crosswraith

New Zenner

Join Date:
May 2006
Posts:
76
Plugin Contributions:
0

Re: Remove/modify display of PRICE_PREFIX?

To save some time for others, I'm posting the line that would be the correct one in this case:

$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'])) . ') ';
5 May 2007, 6:12 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Remove/modify display of PRICE_PREFIX?

NOTE: there are other lines based on the Option Name Option Type being used that use this ... :cool: