Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2008
    Posts
    17
    Plugin Contributions
    0

    Default Quick template edit question for price and sale price

    Hi folks. I am trying to help someone edit something real fast located here.. http://www.outplaypoker.com/playing-...ard-set-p-1792

    Right now our setup looks like this:
    $30.99 $27.99
    Save 10% Off

    I want our setup to look like:
    Competitors Price: $30.99
    Our Price: $27.99
    Save 10% With Us!

    Can't track this down to save my life.

    thanks,
    Nigel

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,536
    Plugin Contributions
    127

    Default Re: Quick template edit question for price and sale price

    It's not done in a template; it's done in the pricing function. This is pretty complex logic; you might not want to modify it.
    That Software Guy. My Store: Zen Cart Support
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Quick template edit question for price and sale price

    If all of your products will have the same setup here, you may be able to add output text around the parts of the price output. The
    Save 10% Off
    has to be defined in a language file, so you could alter it to
    Save 10% With Us!

    The .normalprice {} class that applies to the regular price is styled with a strikethrough, and you can change that in the stylesheet.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Quick template edit question for price and sale price

    OK, the entire price output is formatted in the function, with no possibility of modifying or interpolating in its output in tpl_product_info_display.php. The function zen_get_products_display_price($products_id) is extremely complex, and trying to modify its elements as they are being built would be dangerous. However, there is one point where the price elements are all concatenated in one statement (in two versions), and carefully adding text/formatting output there might be safe and simple enough to attempt.
    PHP 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_special_price $show_sale_price $show_sale_discount;
        } 
    Something like
    PHP 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 'Competitors Price: ' .$show_normal_price '<br />Our Price: ' $show_special_price $show_sale_price $show_sale_discount;
        } 
    This hard-coding is not recommended practice, and it would be better to insert a constant in each of those locations and define the constant in a language file.
    SHOW_NORMAL_PRICE_PRE
    SHOW_SPECIAL_PRICE_PRE

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Quick template edit question for price and sale price

    A way to do this in modern browsers (IE8 and newer, or pretty much all other leading browsers) is in the stylesheet with "pseudo-elements". You don't have to touch the PHP code at all, as long as the base elements have distinguishable identifiers (which the prices do).
    Code:
    <!--bof Product Price block -->
    <h2 id="productPrices" class="productGeneral">
    <span class="normalprice">$30.99 </span>&nbsp;<span class="productSpecialPrice">$27.99</span><span class="productPriceDiscount"><br />Our Price:&nbsp;10% off</span></h2>
    
    <!--eof Product Price block -->
    Code:
    .normalprice {display: block;}
    .normalprice:before {content:'Competitors Price: ';}
    .productSpecialPrice:before {content:'Our Price: ';}
    Last edited by gjh42; 15 Sep 2010 at 04:14 AM.

 

 

Similar Threads

  1. 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
  2. v139h Display regular price AND sale price on email confirmation ?
    By sportbiker in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Nov 2013, 09:45 PM
  3. Show Normal Price and Sale Price by Attribute
    By katrobb in forum Setting Up Specials and SaleMaker
    Replies: 1
    Last Post: 4 Oct 2010, 01:28 AM
  4. How to ignore sale price and apply group Discount to original product price?
    By cushietushies in forum Setting Up Specials and SaleMaker
    Replies: 2
    Last Post: 25 Jul 2008, 05:51 AM
  5. Replies: 4
    Last Post: 28 Apr 2008, 04:15 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