![]() |
4.6 Change in Extra Fields IF Statement
I am in the process of upgrading our 4.5.4 store to 4.6.1 . Our template has some modifications which are transferring over for the most part, but I am having a hard time with IF Statements for Extrafields.
Previously I had the following code in skin/templateX/customer/main/product.tpl . The result would the that a message would display directly below the image if we marked the extra field. Code:
{****** Product Page Sub-Image Messages ******} It worked famously in 4.5 but is evading me now. Any suggestions would be greatly appreciated. Thanks, |
Re: 4.6 Change in Extra Fields IF Statement
You are calling the extra fields arrays with very specific numbers. Are you sure they are just like that with the new upgraded cart? It will be actually more cleaner and error prove if you loop through the extra fields array and have your ifs compare the extra field service name to make sure it is the one you need
|
Re: 4.6 Change in Extra Fields IF Statement
Thanks Steve. We have used this mod for several versions and to be honest I have not thought to really dig too much into it since it worked. Though, if $extra_fields.x.field_value is only referring to the array position and not the field id, I'm not really sure how it worked in the past since we do not use all fields for all products.
Either way, I modified the syntax to call the service_name instead as shown below. I cannot use the extra_fileds product.tpl as is because we have a different output for the same field in different situations. It seems to me that there must be a more efficient way to do this through variable assignment so I could call a generic template file that would allow me to customize the output based on the call. But perhaps it would be more effort than it is worth. Code:
{foreach from=$extra_fields item=v} |
All times are GMT -8. The time now is 03:16 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.