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

Add array to Smarty Template Engine ?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-18-2005, 05:52 PM
 
missdigital missdigital is offline
 

Member
  
Join Date: Aug 2005
Posts: 18
 

Default Add array to Smarty Template Engine ?

I am doing a Free Gift mod that was posted on this forum. I'm stuck at this part:

Quote:

Lastly, send the two arrays to the smarty templating engine:
Code:

$smarty->assign("activeFreeGifts", $activeFreeGifts);
$smarty->assign("offerFreeGifts", $offerFreeGifts);

How in the world do I add an array to the engine?? TIA
__________________
X-Cart version 4.0.18
Reply With Quote
  #2  
Old 09-19-2005, 08:09 AM
 
missdigital missdigital is offline
 

Member
  
Join Date: Aug 2005
Posts: 18
 

Default

I'm sorry. But can someone please help me. I need to have this mod up by tomorrow.
__________________
X-Cart version 4.0.18
Reply With Quote
  #3  
Old 09-19-2005, 08:35 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Code:
$smarty->assign("activeFreeGifts", $activeFreeGifts); $smarty->assign("offerFreeGifts", $offerFreeGifts);

If $activeFreeGifts and $offerFreeGifts is in fact an array, just use a {section} loop over the array and irretate over it, just look at any of the code in products.tpl and you'll see what im refering to.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #4  
Old 09-19-2005, 09:51 AM
 
missdigital missdigital is offline
 

Member
  
Join Date: Aug 2005
Posts: 18
 

Default

Thank you Boomer!! I'm sorry for being so clueless though...but where the heck will I stick these arrays at?? It just says to send it to the smarty template engine.
__________________
X-Cart version 4.0.18
Reply With Quote
  #5  
Old 09-19-2005, 10:06 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Quote:
Originally Posted by missdigital
Thank you Boomer!! I'm sorry for being so clueless though...but where the heck will I stick these arrays at?? It just says to send it to the smarty template engine.

The lines of code you mentioned assigns the arrays to the templates.

Therefor you can use a {section} loop over the arrays now.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #6  
Old 09-19-2005, 10:15 AM
 
missdigital missdigital is offline
 

Member
  
Join Date: Aug 2005
Posts: 18
 

Default

Please don't shoot me...I really know nothing about this stuff.
Here is the mod I'm doing:
http://forum.x-cart.com/viewtopic.php?t=18380&highlight=free+gift+mod

Anyway, do I just put:

Quote:
{section}

$smarty->assign("activeFreeGifts", $activeFreeGifts);
$smarty->assign("offerFreeGifts", $offerFreeGifts);
?????????????

Also, what file do I put these arrays in? I'm so sorry for the dumb questions.
__________________
X-Cart version 4.0.18
Reply With Quote
  #7  
Old 09-19-2005, 10:20 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

You may be better off posting this questions within the originating posted custom mods thread http://forum.x-cart.com/viewtopic.php?t=18380

As it seems you just need to follow the steps closely, if its not working post on the thread as the developer of the mod may be able to shed more light than me or any other.

hope this helps.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:21 PM.

   

 
X-Cart forums © 2001-2020