News:

Support the VirtueMart project and become a member

Main Menu

How do I move a custom filed on product page?

Started by mesquiteman, September 19, 2012, 07:47:22 AM

Previous topic - Next topic

mesquiteman

Hello folks,

I am working on my first site with VM2 and trying to figure out some things.  I have a very limited knowledge of HTML and coding but do pretty good with just messing around with things.  I have a custom field set up for some child products but don't like where they show up on the page in the "ontop" position.  I have played around with Firebug and can get the field to show up where I want it there but have no idea what file to edit to put the code where I want it.  I know I need to do a template override and have read up on doing that, just don't know the file to edit once I copy it to my override folder.  Can anyone provide some good insight on what I need to do?  Attached is an image of what I am trying to accomplish as I did it in Firebug.  Any help would be greatly appreciated!


[attachment cleanup by admin]

PRO

I do not use child products, but do you have a url to look at?



mesquiteman

BTW, thanks Pro, for any insight you can provide!

PRO

http://forum.virtuemart.net/index.php?topic=90935.0



It appears to be set to the "ontop" position

YOU could

views/productdetails/tmpl/default.php
MOVE this

if (!empty($this->product->customfieldsSorted['ontop'])) {
   $this->position = 'ontop';
   echo $this->loadTemplate('customfields');
    } // Product Custom ontop end

The "add to cart" has its own template

views/productdetails/tmpl/default_addtocart.php
So, you could place that code in the add to cart file.


OR, create your own "position"
http://forum.virtuemart.net/index.php?topic=97419.0


Just copy the code, and rename the position

like

if (!empty($this->product->customfieldsSorted['new-position'])) {
   $this->position = 'new-position';
   echo $this->loadTemplate('customfields');
    } // Product Custom new-position end