Hello everyone, im having a problem with a 'Smarty' variable.
I should say that in the shop im currently working, we sells books, audio-cd's, etc. And there is an option for the audios to get downloaded for a minor price or less points (we use a bonuspoints system).
So in the templates/modules/product_options, i've seen that on
products_options_selections_html, there is an input, that shows all the selections, and each item is sorted by values, e.G
{foreach key=key_data name
=key_data item
=item_data from
=$options_data.DATA
} <input type
="radio" name
="id[{$options_data.ID}]" value
="{$item_data.ID}" {if $smarty.foreach.key_data
.first
} checked
{/if} /> {$item_data.TEXT
} {if $item_data.PRICE
!=''}( {$item_data.PREFIX
}{$item_data.PRICE
} ){/if} <br
/> {/foreach} What i desperate want, is to know how is
value="{$item_data.ID}" handled. Im sure that this variable comes from products_attributes.php on 'includes/modules', the ID i mean.
My purpose on knowing this is to relate the value with a specific cart submit.
e.G
Instead of clicking the second 'item' of the input to add it to the shoppingcart, i just want to click on a button i already made in products_info.php which will directly "pick" that option for me and add it to the shopping cart.
Im pretty sure that "all i need to do" is to somehow set the
"{$item_data.ID}" variable on the .php file (or even .html part if possible through Smarty) where the button i
already implemented is
How is this possible? or maybe i should do it on
cart_actions.php? (here i put a new "submit_to_cart" script for buying with bonuspoints
Can it be possible to set the variable from another file which is not product_attributes.php to make it happen, like in product_info.php?
I'll attach a pic.
Note: I wouldn't be asking here if i haven't been spending so much time looking for it. Thanks in advance
Linkback: https://www.modified-shop.org/forum/index.php?topic=33029.0