Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2006
    Posts
    23
    Plugin Contributions
    0

    Default Simplifying Attributes Price Display

    I have a (probably) simple question for zencart code jockeys:

    How can I change the somewhat cluttered Attributes-based price display from this:

    [Product ID here] (+$595.00)

    To a simpler and more direct:

    [Product ID here] – $595.00

    I find that the parenthesis obscures the important info and the "+" is implied so it doesn't need to be there, both of which make the price look kinda like there's junk code around it. I'd like the price to be prominent, not hidden and difficult to read.

    I tried to find a "(+" text string in the zencart files but could not. Is there a file I can edit somewhere that will allow me to put a long dash and a space before the price with <strong> tags around the price?

    Thanks for any help!

  2. #2
    Join Date
    Aug 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Simplifying Attributes Price Display

    Clifford- did you find a resolution to your issue as I too would like to make it more simplier to read.

    Many thanks

  3. #3
    Join Date
    Dec 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Simplifying Attributes Price Display

    No luck. Very frustrating as it seems like it should be simple.

    Here's the file sleuthing I did though without success in finding the function or whatever that spits out the price with the other (+$ characters. Maybe someone with PHP smarts can take it from here and find the place where the offending characters are generated:

    1) Looked up the input tag class from the HTML page source titled "attribsRadioButton" and found it in this file:
    includes/modules/attributes.php

    2) It led to an area that seems to match the HTML source page code string with this:

    Code:
    case '0':
                          $tmp_radio .= zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') . '<label class="attribsRadioButton zero" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options_details . '</label><br />' . "\n";
                          break;
    Note the "products_options_details" portion toward the end label tag. This seems the likely point where the price is inserted.

    3) Searching on that led me to the following file that seems unpromising as it's an admin file and is labeled as preview, both of which would suggest non-public use:

    admin/includes/attributes_preview.php

    4) I noticed that the includes/templates/template_default/templates/tpl_modules_attributes.php file had a likely hook called "options_menu" in the right HTML code. Looking it up revealed little in the following files:

    includes/modules/attributes.php
    admin/includes/attributes_preview.php

    Would somebody who understands how attribute prices are generated with accompanying HTML code in PHP please take a look and tell how to modify the display of prices for clearer look?

    C'mon... purty pleeeze...?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Simplifying Attributes Price Display

    IF you do not want to see the + then leave it blank ...

    + or blank = ADD
    - = SUBTRACT
    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!

  5. #5
    Join Date
    Dec 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Simplifying Attributes Price Display

    Aha, that was lost on me though it's too obvious now.

    What about the removing the parenthesis and making the price bold?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Simplifying Attributes Price Display

    You would have to customize the attributes.php module to remove the parens ...
    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!

  7. #7
    Join Date
    Dec 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Simplifying Attributes Price Display

    Thanks so much for your time and attention to everyone's questions on this forum. It's much appreciated for lesser techy folks like me and for more programerly types as well no doubt!

    Oy... I finally found it. Did you know that the attributes.php file contains 262 instances of the "(" character! Obviously, those are used in PHP programming and I was having a much difficulty in finding the single instance within the many lines of code that was for rendered HTML text as opposed to those needed for PHP.

    What's worse is that there are literally dozens of lines that appear to be the ones that render the attributes ID and prices as seen in the many instances of the <label> tag. None seem to have extraneous parentheses. The offending parentheses are located toward the top in a few lines not encompassed by the <label> tags.

    Here's what I changed. At line 157 is the following code of the includes/modules/attributes.php file:

    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'])) . ') ';
    I changed it to this (while having to remove the "+" from the database separately):

    Code:
    $products_options_display_price= ' &nbsp; &mdash; &nbsp;<strong>' . $products_options->fields['price_prefix'] .
    $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . '</strong> ';
    If you don't want to remove the "+" from the DB via the ZenCart Admin, then lose the price_prefix portion like so:

    Code:
    $products_options_display_price= ' &nbsp; &mdash; &nbsp;<strong>' .
    $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . '</strong> ';
    If you don't want the em dash, then take out the &nbsp; &mdash; &nbsp portion and Viola! a simpler looking price is born.
    Last edited by clifford; 9 Aug 2007 at 05:53 PM.

  8. #8
    Join Date
    Dec 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Simplifying Attributes Price Display

    I'm thinking that the look of pricing is important enough that maybe it should be configurable from the Admin area in ZenCart and not so buried in code.

    Just a thought for designer folk like me who aren't so savvy PHP-wise.

  9. #9
    Join Date
    Dec 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: Simplifying Attributes Price Display

    I just found this post. I wish my searches had been better and I had found it before. The lines to adjust are there.

    Anyhow, it suggests to also change lines 145 and 170 in addition to 157 as I had done.

    http://www.zen-cart.com/forum/showth...ighlight=space

 

 

Similar Threads

  1. v151 How to set which attributes price to be display on product listing
    By kluki2008 in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 7 Feb 2020, 05:40 AM
  2. Display attributes regular price and sale price
    By swanriver in forum Setting Up Specials and SaleMaker
    Replies: 29
    Last Post: 24 Dec 2013, 02:09 AM
  3. Attributes Qty Price Discount Display Issue
    By muuwa in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 7 Oct 2011, 08:06 PM
  4. Incorrect Display Price (by attributes)
    By DiZZ in forum General Questions
    Replies: 0
    Last Post: 29 Apr 2008, 01:06 AM
  5. Display price will include lowest group attributes prices plus price
    By jtjohnston in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 3 Feb 2008, 06:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg