Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Trying to change attribute price layout/text

Trying to change attribute price layout/text

Views: 4,129

Results 1 to 17 of 17
8 Jul 2010, 10:27 PM
#1
totalsam avatar

totalsam

Zen Follower

Join Date:
Jan 2009
Posts:
126
Plugin Contributions:
0

Trying to change attribute price layout/text

Hi,

Having serious problems here and getting a major headache.

I know the solution is simple - just trying to find it is the problem!

Does anyone know how to change the way the attributes displays the price for them (currently (+ $x.xx))?

Basically the reason is that on my gift certificate, priced by attribute, I currently have the attributes looking as follows....

$5.00 (+$5.00)
$10.00 (+$10.00)
etc

which is going to confuse customers as it looks like you have to pay $5 +$5 for a gift cert!

Ideally I would like to hide the attribute price on the customers page for ONLY this product (so only the title is displayed).

Failling that I would like to remove the brackets and + sign so I can have nameless option values, creating the result of:

$5.00
$10.00
etc

Any ideas?

8 Jul 2010, 10:39 PM
#2
totalsam avatar

totalsam

Zen Follower

Join Date:
Jan 2009
Posts:
126
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

I have managed to do the latter of these two options by removing the + sign directly from the attributes controller page and then removing the parenthesis by following these instructions (found 2mins after posting this - typical!) https://www.zen-cart.com/forum/showthread.php?t=101082&highlight=remove+parenthesis+attribute

If anyone knows how to hide the attribute price for the one product I would still like to know as I would far prefer this!!!

9 Jul 2010, 9:27 AM
#3
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Trying to change attribute price layout/text

I'm not sure I understand, but the usual method to price a product by attributes is to set the product price to 0.00, so you'll only see the attribute price.

9 Jul 2010, 12:55 PM
#4
totalsam avatar

totalsam

Zen Follower

Join Date:
Jan 2009
Posts:
126
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

Hello,

The price is set to zero, however the display shows:

OPTION_VALUE ($x.xx)

I would like to hide the price on one product as the option is a selector for the value of the item (a gift certificate) so the option values are set at being prices.

9 Jul 2010, 1:11 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Trying to change attribute price layout/text

A generic way to selectively hide the attribute price would be to use Flexible Attributes from Free Addons, which gives an id to every attribute, and then modify the attribute output to put a span around the price. Then you can use something like

#wAttrib23 .attribPrice {display: none;}

in your stylesheet to hide the particular ones you want.

You may be able to add the span by defining it into ATTRIBUTES_PRICE_DELIMITER_PREFIX and ATTRIBUTES_PRICE_DELIMITER_SUFFIX like

/includes/languages/english/your_template/product_info.php
define {'ATTRIBUTES_PRICE_DELIMITER_PREFIX','<span class="attribPrice">(');
define {'ATTRIBUTES_PRICE_DELIMITER_SUFFIX',')</span>');

20 Oct 2010, 2:33 PM
#6
ticosusa avatar

ticosusa

New Zenner

Join Date:
Oct 2010
Location:
Costa Rica
Posts:
10
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

Since there's a discussion going on about attributes, I'd like to know what governs the output of the Product Attributes on a product listing. For example I'd like to display things like Imported and get rid of Manufactured by and have flexibility on what appears there. Thanks in advance!

20 Oct 2010, 4:29 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Trying to change attribute price layout/text

I don't know how you got that particular layout (did it come with your template?), but those are not attributes. They are "product details", and you can turn most if not all of them off if you want in admin > Catalog > Product Types > Product-General > edit layout. You can redefine the output text like Manufactured by by searching for it in Tools > Developers Toolkit, then editing the language define file that shows you.

21 Oct 2010, 1:56 AM
#8
ticosusa avatar

ticosusa

New Zenner

Join Date:
Oct 2010
Location:
Costa Rica
Posts:
10
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

Thanks, good tip. Searching for keywords really helps. :cool:

15 Jan 2011, 11:44 PM
#9
finlander avatar

finlander

Zen Follower

