News:

Looking for documentation? Take a look on our wiki

Main Menu

per custom field another layout position

Started by baroen, June 13, 2014, 15:45:27 PM

Previous topic - Next topic

baroen

Is it possible to show custom fields on specific layout positions?
I want to show one custom field directly under the product name, and another custom field just above the add-to-cart button.

GJC Web Design

I just loop thru and if there is a match display it where I want

e.g.


foreach ($product->customfields as $field) {
if(($field->virtuemart_custom_id == '33')){

echo $field->custom_value;

}
}



or if lots assign them to a var  with a switch statement


foreach ($product->customfields as $field) {

switch ($field->virtuemart_custom_id) {
  case "33":
    $custom1 =  $field->custom_value;
    break;
  case "36":
    $custom2 =  $field->custom_value;
    break;
   
}
}

echo $custom1;

echo $custom2;




code not checked but u get the idea
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

balai

i think that by default there are som positions like ontop, onbottom which you can use in the position field of custom field.
You can also add your own in the product details layout