Using MIVA Custom Product Fields in the Product Page Template
Here’s another quick how-to for MIVA Merchant version 4.24, using the OpenUI Look & Feel module and the Viking Coders Product Page Templates module.
I needed a way to check the contents of a MIVA custom field (not the fields created with the Viking Coders Additional Product Fields Manager) but rather those created within the default MIVA custom product fields screen.
Essentially, it involves adding a simple if statement to check if the product field equals a certain value, and then outputting a block of text to the screen. In this example, I want to check the custom product field called ZILLABRAND and see if it was equal to Xterra. If it does contain that value, then I want to display some additional text about that brand.
Here is the code:
%ACTION(XPFIELDS)%
%IF(g.OUI_Xproducts:ZILLABRAND EQ 'Xterra')%
<BR><div style="font-family:verdana, arial; font-size:10px;">Sizing Tips: Xterra Wetsuits are running small this year. If you are at the high end of height or weight, please choose next size up. Contact us for additional assistance.</div>
%IFEND%
Basically this calls the value of the fields using the ACTION command and then checks the value of the ZILLABRAND field (previously created). I also added a div around the output to format the display of the text.
Also, make sure to put the required %OUI% at the very top line in the product page template module.
I was able to gather most of this information from the not-so-informative user forums at the OpenUI website - http://www.openui.org/openui_forum.php
Again, this example uses the Product Page Templates module available at Viking Coders.
Hope this helps.
Tags: miva+merchant, miva, shopping+cart, ecommerce, e-commerce, OpenUI, MIVA+OpenUI, miva+programming





















