Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2012
    Posts
    67
    Plugin Contributions
    0

    Default adding an asterisk to zen_get_products_display_price((int)

    My goal is to make it so that there is an asterisk after the price.
    ie: $36.98*

    I have managed to do this without having a sale in place. However, if there is a sale, the asterisk becomes

    $28.99
    22% off*

    The code I need to modify is:
    zen_get_products_display_price((int)$_GET['products_id']) ;

    I don't know how to get a . '*' . in there without it creating an error. My cache didn't pick anything up which is frustrating in itself. Can someone please help.

    Thanks!

  2. #2
    Join Date
    Feb 2012
    Posts
    67
    Plugin Contributions
    0

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    please help

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

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    Look around line 261 and see if this does what you are looking for:
    Code:
        if ($display_normal_price == 0) {
          // don't show the $0.00
          $final_display_price = $show_special_price .  $show_sale_price . $show_sale_discount;
        } else {
          $final_display_price = $show_normal_price . ($show_sale_discount != '' ? '*' : '') . $show_special_price . $show_sale_price . $show_sale_discount;
        }
    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: v1.5.5]
    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. #4
    Join Date
    Feb 2012
    Posts
    67
    Plugin Contributions
    0

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    Perfect. Once again Ajeh, you are amazing.

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

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    You are most welcome ... thanks for the update that this worked for you ...
    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: v1.5.5]
    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!

  6. #6
    Join Date
    May 2005
    Posts
    532
    Plugin Contributions
    0

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    Ajeh,

    I am trying to use the zen_get_products_display_price function in a similar way on my product listing page.

    if the price is above a certain amount eg £20 then display a message - free delivery.

    2 questions. in the file modules/product_listing.php the $lc_price seems to be a text string I have trimmed the £ and converted it to an integer and this seems to work for the product with out a special - ie I get my message. but if there is a sale or a special then the text does not appear. If I understand the function correctly after all its actions it retuns the $final_display_price which is passed to $lc_price.

    I am assuming that this must be a string with more than just the price (ie it must have the original price and the sale price in it.

    Should I be trying to append my message in the function or in the module and if in the module how can I get the final sale price out of the function so my free delivery message shows / or does not show if the sale price goes below my value.

    my code is currently in the product_listing.php file as:

    case 'PRODUCT_LIST_PRICE':
    $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
    //if ($listing->fields['products_price'] >= '13.88' ) {$lcpricetext = '<a>Free UK delivery</a>'; } else {$lcpricetext = "";}
    $mylcprice = trim($lc_price,£);
    settype($myclprice, "integer");
    if ($mylcprice >=12) {$lcpricetext = '<a>Free UK delivery</a>'; } else {$lcpricetext = "";}
    $lc_align = 'left';
    $lc_text = '<span id="productListingprice">'. //PRODUCT_LISTING_PRICE_TEXT .
    $lc_price . $lcpricetext. '</span>';

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

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    The values for the normal, sale and special price are set in:
    Code:
        $display_normal_price = zen_get_products_base_price($products_id);
        $display_special_price = zen_get_products_special_price($products_id, true);
        $display_sale_price = zen_get_products_special_price($products_id, false);
    You could use those 3 to determine what the real price is without the text added to them then calculate which is the lowest price to manage your message ...
    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: v1.5.5]
    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!

  8. #8
    Join Date
    May 2005
    Posts
    532
    Plugin Contributions
    0

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    Ajeh,

    Thank you for this pointer. As I am not a true developer, more a business owner trying to find his way.

    should I be using these and creating a new function in the function_prices file to detemine the price or can I call them from the module product_listing and work it out there. A question of best practice really and then I can go away and work it out.

    Thanks

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

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    If you only want that on the product_listing.php module then you could use another function in there, example test:
    Code:
            case 'PRODUCT_LIST_PRICE':
            echo 'Actual Price: ' . zen_get_products_actual_price($listing->fields['products_id']) . '<br>';
            $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
            $lc_align = 'right';
            $lc_text =  $lc_price;
    that should give you the actual product price without converting it to currency format and help take the work out of it ...
    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: v1.5.5]
    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!

  10. #10
    Join Date
    May 2005
    Posts
    532
    Plugin Contributions
    0

    Default Re: adding an asterisk to zen_get_products_display_price((int)

    Ajeh,

    Thank you. That does the trick - zen_get_products_actual_price($listing->fields['products_id'])

    I have equated my variable to zen_get_products_actual_price($listing->fields['products_id']) and then kept the same code as I originally had to determine if the text should show or not.

    The one minor issue is that this is a net value and therefore on products such as clothes without VAT it will mean the text shows at a slighty lower price ie a £15 item gets free carriage which in the equation is 12.50 net but a 12.50 childs t-shirt will get free carriage. -

    I had a look through the price functions and could not see one that would produce the actual price including tax.

    Does that make sense? Hope so and thank you again for you quick responses.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Asterisk Alignment Problem at Checkout
    By ricangem in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 3 Feb 2014, 02:39 PM
  2. v150 Red asterisk on required attributes & issue with required attribute
    By ShopVille in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 13 Feb 2013, 03:18 AM
  3. Function zen_get_products_display_price in admin issue
    By Robbie_79 in forum General Questions
    Replies: 3
    Last Post: 9 Dec 2009, 04:40 AM
  4. The function zen_get_products_display_price
    By g.nencini in forum General Questions
    Replies: 3
    Last Post: 23 May 2009, 09:22 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR