X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Parse smarty tags in extra fields (https://forum.x-cart.com/showthread.php?t=63344)

tqualizerman 04-19-2012 02:28 PM

Parse smarty tags in extra fields
 
Can anyone advise how I might be able to make extra fields parse smarty tags??

totaltec 04-19-2012 02:46 PM

Re: Parse smarty tags in extra fields
 
Ooh, I don't think that is going to be easy. Extra fields are just that, extra fields stored in the DB. I think you may be better off explaining what you want to do, maybe there is an easier way?

Just posting to subscribe, I'm also curious why you want to do this. ;)

BTW: just visited your site for the first time. Are you the inventor of the tqualizer shirts? Pretty freakin cool idea. Amazing to be featured on Ellen.

tqualizerman 04-19-2012 03:07 PM

Re: Parse smarty tags in extra fields
 
I was thinking of storing a list of compatible products in an extra field, so that it would be easily update-able and then automatically applied across all the products.

The shirts - not the inventor, but have been there since the very beginning. :)

totaltec 04-19-2012 03:14 PM

Re: Parse smarty tags in extra fields
 
Well your site is cool. You are doing a great job.

I think the extra field could certainly be used to store the compatible products, maybe a comma-seperated list of product ids. What I still don't understand, is why the need for smarty in the field. (thats the part that I was going to try and re-think for you)

What I would do, is just use the field to store the data you need, and then work with that data in the templates or php. TBH, I rarely use extra fields. If this list needs to be the same on all product pages, a language variable would serve the same purpose right?

tqualizerman 04-20-2012 06:42 AM

Re: Parse smarty tags in extra fields
 
This is actually for the rebuild of our gadget site that is going live soon, so using the language variable in the extra field (which we mostly use for listing product features) would only be applied to some products and not globally across all products.

Basically I need to come up with a way to list what kind of devices Product X, Y and Z are compatible with, knowing that Product X may not be compatible with all the products that Product Y and Z are. The other thing I need to take into consideration is that the list of devices is constantly being updated as new models come out.

What happened before was that we hard coded list of text, but they got outdated because of the pace of technology and it was really cumbersome to maintain it across all the products.

So, I've envisioned this module in my mind that would maintain a list of devices (that was easily updateable) and then each device could be added to the compatibility list for each product.

ADDISON 04-20-2012 07:42 AM

Re: Parse smarty tags in extra fields
 
This is a good question. Let me give you an example using an extra field for technologies, awards, static text, etc. Then this extra field to be used as content for a new tab in product page. If an extra field has the same value (technology) for many products, a language label could solve the problem. Editing this label means to change in all product pages with no efforts.

So, I am interested in this change of using language labels or variables (XC or defined) in extra fields content.

cflsystems 04-20-2012 08:08 AM

Re: Parse smarty tags in extra fields
 
Try this

1. The extra field name is "tech"
2. The language variables names are "technology", "tech", "technical"
3. You enter just that text for appropriate products - tech, technology, technical or leave empty
4. When showing extra fields loop through them and if servoce_name=tech show {$lng.`$field.value`}

Now this is not tested so it may not work
You can also just say
if service_name=tech
if filed.value=tech show THIS
elseif field.value=technology show THAT
etc...

ADDISON 04-20-2012 08:18 AM

Re: Parse smarty tags in extra fields
 
Thanks Steve, this is a good tip.

What about using more than one language variable with an extra field? Let's say we have products with an extra field called Technology formed by joining 1, 2, ... 6 language variables. One way is giving the value of tech1, tech2, tech3 and asociate language variable for every of them. Other ideas?

cflsystems 04-20-2012 08:31 AM

Re: Parse smarty tags in extra fields
 
That would be the way

ADDISON 04-20-2012 08:37 AM

Re: Parse smarty tags in extra fields
 
We should find a better one. Let's say for changing a phrase/word in a tech we have to change all techXX variables which is a hard way, time consuming. Also, we create a lot of variables instead of few.

Quote:

Originally Posted by cflsystems
That would be the way



All times are GMT -8. The time now is 11:21 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.