HI
Sorry for my English, but I do not know English well :(
How can I add a new variable to the cart?
When the administration panel will mark VM options: Configuration> Checkout> "Display modal popup upon the 'Add to cart' 'all guns, my new variable is added to the cookie when I check this option is not added variable does not communicate its contents to cookies. When you add a product to the basket, a new window jquery and I think it is a problem.
My variable is added to the file: components/com_virtemart/views/category/tmpl/default.php:
<input type="hidden" name="my-variable" value="" />
I save it in a file: components/com_virtuemart/helpers/cart.php in function (public function add($virtuemart_product_ids=null,&$errorMsg='')):
$product -> new_variable_in_cart = $_POST["my-variable"];
I have a VM version 2.0.26d and 2.5.18 joomla and php 5.3.29
I would be grateful for your help
Marcin
http://forum.virtuemart.net/index.php?topic=79799.0
I added my Joomla, virtuemart and php version
First I suggest you update your versions. http://forum.virtuemart.net/index.php?topic=118683.0
Current latest VM2 version is 2.6.17 http://dev.virtuemart.net/projects/virtuemart/files
I can not change to a higher version of the VM, it is too expensive :(
I have what I have to cope with this version.
Does not anyone know how to add a new variable to the basket (cookies)?
I would add that the variable in the cookie is created, but I do not know how to pass the value from the form it :(
We dont use cookies for that. Check the customplugin textinput to learn how that is done. Your approach is impossible in vm2. (actually open as a barn)
thank you very much, I worked it out otherwise, I made a new cookie in JS and everything works beautifully
Please can you paste your solution. It will be helpful for us begineers
It is quite likely "unsecure" solution. Just learn to use the userfields in vm3. More secure and less problems