Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    12
    Plugin Contributions
    0

    Default Base price question, how it works

    Here is a code below from tpl_product_info_display.php file and I have a question about it.
    <?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']);
    ?>



    When the price is set and attributes are added it reads second part of the code above:
    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']);
    and accordingly shows TEXT_BASE_PRICE text in the listing

    If there is no attribute set in the listing it reads the first part of the code and exactly this part:
    } else {
    $one_time = '';
    }

    so the listing has only price with no words.

    And I need it to read this code part only:
    // base price
    if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';


    so the listing would show TEXT_ONETIME_CHARGE_SYMBOL and TEXT_ONETIME_CHARGE_DESCRIPTION text in the listing

    I hope I explained it clear. If there any switch in admin to make this code work?

    Thank you in advance

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

    Default Re: Base price question, how it works

    You have misidentified the code sections: the if($show_onetime_charges_description == 'true') selects between the two $one_time = lines, based on the value of that variable. The variable is set automatically in /includes/modules/attributes.php, line 131, presumably based on whether the product has attributes.

    The echo $one_time . line is always processed.

 

 

Similar Threads

  1. Price by attribute turned off but still adding base price
    By Rickk123 in forum Setting Up Categories, Products, Attributes
    Replies: 10
    Last Post: 26 Aug 2010, 11:19 PM
  2. Replies: 17
    Last Post: 21 Mar 2010, 05:57 PM
  3. how to use Attributes exclude the base price
    By hoyin630 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 27 Apr 2009, 05:06 PM
  4. Including Attribute Price Factor In Base Price Dropdown Menu
    By rob28870 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 1 Oct 2008, 10:14 AM
  5. Shipping: base price + price for each additional item
    By amieco in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 26 Jun 2007, 06:25 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