Forums / General Questions / Base price question, how it works

Base price question, how it works

Views: 769

Results 1 to 2 of 2
29 Mar 2011, 2:58 AM
#1
alyona avatar

alyona

New Zenner

Join Date:
Feb 2009
Posts:
12
Plugin Contributions:
0

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

29 Mar 2011, 4:06 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

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.