News:

Support the VirtueMart project and become a member

Main Menu

Virtuemart2 Custom Fields - Layout Options and Positions

Started by romello, December 14, 2012, 15:07:16 PM

Previous topic - Next topic

romello


Hello Virtuemart Forum,


I have a small issue with the Virtuemart layout on my Joomla template.

1. The VM standard layout options seems to be ontop, onbot and normal.

2. However, it seems that VM2 renders the layout this way:

A. Custom fields with "Cart Attribute"s are automatically rendered to the right side of the product image...  which seems to be another position.
B. To achieve my workflow...   I need to  place  a couple of custom field that are not "cart variants"  on this: right side of product image position. (whatever it is)

3. Question

A. What is/ where is the position code for the custom fields located the right side of the product image? For example, the position where the "add to cart" button is located? What position is this ?

B. What "position" would I add to the  code below to render a new custom field (non-cart variant)  on the right side of the product image?

- In the code block below... what do I replace "my-position" with to place custom fields on the right side of the vm2 product image?

<?php if (!empty($this->product->customfieldsSorted['my-position'])) {
$this->position='my-position';
echo $this->loadTemplate('customfields');
}
?>


Thanks in advance for any assistance,

Romello

VM 2012f
J2.5

bytelord

#1
Hello,

Just create your own position and place the code you post where you desire, use some CSS/HTML to style it.
For example add the position beside-image and change the code

<?php if (!empty($this->product->customfieldsSorted['beside-image'])) {
$this->position='beside-image';
echo $this->loadTemplate('customfields');
}
?>

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

PRO

cart variants are added to the "add to cart form"

so, there is not a "position", they are automatic

BUT!!!!

You can actually add the code for your position in the default_addtocart.php or default_images.php


<?php foreach ($this->product->customfieldsSorted[$this->position] as $field) {
         if ($field->layout_pos == my-new-position) {
         echo $field->display;
         }
       }
       ?>




CenturionSigns

This is exactly what I need to do as well.

Could someone let me know:

1. where to "create a position"
2. what code I should create, and which files to paste it in

Thanks so much!