php - Extra data in cs-cart cart content -


for each of added products in cart content want display data, comes out of other database. getting data database not problem. having problems passing custom variable cart_content.tpl (view file). inside fn_add_product_to_cart (in fn.cart.php file):

foreach ($product_data $key => $data) {     $data['test'] = 'testing';     ........ } 

but key test found inside view (even if var_dump product variable). doing wrong?

thank in advice.

edit: little bit: have view file cart_content.tpl. there foreach loop write down of products in users cart.

{foreach from=$_cart_products key="key" item="p" name="cart_products"} {/foreach} 

what want output simple test string (like that: {$p.test}) don't know, how add custom value array. start enough add test string can use in view.

hope helps. should simple, add new value associative array , that's not work way here guess.

well, did it! in same function, add $cart['products'][$_id]['test'] = 'test'; , works!


Comments