| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
4.6 Change in Extra Fields IF Statement | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
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:
It worked famously in 4.5 but is evading me now. Any suggestions would be greatly appreciated. Thanks,
__________________
Business Edition 5.2.10 Gold Plus 4.6.1 |
|||||||||
#2
|
|||||||||
|
|||||||||
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
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||||
|
|||||||||
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:
__________________
Business Edition 5.2.10 Gold Plus 4.6.1 |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|