| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Extra Fields 4.1.x products_t.tpl | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
Re: Extra Fields 4.1.x products_t.tpl
I got this to work in 4.1.9. The only problem is that you are not able to set the order. Its not using the service name nor the order by function. It must just be pulling the info straight from the database in the order it was added. Really need a way to fix this. Anyone have any ideas?
Also, need a way to not show some extra fields. Tried to hardcode, but couldnt get it to work. -DS
__________________
4.4 Code:
|
|||||||||
#12
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
When you set up the extra fields, you can select the position of the extra field.
If you number them the way you want, they should show up in that order.
__________________
Xcart 5.1.6 Building New Store Xcart4.6.4 Gold Plus Xcart 4.6.4 Platinum Smart Template, Mail Chimp Upgrade Checkout One (One Page Checkout) Checkout One X-Payments Connector Checkout One Deluxe Tools Call For Price On Sale Module Buy Together Module MAP Price MOD |
|||||||
#13
|
|||||||||
|
|||||||||
Re: Extra Fields 4.1.x products_t.tpl
Quote:
This is true, for the product pages, but not for this mod. they are showing up in the order they were entered into the database. -ds
__________________
4.4 Code:
|
|||||||||
#14
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Just add "ORDER BY $sql_tbl[extra_fields].orderby")" to the end of the SQL query in products.php to use the sort order -
if (!empty($active_modules["Extra_Fields"]) && !empty($products)) { foreach($products as $k => $v) { $products[$k]["extra_fields"] = func_query("SELECT $sql_tbl[extra_fields].field as field, $sql_tbl[extra_field_values].value as value, $sql_tbl[extra_fields].service_name as service_name, $sql_tbl[extra_fields].active as active FROM $sql_tbl[extra_fields], $sql_tbl[extra_field_values] WHERE $sql_tbl[extra_field_values].fieldid = $sql_tbl[extra_fields].fieldid AND $sql_tbl[extra_field_values].productid = '$v[productid]' ORDER BY $sql_tbl[extra_fields].orderby"); } } I also added "$sql_tbl[extra_fields].active as active FROM $sql_tbl[extra_fields]," so I can still specify to show the field value if it's active right on the .tpl.
__________________
X-Cart Gold 4.1.9 Gift Registry/Special Offers Advanced mini-cart XC-SEO Mulltiple Category/Product Templates Also bought/recently viewed Feedback reviewer/viewer bundle Marketing Manager Pro bundle many more mods |
|||||||
#15
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Can I use this code for product.tpl (4.1.9)?
Many thanks,
__________________
Tanya x-cart version: 4.1.7 4.1.9. 4.2 |
|||||||
#16
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Product.tpl is already set up to show extra fields, the code is meant for other templates that show products but don't show extra fields (by default).
And the code does work for 4.1.9. Tony
__________________
X-Cart Gold 4.1.9 Gift Registry/Special Offers Advanced mini-cart XC-SEO Mulltiple Category/Product Templates Also bought/recently viewed Feedback reviewer/viewer bundle Marketing Manager Pro bundle many more mods |
|||||||
#17
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Thank you very much Tony. I▓ve placed the code to product.php and product.tpl and all I▓ve got is:
1 : 1 Any ideas what I▓ve done wrong? Many thanks,
__________________
Tanya x-cart version: 4.1.7 4.1.9. 4.2 |
|||||||
#18
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Hi,
I need to get this working in the cart i have added : # # Get products Extra field data # if (!empty($active_modules["Extra_Fields"]) && !empty($products)) { foreach($products as $k => $v) { $products[$k]["extra_fields"] = func_query("SELECT $sql_tbl[extra_fields].field as field, $sql_tbl[extra_field_values].value as value, $sql_tbl[extra_fields].service_name as service_name FROM $sql_tbl[extra_fields], $sql_tbl[extra_field_values] WHERE $sql_tbl[extra_field_values].fieldid = $sql_tbl[extra_fields].fieldid AND $sql_tbl[extra_fields].active='Y' AND $sql_tbl[extra_field_values].productid = '$v[productid]'"); } } $smarty->assign("products",$products); to the cart.php and tried it in the include/cart_procsess.php but it does not show up in the view cart, anyone have any ideas? Also added {$products[product].extra_fields[1].field}{$products[product].extra_fields[1].value} to the cart.tpl Many Thanks
__________________
Version 4.1.9 X-Cart Sites:- www.artyfect.com www.naval-military-press.com www.bookguild.co.uk www.humangivens.com |
|||||||
#19
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Am I understanding that X-Cart included the above code to product.tpl for extra fields? Without adding the above mod, I've tried calling out an extra field in my product.tpl as {$product.extra_fields.6.value}, but it doesn't work. Do you have a suggestion?
Quote:
__________________
______________ version 4.1.9 Gold |
|||||||
#20
|
|||||||
|
|||||||
Re: Extra Fields 4.1.x products_t.tpl
Hi Christine,
You need to LOOP through the Extra fields and display the one using an {if} statement - Code:
__________________
X-Cart Gold 4.1.9 Gift Registry/Special Offers Advanced mini-cart XC-SEO Mulltiple Category/Product Templates Also bought/recently viewed Feedback reviewer/viewer bundle Marketing Manager Pro bundle many more mods |
|||||||
|
|||
X-Cart forums © 2001-2020
|