Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Different drop-down displays on attributes with recurring v. one-time price

Different drop-down displays on attributes with recurring v. one-time price

Views: 681

Results 1 to 3 of 3
1 Feb 2013, 12:56 AM
#1
kenbaker avatar

kenbaker

New Zenner

Join Date:
Dec 2012
Posts:
66
Plugin Contributions:
0

Different drop-down displays on attributes with recurring v. one-time price

This problem isn't earth-shattering,

just nagging. When I enter attribute prices through the Attributes Controller, if the price is recurring (applied to multiple quantities purchased), the attribute and price display nicely in my drop-down menus. For example, if people must pay $5.50 more for a super-large cookie (for each cookie that they buy), the attribute displays thus in the drop-down menu:

Super-Large Cookie (+$5.50)

If, on the other hand, I enter a one-time price for an attribute (say, a one-time shipping surcharge to Alaska/Hawaii, applied only once to an order, no matter how many items are ordered), the attribute displays poorly in the drop-down menu, thus:

Alaska/Hawaii Delivery$12.50

I've scoured the tpl_product_info_display.php file, but I can't seem to find the lines that control the one-time price display. I also searched the forum, of course, but frankly I didn't even know what to look for. All I want to do is make the one-time price attribute look the same as the regular price attribute in my drop-down menus. Any direction would be much appreciated.

KenBaker

1 Feb 2013, 1:46 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Different drop-down displays on attributes with recurring v. one-time price

How exactly do you want it to display?

Just guessing, but you could maybe change /includes/modules/name_of_your_template_here/attributes.php
around line 146

                      $price_onetime = TEXT_ONETIME_CHARGE_SYMBOL[B] . ATTRIBUTES_PRICE_DELIMITER_PREFIX .[/B] $currencies->display_price($new_onetime_charges, zen_get_tax_rate($product_info->fields['products_tax_class_id']))[B] . ATTRIBUTES_PRICE_DELIMITER_SUFFIX[/B];
3 Feb 2013, 12:47 PM
#3
kenbaker avatar

kenbaker

New Zenner

Join Date:
Dec 2012
Posts:
66
Plugin Contributions:
0

Re: Different drop-down displays on attributes with recurring v. one-time price

DrByte,

Thanks kindly for the direction, which allowed me to fix this little issue. I needed a day or so of puzzling over your direction, as I couldn't find the exact line of code that you referred to. Of course I couldn't, because you meant that I should add the red text to the existing code. When I did so, attributes with one-time prices now display just as do the attributes with recurring prices.

To answer your question (now moot), "How exactly do you want it to display?", I wanted the attributes with one-time prices to display just the same as the attributes with recurring prices. In my original post, I gave these two examples:

Display, attributes with recurring prices: Super-Large Cookie (+$5.50)
Display, attributes with one-time prices: Alaska/Hawaii Delivery$12.50

As you can see, the display for attributes with recurring prices is attractive and easily read, while the display for attributes with one-time prices is smushed together and harder to read. When, however, I made your suggested changes to the attributes.php file, both displays look exactly the same, to wit:

Display, attributes with recurring prices: Super-Large Cookie (+$5.50)
Display, attributes with one-time prices: Alaska/Hawaii Delivery ($12.50)

To my mind (which has been accused of being entirely too tidy and persnickety about the little things), this standardized display of attributes (whether with recurring or one-time prices) should be the standard display built into ZenCart.

But no matter, as I am now a happy camper with my attributes drop-down menus, which point allows me to close by thanking you once again for the direction. As with practically everything in the world, the solution's quite simple when someone points it out to you.

Regards,

KenBaker