VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: fotonio on July 13, 2015, 15:29:17 PM

Title: Creating new custom field position at VM3
Post by: fotonio on July 13, 2015, 15:29:17 PM
Hi, i would like to create a new position for a custom field to appear below the addtocart position and above add to cart button.

How can i do it? I have not much experience with php.

I am using VM 3.0.9.4 with the default template and joomla 3.4.1.

Thank you,
Yiannis
Title: Re: Creating new custom field position at VM3
Post by: jenkinhill on July 13, 2015, 16:58:22 PM
Quote from: fotonio on July 13, 2015, 15:29:17 PM
Hi, i would like to create a new position for a custom field to appear below the addtocart position and above add to cart button.

That makes no sense. In the default template the add to cart button is within the addtocart-bar - which is of course, the "add to cart position".  Maybe provide a picture to show what you want to do.
Title: Re: Creating new custom field position at VM3
Post by: fotonio on July 13, 2015, 22:51:35 PM
Now i have a parent product with a multivariant custom field and another custom field below. They are both positioned in addtocart position. I like the layout but i want to create a separate position for the second because something doesn't work well with the javascript when it is in the same position with another field.

Thanks

PS. I can send a link of the site if it helps.
Title: Re: Creating new custom field position at VM3
Post by: GJC Web Design on July 13, 2015, 23:48:51 PM
isn't it just
<?php
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'mynewpos'));
?>

and put this snippet in components\com_virtuemart\views\productdetails\tmpl\default.php where ever u want it to appear?
Title: Re: Creating new custom field position at VM3
Post by: fotonio on July 14, 2015, 00:42:56 AM
That was helpful!

thank you