![]() |
Add extra field to Featured Products
Hi, any ideas on how to add a specific extra field to customer/main/featured.tpl? (I want to add 'Author' next to the product title) The code in customer/main/products.tpl just pulls all extra fields in and is not specific so I cant copy that.
Assistance would be appreciated. Thanks |
Re: Add extra field to Featured Products
What will be displayed in the field "Author"?
There are several options for how to do this, through the implementation of "Extra Fields" - not very convenient. Because by default "Featured products" no show "Extra fileds". Need to change "php" code X-Cart. |
Re: Add extra field to Featured Products
Have you thought about using the Manufacturers module for Authors?
|
Re: Add extra field to Featured Products
Manufacturers..... interesting. I shall look into it. It seems extra fields are very limited in their flexibility
|
Re: Add extra field to Featured Products
Quote:
Yes, it is the code I am after. Too complex to work out for myself as I do not know PHP! |
Re: Add extra field to Featured Products
I was not much wrong, the task easier, here is a solution to your problem.
1. Create "Extra fileds" for the author, called "author" (name of the field should not be changed, Default value - Empty). 2. Create a new file "skin1/modules/Extra_Fields/product2.tpl" with the following content: PHP Code:
3.Edit the file "skin1/customer/main/products.tpl" after lines (for xcart 4.1.9 gold): PHP Code:
insert next lines: PHP Code:
4. Happy end :) When the module is active "extra fileds, and the product in the" featured product", and for "extra fileds" defined value "author " - will be displayed. It also displays the value of field "author" when viewing content category. If the feature is not required, need to make some changes. |
Re: Add extra field to Featured Products
Thats great! Works prefectly.
If other wants to use this code, note the extra field name in the product2.tpl code is case sensitive. |
Re: Add extra field to Featured Products
You can easily modify the code and use to groups of parameters, or that extra fields would appear only in a specific place.
f you do not know how, ask me, try to help! |
Re: Add extra field to Featured Products
If you want the author's name to appear beneath the title for a featured product you can edit customer/main/products_t.tpl and add this code right below the product title
Code:
{if $products[product].extra_fields ne ''} |
Re: Add extra field to Featured Products
Quote:
"Products_s.tpl" will work only if the following conditions are met: - it is the customer; - specified rate (Display products list in multiple columns (1-3)); - Module "Featured Products" is active or not active option "Display only featured products list in multicolumn format. " If any one condition is not fulfilled, "producst_t.tpl" will not be called. Consider this. |
All times are GMT -8. The time now is 10:32 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.