Create custom IF function
We created a custom product property field (string) that displays on the product page. What I want to do it have an image display ONLY IF the value of the custom property field ($MyField) equals a specific string "Test".
I can have an image display on the product page if I use <img IF="{product.getMyField())" /> but this displays it as long as the field is not empty. |
Re: Create custom IF function
have you tried wrapping the image tag in an if statement?
{if:product.getMyField() == 'test'} <img> {end:} |
Re: Create custom IF function
Try the following:
1. Create a custom module 2. Decorate the \XLite\View\Product\Details\Customer\Image class 3. Add isVisible() method that checks for the field as follows: Code:
protected function isVisible() Will this work? |
All times are GMT -8. The time now is 06:05 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.