VirtueMart 2 > Templating & Layouts
Custom field layout position VM 2.0.1
neutrino86:
I a French user of Virtuemart and i try to make a new website with VM2 so, i have i little problem with custom fileds.
Sorry for my approximate english.
I use VM2.0.1b and i would like to add custom fields in product page.
When i attach a filed with a product i don't see it in product page, i think i need to precise a position in "layout position" field but I don't know what i can take in this field.
Thanks in advance for your help
Milbo:
You can even define different position and set where they should be.
PRO:
neutrino86, when you choose "cart variant" the default position will be in the add to cart form.
THEN,
the ONLY other default positions in the product layout is
"ontop"
THIS CODE IS IN views/productdetails/tmpl/default.php
if (!empty($this->product->customfieldsSorted['ontop'])) { ?>
<div class="product-fields">
<?php
$custom_title = null ;
foreach ($this->product->customfieldsSorted['ontop'] as $field){
if ($field->display) {
?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title) { ?>
<span class="product-fields-title" ><?php echo JText::_($field->custom_title); ?></span>
<?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
} ?>
<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
</div>
<?php
$custom_title = $field->custom_title;
}
} ?>
</div>
<?php } // Product Custom ontop end ?>
YOU can actually set your own positions anywhere. By copying this code, and renaming the "position"
YOU JUST change the 'ontop'
<?php if (!empty($this->product->customfieldsSorted['ontop'])) { ?>
<div class="product-fields">
<?php
$custom_title = null ;
foreach ($this->product->customfieldsSorted['ontop'] as $field){
if ($field->display) {
?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title) { ?>
<span class="product-fields-title" ><?php echo JText::_($field->custom_title); ?></span>
<?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
} ?>
<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
</div>
<?php
$custom_title = $field->custom_title;
}
} ?>
</div>
<?php } // Product Custom ontop end ?>
neutrino86:
Thanks for your help, that will be very useful later to customise my product page.
The problem is that the the custom fields don't appear at all when i use "VM - Custom, customer text input" plugin.
With "VM - Custom, product specification" plugin the fields appear properly.
I will try with 2.0.1c version to see if this problem is fixed.
bluesheep:
Hello Forum
I need to know how i can display the customfieldsCart as a <li> and not as a <option>.
I know, that this will break the function of the shop. But, we use the shop only as a catalog and want to show all variants.
I hope, someone can help me.
Beste Grüsse
bluesheep
Navigation
[0] Message Index
[#] Next page
Go to full version