arturobelver Posted May 2, 2014 Share Posted May 2, 2014 Hi! I want work with a variable from input and i don't know how. Is it possible? Link to comment Share on other sites More sharing options...
vekia Posted May 2, 2014 Share Posted May 2, 2014 where you've got this input field? back office? front office? where you want to assign it? to variable in php file? perhaps in .tpl ? Link to comment Share on other sites More sharing options...
arturobelver Posted May 2, 2014 Author Share Posted May 2, 2014 In product-list.tpl, Im using '$product.minimal_quantity' like mutiple to product and i use two inputs for this. One of this inputs is the value insert by the client for multiplicate to product's multiple and the other input is this, hidden because i want add the new variable in attribute value="{$new_var * $product.minimal_quantity} Link to comment Share on other sites More sharing options...
arturobelver Posted May 2, 2014 Author Share Posted May 2, 2014 My button-container of product-list.tpl <div class="button-container"> {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.customizable != 2 && !$PS_CATALOG_MODE} {if isset($static_token)} <a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}"> <span>{l s='Add to cart'}</span> </a> {else} <a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart',false, NULL, 'add=1&id_product={$product.id_product|intval}', false)|escape:'html':'UTF-8'}" rel="nofollow" title="{l s='Add to cart'}" data-id-product="{$product.id_product|intval}"> <span>{l s='Add to cart'}</span> </a> {/if} {if ($product.allow_oosp || $product.quantity > 0)} <input style="position:absolute; margin-top:3px; left:180px; padding: 0 3px; text-align:center; height: 40px; border: 1px solid #ccc; display:inline-block; float:left; width:25px;" type="" name="cantidad" id="cantidad" value="1"/> <span style="color:#719F41; font-size:20px; position:absolute; margin-top:3px; left:210px; padding: 0 3px; height:40px; line-height:40px "> x{$product.minimal_quantity} </span> <input style="position:absolute; margin-top:3px; left:210px; padding: 0 3px; text-align:center; height: 40px; border: 1px solid #ccc; display:none; float:left; width:25px;" type="text" name="qty" id="quantity_to_cart_{$product.id_product|intval}" value="{$product.minimal_quantity}"/> {/if} {else} <span class="button ajax_add_to_cart_button btn btn-default disabled"> <span>{l s='Add to cart'}</span> </span> {/if} </div> Link to comment Share on other sites More sharing options...
arturobelver Posted May 2, 2014 Author Share Posted May 2, 2014 up Link to comment Share on other sites More sharing options...
arturobelver Posted May 5, 2014 Author Share Posted May 5, 2014 where you've got this input field? back office? front office? where you want to assign it? to variable in php file? perhaps in .tpl ? The input field is in front office and i want assign in .tpl Link to comment Share on other sites More sharing options...
vekia Posted May 5, 2014 Share Posted May 5, 2014 i don't understand what you expect. you ased about input, so you've got it in product-list.tpl file. now what? you want to send it with add to cart? or... or what? Link to comment Share on other sites More sharing options...
arturobelver Posted May 5, 2014 Author Share Posted May 5, 2014 i don't understand what you expect. you ased about input, so you've got it in product-list.tpl file. now what? you want to send it with add to cart? or... or what? Im sorry vekia and thanks for your patience. I want that when the client push 'add to cart', the input value is multiplied with the minimal_quantity and the total is added to the cart Link to comment Share on other sites More sharing options...
arturobelver Posted May 5, 2014 Author Share Posted May 5, 2014 I'm trying to do something but can not get it to work <input id="quantity" type="" value="1" onmouseout="<script type="text/javascript">var quantity_user = $("#quantity").val();</script>" /> Could you please give some suggestion? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now