Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1

    help question Price Layout Customization ZCV138a

    I am trying to customize my price layout so that it displays like this:



    However I can't seem to figure out how to do it. The code that is calling it within the product display page is

    PHP Code:
    <!--bof Product Price block -->
    <h2 id="productPrices" class="productGeneral">
    <?php
    // base price
      
    if ($show_onetime_charges_description == 'true') {
        
    $one_time '<span >' TEXT_ONETIME_CHARGE_SYMBOL TEXT_ONETIME_CHARGE_DESCRIPTION '</span><br />';
      } else {
        
    $one_time '';
      }
      echo 
    $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE '') . zen_get_products_display_price((int)$_GET['products_id']);
    ?></h2>
    <!--eof Product Price block -->
    And it currently looks like this:



    Any help on achieving this would greatly be appreciated! Thanks so much!

    J.:
    Last edited by cs_jono; 2 Apr 2010 at 04:41 PM. Reason: Change Image

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

    Default Re: Price Layout Customization ZCV138a

    You would need to customize the function in the functions_prices.php for: zen_get_products_display_price

    Be sure to keep backups of the original functions_prices.php as this is not an override file ...
    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!

  3. #3

    Default Re: Price Layout Customization ZCV138a

    Quote Originally Posted by Ajeh View Post
    You would need to customize the function in the functions_prices.php for: zen_get_products_display_price

    Be sure to keep backups of the original functions_prices.php as this is not an override file ...
    Hey Ajeh,

    Thanks for the reply. Do you happen to know exactly how I would need to customize. Sorry I'm not very PHP savvy.

    J.:

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

    Default Re: Price Layout Customization ZCV138a

    I would actually have to sit down and write all of the customizations for this function to make the display price work in this manner ... and that can take quite a bit of time ...

    Customizing that function does have a plus side in that once you figure it out ... it works everywhere that the prices are displayed ...
    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

    Default Re: Price Layout Customization ZCV138a

    Ok well thank you for help! If any one else has already customized this page or has the time to do it that would be amazing but there is so much code in the file I have no idea where to start. Thank you!

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

    Default Re: Price Layout Customization ZCV138a

    I looked through the function and tried to do this the long way ... gads what a nightmare ...

    Then looked at it again and may have a short simple way for you ...

    Find the function in the functions_prices.php

    And locate this part of the code and try it with the change I have in there so you can see the results:
    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;
          $final_display_price = 'xNORMAL PRICE' . $show_normal_price . 'x' . 'ySPECIAL' . $show_special_price . 'y' . 'zSALE' . $show_sale_price . 'z' . 'dDISCOUNT' . $show_sale_discount . 'd';
        }
    The letters are to show you the start and end of each price component ...

    You may be able to get away with changing that one line rather than all the code ...
    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

    Default Re: Price Layout Customization ZCV138a

    Hey,

    Yeah the long way sounds like doing long division when you were in elementary school.

    So the code that you gave me works besides when you aren't having a price for sale

    This is what it looks like when you don't have a discount



    The code that I have is
    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 'Retail:&nbsp;' $show_normal_price '<br />Today:&nbsp;' $show_special_price $show_sale_price $show_sale_discount;
        } 
    Have any idea why it's doing that?

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

    Default Re: Price Layout Customization ZCV138a

    The "Long way" sets the values properly ...

    The "Short way" does not test to see if there is a value to any of these and just adds each value together ...

    If you built the final string based on IF there is something to add ... then it would work better ...
    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!

  9. #9

    Default Re: Price Layout Customization ZCV138a

    I know I am kind of a joke...but how would you do that?

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

    Default Re: Price Layout Customization ZCV138a

    $final_display_price is built from the components below:
    Code:
          $final_display_price = 'Retail:&nbsp;' . $show_normal_price . '<br />Today:&nbsp;' . $show_special_price . $show_sale_price . $show_sale_discount;
    But if there wasn't a $show_normal_price then why say it:
    Code:
    ($show_normal_price ? 'Retail:&nbsp;' . $show_normal_price : '')
    If there wasn't a $show_special_price then why say it:
    Code:
    ($show_special_price ? '<br />Today:&nbsp;' . $show_special_price : '')
    If there wasn't a Sale Price why say it:
    Code:
    ($show_sale_price ? $show_sale_price : '')
    If there wasn't a Discount why say it:
    Code:
    ($show_sale_discount ? $show_sale_discount : '')
    So ... put it all together and see if all of the pricing combos look right for:
    Products no special no sale no discount
    Products special no sale discount
    Products no special sale discount
    Products special sale discount

    Code:
          $final_display_price = ($show_normal_price ? 'Retail:&nbsp;' . $show_normal_price : '') . ($show_special_price ? '<br />Today:&nbsp;' . $show_special_price : '') . ($show_sale_price ? $show_sale_price : '') . ($show_sale_discount ? $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!]
    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!

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Layout Customization
    By faithtong in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 20 Mar 2009, 01:42 AM
  2. Layout box customization..
    By nekosgrace in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 21 Oct 2006, 01:43 PM

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