Join Date:
Oct 2010
Location:
Idaho
Posts:
293
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

gjh42:

A generic way to selectively hide the attribute price would be to use Flexible Attributes from Free Addons, which gives an id to every attribute, and then modify the attribute output to put a span around the price. Then you can use something like

#wAttrib23 .attribPrice {display: none;}

in your stylesheet to hide the particular ones you want.

You may be able to add the span by defining it into ATTRIBUTES_PRICE_DELIMITER_PREFIX and ATTRIBUTES_PRICE_DELIMITER_SUFFIX like

/includes/languages/english/your_template/product_info.php
define {'ATTRIBUTES_PRICE_DELIMITER_PREFIX','<span class="attribPrice">(');
define {'ATTRIBUTES_PRICE_DELIMITER_SUFFIX',')</span>');

Glenn, am I understanding your post correctly?

(1) Your first suggestion with the Flex Attribs add-on would allow for hiding the attrib price on a specific attribute (such as Amount of Gift Cert), so that only Option Value would display (which would be ideal for Gift Certs) and
(2) Your second solution, if doable, would cause the attribute price to disappear globally, across all attributes and products?

so, just wanted to clarify your post .. I'm still looking for a good solution for having Amount of Gift Cert options show a single dollar amount for each Option Value, but in a way that doesn't cause a global change in the Cart.

If the parentheses aren't a big deal, then probably the easiest way to make the Gift Cert page look better and less confusing is just to set the Option Values to blank and give them the correct sort order. Then you get something like example on attached screen shot, with correct pricing at checkout.

Thx..

Jim

17 Jan 2011, 5:21 PM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Trying to change attribute price layout/text

Flexible Attributes makes the class tag treatable on an individual attribute basis. You also need the redefinition with the span tag to give Flexible Attributes a class to grab.

22 Nov 2011, 1:13 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Trying to change attribute price layout/text

A note: when I tested the span in a define, it did not actually treat it as a class tag. So you can do what I suggested above, but unfortunately it will not have the desired effect. You would need to go into the attributes code and add the span with class.

9 May 2012, 10:31 PM
#12
2670otta avatar

2670otta

New Zenner

Join Date:
May 2012
Posts:
8
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

Is it posible to remove the price from a text attribute... I have my attribute on a line and when i add the price to the text attribute the price shows outside the textbox.
My question is, can i add a price to the textbox attribute whitout is shows on the product page but will show on check out.

9 May 2012, 11:22 PM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Trying to change attribute price layout/text

As I posted above, you would need to edit the attribute output code to add a <span class="attribPrice"> </span> around the price so that you could address it individually in the stylesheet. (The "define" tweak is unable to affect the styling.)

10 May 2012, 1:31 PM
#14
2670otta avatar

2670otta

New Zenner

Join Date:
May 2012
Posts:
8
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

Thank

This seems to work great. The price is gone from the textbox. but it seems that <span class="attribPrice"> i showing in the other attribute. is there any way to get <span class="attribPrice"> to not show in dropdown box.

Thanks on advance

10 May 2012, 1:53 PM
#15
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Trying to change attribute price layout/text

That would probably require some more testing of the circumstances to determine what kind of input is being built before inserting the span tags.
What exactly did you do that worked so far?

10 May 2012, 2:09 PM
#16
2670otta avatar

2670otta

New Zenner

Join Date:
May 2012
Posts:
8
Plugin Contributions:
0

Re: Trying to change attribute price layout/text

I inserted the span to product_info.php and added the attribute to my css. The price is gone from my attribute so it seems to work.. but the line i inserted in Product_info.php shows on the dropdown attribute in the shop.
You can see the problem here on the dropdown box in the middle.

http://www.ak-dress.com/index.php?main_page=product_info&cPath=1&products_id=1

Thanks

10 May 2012, 4:35 PM
#17
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Trying to change attribute price layout/text

I don't see a product_info.php file... Did you insert the span in /includes/modules/attributes.php? Where? That file is so complex that I haven't yet untangled the best place for putting the span, though it does distinguish between attribute types and should allow adding the span only where appropriate.