Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Parse smarty tags in extra fields

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-19-2012, 02:28 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Parse smarty tags in extra fields

Can anyone advise how I might be able to make extra fields parse smarty tags??
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #2  
Old 04-19-2012, 02:46 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 04-19-2012, 03:07 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default 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.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #4  
Old 04-19-2012, 03:14 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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?
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #5  
Old 04-20-2012, 06:42 AM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default 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.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #6  
Old 04-20-2012, 07:42 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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.
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #7  
Old 04-20-2012, 08:08 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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...
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #8  
Old 04-20-2012, 08:18 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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?
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #9  
Old 04-20-2012, 08:31 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Parse smarty tags in extra fields

That would be the way
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
am2003 (04-20-2012)
  #10  
Old 04-20-2012, 08:37 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default 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
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020