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)
-   -   Add array to Smarty Template Engine ? (https://forum.x-cart.com/showthread.php?t=16676)

missdigital 09-18-2005 05:52 PM

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

missdigital 09-19-2005 08:09 AM

I'm sorry. :( But can someone please help me. I need to have this mod up by tomorrow. :oops:

B00MER 09-19-2005 08:35 AM

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.
:wink:

missdigital 09-19-2005 09:51 AM

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. :?:

B00MER 09-19-2005 10:06 AM

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. :wink:

missdigital 09-19-2005 10:15 AM

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.

B00MER 09-19-2005 10:20 AM

You may be better off posting this questions within the originating posted custom mods thread :arrow: 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. :wink:

hope this helps.


All times are GMT -8. The time now is 07:33 AM.

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