VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: FAUSTddd on March 21, 2016, 11:12:36 AM

Title: VM3 VM Custom - Customer text input, not add cart
Post by: FAUSTddd on March 21, 2016, 11:12:36 AM
Hello.
VM 3.0.12.  I create customfield plugin VM Custom - Customer text and insert position as "ontop". The field is displayed, but not added to the cart. The field is added to the cart only if the position entered as "addtocart". How to put the plugin in any position?
Title: Re: VM3 VM Custom - Customer text input, not add cart
Post by: jenkinhill on March 21, 2016, 11:30:55 AM
The custom must be in the add to cart form, but you could maybe reposition it using css.
Title: Re: VM3 VM Custom - Customer text input, not add cart
Post by: FAUSTddd on March 22, 2016, 05:39:15 AM
but all good positions addtocart. no, css not hidden
example vm 3.0.14
http://kvs-ekb.ru/index.php/vm3/test
This problem occurs only in the plug-ins
Title: Re: VM3 VM Custom - Customer text input, not add cart
Post by: Studio 42 on March 22, 2016, 12:06:52 PM
Hi,
Its simple :
When you use "addtocart", the field is inside the product HTML form else it's outside, so it's not added when you submit the form.
If you need to add any field then you have to modify the producdetails and change the form tag position in file :
JOOMLAROOT\components\com_virtuemart\views\productdetails\tmpl\default_addtocart.php
so this line
<form method="post" class="product js-recalculate" action="<?php echo JRoute::('index.php',false); ?>">

and  move it in main file JOOMLAROOT\components\com_virtuemart\views\productdetails\tmpl\default.php  after
<div class="productdetails-view productdetails"> for eg.
And do same for closing form tag
Title: Re: VM3 VM Custom - Customer text input, not add cart
Post by: FAUSTddd on March 23, 2016, 06:23:10 AM
Studio 42 thank u. this works