Forums / Setting Up Categories, Products, Attributes / Priced by attributes: Show only price?

Priced by attributes: Show only price?

Started by lat9 on 29 Nov 2014, 8:13 PM · Views: 1,074

Results 1 to 8 of 8
29 Nov 2014, 8:13 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Priced by attributes: Show only price?

I've got a product (Zen Cart v1.5.3) set as "Priced by Attributes", base price is 0, attribute-specific price is the price. Is there any way to get the display for each option to display as just the price, e.g. $25.00, instead of $25.00 ($25.00) -- i.e. losing the parenthetical, unneeded bit?

29 Nov 2014, 11:48 PM
#2
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Location:
North Idaho, USA
Posts:
2,015
Plugin Contributions:
0

Re: Priced by attributes: Show only price?

I'm a bit confused. (not that I would be of much help even if I understood)

Are you saying you see the price in front of the parenthesis and inside the parenthesis

OR
Like this and just want the parenthesis to disappear?

**Please Choose: **Metal

Argentium ( $85.21 (USD) )
Sterling ( $78.88 (USD) )
Silver-filled ( $63.11 (USD) )
Yellow GF ( $123.49 (USD) )
Bronze (rosy) ( $50.53 (USD) )
Copper ( $45.15 (USD) )

Rick
RixStix (dot) com
aka: ChainWeavers (dot) com

29 Nov 2014, 11:55 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Priced by attributes: Show only price?

Am I correct in guessing that your Option Values are called:
$10.00
$20.00
$30.00

Or, what does the layout look like for the Option Name Option Value on each Option Name set?

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!

30 Nov 2014, 1:18 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Priced by attributes: Show only price?

Yes, the option values' text is their dollar value and were displaying as:

Amount  Please select a value...
$25.00 ( $25.00 )
$50.00 ( $50.00 )
$75.00 ( +$75.00 )
$100.00 ( +$100.00 )
$125.00 ( +$125.00 )
$150.00 ( +$150.00 )
$175.00 ( +$175.00 )
$200.00 ( +$200.00 )
$250.00 ( +$250.00 )
$300.00 ( +$300.00 )

What I did was to edit /includes/languages/english/MY_TEMPLATE/product_info.php (since the product in question uses this product type) to change the attributes' price-delimiters:

define('ATTRIBUTES_PRICE_DELIMITER_PREFIX', '<span class="attr-price"> ( ');
define('ATTRIBUTES_PRICE_DELIMITER_SUFFIX', ' )</span>');

and then created a product-specific .CSS file (p_210.css for products_id 210) to "hide" the attributes' repeated price:

.attr-price { display: none; }
30 Nov 2014, 2:51 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Priced by attributes: Show only price?

That works fairly handily ... I will have to remember that one ... :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 Dec 2014, 7:59 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Priced by attributes: Show only price?

That worked OK for radio-button attributes, but for dropdown menu ones the <span></span> shows in the menu. Arggh.

4 Dec 2014, 8:31 PM
#7
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Priced by attributes: Show only price?

lat9:

That worked OK for radio-button attributes, but for dropdown menu ones the <span></span> shows in the menu. Arggh.

Stock by attributes has an option name type that handles html in the dropdown... Not sure something like that would be able to be taken from...

Mind you it's a long way around your elbow to get to your ear though. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

5 Dec 2014, 12:51 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,123
Plugin Contributions:
56

Re: Priced by attributes: Show only price?

Thanks, mc12345678; I went the jQuery route with a bit of (granted, hard-coded) code that will cover the option name (options_id 14 for my case) I want to strip the parenthetical amount from in either a dropdown or radio-button configuration:

$(document).on ('ready', function(){
  $("#attrib-14 option, #productAttributes label[for^=\"attrib-14-\"]").each(function(){
    var parenStart = $(this).text().indexOf ('(');
    if (parenStart != -1) {
      $(this).text($(this).text().substring(0, parenStart));
    }
  });
});