| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
#1
|
|||||||
|
|||||||
Smarty help
Ok, this one is perplexing me - one of you Smarty gurus should be able to help. Using Firetank's featured product manager for some category-specific featured product groups. I want to call the template automatically based on the category name, so I use this in subcategories.tpl:
{include file="customer/fts_featured_products.tpl" group="`$current_category.category`"} Works great - except for categories with multiple words in them. The Firetank mod doesn't accept spaces for the group, just _ characters. So I need to replace any spaces in the Smarty variable with _. I've tried using |replace, but with Smarty inside Smarty it is getting a bit crazy and spitting out SQL errors. Any help? Thanks!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#2
|
|||||||
|
|||||||
Re: Smarty help
How about using the category ID instead?
__________________
xcartmods.co.uk |
|||||||
#3
|
|||||||
|
|||||||
Re: Smarty help
Because the client will have no clue what that is when they are adding 1000 of those to the featured product manager, and I'd hate to have to make them go back and forth each time to look it up Trust me, that was my first thought as well
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Smarty help
Try this:
{include file="customer/fts_featured_products.tpl" group="`$current_category.category`"|replace:' ':'_'} or else assign the value to the variable and then use it in the include like this: {assign var="catname" value="`$current_category.category`"|replace:' ':'_'} {include file="customer/fts_featured_products.tpl" group="`$catname`"}
__________________
MercuryMinds Technologies Development Team, Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com X-Cart Mailchimp Ecommerce 360 Plugin/integration module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) Smasher, a smart search engine for x-cart store (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) One Page Checkout (OPC) - X-Cart module (Compatible with X-Cart 4.1.x, 4.2.x, 4.3.x) |
|||||||||
#5
|
|||||||
|
|||||||
Re: Smarty help
Thanks Vetrivel, it was the closing quote after the current_category variable that I was missing - works great!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|