VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: oualid103 on December 21, 2016, 17:29:28 PM

Title: custom fields new position can't show in cart
Post by: oualid103 on December 21, 2016, 17:29:28 PM
hi every body:
i use VM3 and joomla 3.6.
i add two custom fields in new position "my_position" i add this position in product detail view perfectly but when i go to "show cart" i don't find this two fields.
how can i display this fields in cart vieww please.
Title: Re: custom fields new position can't show in cart
Post by: jenkinhill on December 21, 2016, 17:36:17 PM
http://forum.virtuemart.net/index.php?topic=128401

The custom field position must be wthin the add to cart <form> tags within product details to appear in the cart. This is usually the addtocart custom position. You can add your own positions within the form and fix their layout position using css.
Title: Re: custom fields new position can't show in cart
Post by: oualid103 on December 22, 2016, 08:58:37 AM
thank you very mush jenkinhill for your replay. i insert my new position exactly adjacent addtocart but i still have the same problem.
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'class'=>'my_positionclass',,'position'=>'my_position'));
how to add my_pistion to the addtocart form.
best wishes.
Title: Re: custom fields new position can't show in cart
Post by: GJC Web Design on December 22, 2016, 12:28:00 PM
look in the page source

is your new position rendering INSIDE the cart form tags?

if not u need to move further into the sublayouts of the add to cart
Title: Re: custom fields new position can't show in cart
Post by: oualid103 on December 22, 2016, 14:11:59 PM
hi thank for all; i resolve the problem by moving form D:\Program Files\EasyPHP-12.1\www\easyweb0\components\com_virtuemart\sublayouts\addtocart.php tag to \components\com_virtuemart\views\productdetails\tmpl\default.php :
<form method="post" class="product js-recalculate" action="<?php echo JRoute::_ ('index.php?option=com_virtuemart',false); ?>">    
....