I have a function on our PROD template that I would like not to display on certain products. The function shows how many points can be earned on the product. I have a few products that do not earn points (gift cards, etc). The way it shows now is 0 points.
Announcement
Collapse
No announcement yet.
Product Page Conditional Help
Collapse
X
-
You could set up a custom product field checkbox with a code of no_loyalty_points and a name of No Loyalty Points
Then on the PROD Template go to the Product Display Layout section and move the new custom field to the selected box and then click update.
Then wrap this conditional around your function and click update:
Code:<mvt:if expr="l.settings:product:customfield_values:customfields:no_loyalty_points NE '1'"> <mvt:comment> Checkbox is not checked --^ </mvt:comment> Function goes here </mvt:if>
Nick Harkins
www.loveisarose.com
-
If the number of points is available in an mvt: variable, you don't need a custom field. You can just put an mvt:if element on the page, so that the message about points is only displayed when the number is greater than zero.Kent Multer
Magic Metal Productions
http://TheMagicM.com
* Web developer/designer
* E-commerce and Miva
* Author, The Official Miva Web Scripting Book -- available on-line:
http://www.amazon.com/exec/obidos/IS...icmetalproducA
Comment
-
Ah yes Kent Multer I should have suggested he used the token list to see if there is a variable for the number of points. Very good point... pun intended...Nick Harkins
www.loveisarose.com
Comment
-
Try this:
Code:<mvt:item name="points" param="Product_Points( l.settings:basket, l.settings:product, 0, 0, 1, l.settings:product:points_information )" /> <mvt:if expr="l.settings:product:points_information:points_total GT 0"> <i>This item Earns &mvt:product:points_information:points_total; Horse & Kennel Rewards Points</i> </mvt:if>
Nick Harkins
www.loveisarose.com
Comment
Comment