Hi,
We have our products set up like this:
Product:
Component (Permutations point to Hidden Products below)
Attribute
Choice #1
Choice #2
[Hidden Product #1]
[Hidden Product #2]
Some products [only] have 1 hidden product. We also have products without Components/Attributes...
What I'm trying to achieve is this:
Products with NO components/Choices to say:
Price: £1.00
Products with a single Choice to say:
Price: £1.00
Products with [multiple] choices to say:
Price from: £1.00
So, what I am doing, in the Standard Tax Inclusive Price template, is looping through the AttributeList/ChoicesList counting up the number of choices... The code works fine and successfully displays the correct text. However, I then get a 'Coding Error' on the selector 'Product Price Including Tax' saying the 'variables won't work there' and don't get to see the price!
This is the complete code from 'Standard Tax Inclusive Price':
<actinic:block PHP='true' SELECTABLE='false'>
$g_bShowDynamicTaxInclusivePrice = true;
$g_bShowDynamicTaxMessage = true;
$g_bShowDynamicTaxExclusivePrice = false;
</actinic:block>
<h3 class="productPrice">
<actinic:block if="%3cactinic%3avariable%20name%3d%22PriceIsEnabled%22%20%2f%3e%20AND%20%28%3cactinic%3avariable%20name%3d%22ProductPriceRaw%22%20%2f%3e%20%21%3d%200%29" >
<!-- START: My new code -->
<!-- If Count of 'Choices' greater than 1 - display "Price from:"... -->
<actinic:block php="true" type="ComponentList" if="%3cactinic%3avariable%20name%3d%22ProductComponentCount%22%20%2f%3e%3e0" >
$nAttributeCount = 0;
$priceText = '<actinic:variable name="ProductPriceDescription" />';
<actinic:block type="AttributeList" >
<actinic:block type="ChoiceList" >
$nAttributeCount++;
</actinic:block>
</actinic:block>
if ($nAttributeCount > 1) $priceText = $priceText.' from';
$priceText = $priceText.': ';
echo $priceText;
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22ProductComponentCount%22%20%2f%3e%3d%3d0" ><actinic:variable name="ProductPriceDescription" />: </actinic:block>
<!-- END: My new code -->
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsFirstQuantityBreak%22%20%2f%3e">
<actinic:block if="%3cactinic%3avariable%20Name%3d%22QuantityDescMax%22%2f%3e%20%3d%3d%201">
(<actinic:variable Name="QuantityDescMax"/> item)
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20Name%3d%22QuantityDescMax%22%2f%3e%20%3e%201">
(<actinic:variable Name="QuantityDescMax"/> or fewer items)
</actinic:block>
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsMiddleQuantityBreak%22%20%2f%3e">
(<actinic:variable Name="QuantityDescMin"/> to <actinic:variable Name="QuantityDescMax"/> items)
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLastQuantityBreak%22%20%2f%3e">
(<Actinic:Variable Name="QuantityDescMin"/> or more items)
</actinic:block>
<actinic:variable name="PreFormattedPrice" value="Product Price Including Tax" />
</h3>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsTaxMessageShown%22%20%2f%3e">
<span class="actxxsmall">
(Including <actinic:block if="%3cactinic%3avariable%20name%3d%22IsTax1Used%22%20%2f%3e"><actinic:variable name="TaxName1"/> at <actinic:variable name="TaxRate1"/>%</actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsTax1AndTax2Used%22%20%2f%3e"> and </actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsTax2Used%22%20%2f%3e"><actinic:variable name="TaxName2"/> at <actinic:variable Name="TaxRate2"/>%</actinic:block>)<br/>
</span>
</actinic:block>
</actinic:block>
If I move the PHP block which displays 'Price From' to [after] the price it works without error but then of course, I don't want to see "£1.00 Price From"...
Also, the code works 100% OK at section level, just not at product level..
Just cannot work this out... or maybe I am using wrong Lists/wrong code?
Any ideas?
Cheers...
KR
Bill
We have our products set up like this:
Product:
Component (Permutations point to Hidden Products below)
Attribute
Choice #1
Choice #2
[Hidden Product #1]
[Hidden Product #2]
Some products [only] have 1 hidden product. We also have products without Components/Attributes...
What I'm trying to achieve is this:
Products with NO components/Choices to say:
Price: £1.00
Products with a single Choice to say:
Price: £1.00
Products with [multiple] choices to say:
Price from: £1.00
So, what I am doing, in the Standard Tax Inclusive Price template, is looping through the AttributeList/ChoicesList counting up the number of choices... The code works fine and successfully displays the correct text. However, I then get a 'Coding Error' on the selector 'Product Price Including Tax' saying the 'variables won't work there' and don't get to see the price!
This is the complete code from 'Standard Tax Inclusive Price':
<actinic:block PHP='true' SELECTABLE='false'>
$g_bShowDynamicTaxInclusivePrice = true;
$g_bShowDynamicTaxMessage = true;
$g_bShowDynamicTaxExclusivePrice = false;
</actinic:block>
<h3 class="productPrice">
<actinic:block if="%3cactinic%3avariable%20name%3d%22PriceIsEnabled%22%20%2f%3e%20AND%20%28%3cactinic%3avariable%20name%3d%22ProductPriceRaw%22%20%2f%3e%20%21%3d%200%29" >
<!-- START: My new code -->
<!-- If Count of 'Choices' greater than 1 - display "Price from:"... -->
<actinic:block php="true" type="ComponentList" if="%3cactinic%3avariable%20name%3d%22ProductComponentCount%22%20%2f%3e%3e0" >
$nAttributeCount = 0;
$priceText = '<actinic:variable name="ProductPriceDescription" />';
<actinic:block type="AttributeList" >
<actinic:block type="ChoiceList" >
$nAttributeCount++;
</actinic:block>
</actinic:block>
if ($nAttributeCount > 1) $priceText = $priceText.' from';
$priceText = $priceText.': ';
echo $priceText;
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22ProductComponentCount%22%20%2f%3e%3d%3d0" ><actinic:variable name="ProductPriceDescription" />: </actinic:block>
<!-- END: My new code -->
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsFirstQuantityBreak%22%20%2f%3e">
<actinic:block if="%3cactinic%3avariable%20Name%3d%22QuantityDescMax%22%2f%3e%20%3d%3d%201">
(<actinic:variable Name="QuantityDescMax"/> item)
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20Name%3d%22QuantityDescMax%22%2f%3e%20%3e%201">
(<actinic:variable Name="QuantityDescMax"/> or fewer items)
</actinic:block>
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsMiddleQuantityBreak%22%20%2f%3e">
(<actinic:variable Name="QuantityDescMin"/> to <actinic:variable Name="QuantityDescMax"/> items)
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLastQuantityBreak%22%20%2f%3e">
(<Actinic:Variable Name="QuantityDescMin"/> or more items)
</actinic:block>
<actinic:variable name="PreFormattedPrice" value="Product Price Including Tax" />
</h3>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsTaxMessageShown%22%20%2f%3e">
<span class="actxxsmall">
(Including <actinic:block if="%3cactinic%3avariable%20name%3d%22IsTax1Used%22%20%2f%3e"><actinic:variable name="TaxName1"/> at <actinic:variable name="TaxRate1"/>%</actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsTax1AndTax2Used%22%20%2f%3e"> and </actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22IsTax2Used%22%20%2f%3e"><actinic:variable name="TaxName2"/> at <actinic:variable Name="TaxRate2"/>%</actinic:block>)<br/>
</span>
</actinic:block>
</actinic:block>
If I move the PHP block which displays 'Price From' to [after] the price it works without error but then of course, I don't want to see "£1.00 Price From"...
Also, the code works 100% OK at section level, just not at product level..
Just cannot work this out... or maybe I am using wrong Lists/wrong code?
Any ideas?
Cheers...
KR
Bill
Comment