News:

Looking for documentation? Take a look on our wiki

Main Menu

Custom field layout position VM 2.0.1

Started by neutrino86, February 02, 2012, 21:18:43 PM

Previous topic - Next topic

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

PRO

#2
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

PRO

Quote from: bluesheep on February 09, 2012, 10:36:13 AM
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


You should use the "product specification" plugin.

Thats is for display

Hard Drive: LARGE
Color: Red



Merry

Custom Field New or Edit - Layout position text box choices - Stabbing around and a Google search is yielding no results.

What words can go into this box to affect the layout of the Custom Field? It seems a drop-down box with limited choices would help a ton, or a tooltip, but in lieu of that I'd love to add the list of choices to the VM2 documentation.

TIA,
Merry


Answer is probably from my VirtueMart 2 User Manual ebook, includes FREE updates. FREE Admin Menu Cheatsheet, Quick Install Guide & 30-Minute Quick Setup Guide http://showmeguides.com/

PRO

Quote from: Merry on April 24, 2012, 19:44:53 PM
Custom Field New or Edit - Layout position text box choices - Stabbing around and a Google search is yielding no results.

What words can go into this box to affect the layout of the Custom Field? It seems a drop-down box with limited choices would help a ton, or a tooltip, but in lieu of that I'd love to add the list of choices to the VM2 documentation.

TIA,
Merry




THIS NOT for cart attributes, ONLY other custom fields

Here are the ones in the current default template
ontop
normal
onbot


OR, you can do your own location

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

Merry

Thank you, thank you! Solved a great mystery - I had seen a lead about ontop but couldn't find anything else on it.

Merry
Answer is probably from my VirtueMart 2 User Manual ebook, includes FREE updates. FREE Admin Menu Cheatsheet, Quick Install Guide & 30-Minute Quick Setup Guide http://showmeguides.com/

devkbsc

Hello Sir Madame,

Me too, I have the same problem, I am newbee to php. I don't know how to positioning the custom fields. Since one month i am trying to display differnet types of custom fields in the different position in the product page. if you have seen my post, please give a solution.

Description:

1)Some custom fields are already created : type(text editor)

those are displying in the default position.

2) I have created some more custom fields : type(image)

Now i would like to display the image custom fields on the top of the page. is it any possibilities to do that?

kyteasdale

Hi all,

I'm using VM as a catalogue and not displaying prices, so "Cart Attributes" aren't displayed; yet I'd like the custom fields besides the "Ask a question about this product" button.

Is there a preset layout position for this?

Thanks

PRO

Quote from: kyteasdale on July 24, 2012, 15:48:59 PM
Hi all,

I'm using VM as a catalogue and not displaying prices, so "Cart Attributes" aren't displayed; yet I'd like the custom fields besides the "Ask a question about this product" button.

Is there a preset layout position for this?

Thanks

what fields do you want to show?


kyteasdale

Pretty much just the Ask a question field.  Beneath that I'd like the series of custom fields - then the description.

Sorry if that wasn't what you were asking.

PRO

Quote from: kyteasdale on August 06, 2012, 14:29:03 PM
Pretty much just the Ask a question field.  Beneath that I'd like the series of custom fields - then the description.

Sorry if that wasn't what you were asking.

which fields? the atributes?
the only way to do this is to change it to NOT catalogue,

then remove the add to cart code & price code from the template

jason45

While attaching the file along with the product it is not possible to view it on the product page. I believe there is some kind of positioning failure