News:

Support the VirtueMart project and become a member

Main Menu

VM3 VM Custom - Customer text input, not add cart

Started by FAUSTddd, March 21, 2016, 11:12:36 AM

Previous topic - Next topic

FAUSTddd

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?

jenkinhill

The custom must be in the add to cart form, but you could maybe reposition it using css.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

FAUSTddd

#2
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

Studio 42

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

FAUSTddd