| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Not diplaying extra fields in certain instances | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() I am using 2 extra fields for my products, but not every product is going to use the extra fields.
I would like to style the table that the extrafields are displayed in, but the problem is, I don't want the table to be displayed if the product isn't using the extrafields. For example, if Product X is using at least 1 of the extra fields, then the styled table along with the extra field information is displayed on the product page. If Product Y is not using any of the extra fields then the styled table is not displayed. Does anyone have any ideas on how this can be accomplished, or if it can be accomplished?
__________________
x-cart-4.0.18gold |
|||||||
#2
|
|||||||
|
|||||||
![]() Look at the code that displays the extra fields. It will use some sort of loop that runs through the variables and displays the title and value of each extra field stored for the products.
All you need to do is run an if statement to see if there is a value in the extra field first before displaying it. no value no display
__________________
Jason Diehl Finding Cures for Your Online Headaches: http://www.internetmedicineman.com/ |
|||||||
#3
|
|||||||
|
|||||||
![]() I had tried that, but the table is going to have a header, and footer with the two extra fields in between. If there aren't values for the extra fields, the table rows and cells won't display, but the header and footer will still display. I want to keep from having the whole table from being displayed if there are no values set for the extra fields.
__________________
x-cart-4.0.18gold |
|||||||
#4
|
|||||||
|
|||||||
![]() Alan- not sure if you got this figured out, but here's my solution to the same issue:
Code:
I wanted the extra fields to be in their own table in the main product.tpl page, but didn't want that table to show up if no extra fields were present. This 'product.tpl' page is in the modules/extra_fields folder!
__________________
X-Cart Version: 4.15 (in development) |
|||||||
|
|||
X-Cart forums © 2001-2020
|