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

PRO

Quote from: jason45 on September 07, 2012, 09:52:58 AM
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


what?

zorro lee

How to add custom fields in category view?

1cube1wheel

@PRO,

Based on the code in /views/productdetails/tmpl/defualt, it seems like setting the layout position to 'ontop' places the custom fields under the 'Short Description' section, while setting the position to 'normal' places them under the 'Product Description' section.  I have adjusted the layout position using both 'ontop' and 'normal', but the position of my fields is not changing at all.  I also tried inserting the code you posted like this:

   <?php
   // Product Description
   if (!empty($this->product->product_desc)) {
       ?>
        <div class="product-description">
   <?php /** @todo Test if content plugins modify the product description */ ?>
       <span class="title"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE') ?></span>
   <?php echo $this->product->product_desc; ?>
        </div>
   <?php
    } // Product Description END

    if (!empty($this->product->customfieldsSorted['normal'])) {
   $this->position = 'normal';
   echo $this->loadTemplate('customfields');
    } // Product custom_fields END
    // Product Packaging
    $product_packaging = '';
    if ($this->product->product_box) {
   ?>
        <div class="product-box">
       <?php
           echo JText::_('COM_VIRTUEMART_PRODUCT_UNITS_IN_BOX') .$this->product->product_box;
       ?>
        </div>
       <?php if (!empty($this->product->customfieldsSorted['my-position'])) {
       $this->position='my-position';
       echo $this->loadTemplate('customfields');
       }
       ?>
    <?php } // Product Packaging END
    ?>

However, I do not know if this is correct placement as I am unfamiliar with PHP.  Any assistance you can provide is appreciated.  I am running version 2.0.12.

Flasher

Quote from: PRO on April 24, 2012, 21:19:02 PM
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');
    }
    ?>


Hi All. I try to use this code after the price is displayed but nothing happens... i don't get the custom fields displayed. :(

Milbo

The custom needs of course also your position.
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

Quote from: Flasher on February 01, 2013, 02:30:24 AM


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


Hi All. I try to use this code after the price is displayed but nothing happens... i don't get the custom fields displayed. :(

my-position

needs to be changed to YOUR position

pnaugh

Sorry for such an easy question, however I just am not quite getting how to do this. What I see with my custom fields are that they are too close together one on top of the other. I may have missed this but is there a way to space then apart in the vertical directions a few px? I have 3-6 custom fields for each product and it looks cluttered.

Thanks in advance for any responsed

Peter

PRO

Quote from: pnaugh on June 14, 2013, 02:01:25 AM
Sorry for such an easy question, however I just am not quite getting how to do this. What I see with my custom fields are that they are too close together one on top of the other. I may have missed this but is there a way to space then apart in the vertical directions a few px? I have 3-6 custom fields for each product and it looks cluttered.

Thanks in advance for any responsed

Peter

which fields?
http://forum.virtuemart.net/index.php?topic=102850.0



pnaugh

#23
Pro Thank You


Christopher

Hello

I'm trying to alter the CSS in vmsite-ltr.css around line 202 - 209, to format the custom fields into columns by setting the widths of:

product-fields-title
product-field-display
product-field-desc

... But none of my changes appear to make any difference.... Have I missed something? I have multiple custom fields displayed for each product, each with a title, listbox and description - all I want to do is set the width of each of these to either 33% or 220px so they appear one beneath the other in neat columns - Please see the screenshot attached

Please can someone point me in the right direction?

Thanks in advance

[attachment cleanup by admin]
There are 10 types of people in the world:
Those who understand binary and those who don't

PRO

Quote from: Christopher on June 21, 2013, 11:21:42 AM
Hello

I'm trying to alter the CSS in vmsite-ltr.css around line 202 - 209, to format the custom fields into columns by setting the widths of:

product-fields-title
product-field-display
product-field-desc

... But none of my changes appear to make any difference.... Have I missed something? I have multiple custom fields displayed for each product, each with a title, listbox and description - all I want to do is set the width of each of these to either 33% or 220px so they appear one beneath the other in neat columns - Please see the screenshot attached

Please can someone point me in the right direction?

Thanks in advance

you are in the wrong thread for cart variant custom fields.

BUT!

why not edit the

default_addtocart.php

???


and just add your own class?

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

t68

Quote from: PRO on April 24, 2012, 21:19:02 PM

OR, you can do your own location

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

This worked like a charm for me! I added two new positions in my default_addtocart.php override so now I can ad more custom fields to the right of the image before and after the default positions for custom fields. I named these "custom1" and "custom2" and put the coding above right after (for custom1) the start div: <div class="product-fields"> and right before its closing (for custom2) </div>. Great for adding more info about how my price-per-letter input works and so on.

kennethrules

PRO thanks for big help.. I have project right now and I need this ^_^..

BrickLee47

#28
   <?php
   // Product Description
   if (!empty($this->product->product_desc)) {
       ?>
        <div class="product-description">
   <?php /** @todo Test if content plugins modify the product description */ ?>
       <span class="title"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE') ?></span>
   <?php echo $this->product->product_desc; ?>
        </div>
   <?php
    } // Product Description END

    if (!empty($this->product->customfieldsSorted['normal'])) {
   $this->position = 'normal';
   echo $this->loadTemplate('customfields');
    } // Product custom_fields END
    // Product Packaging
    $product_packaging = '';
    if ($this->product->product_box) {
   ?>
        <div class="product-box">
       <?php
           echo JText::_('COM_VIRTUEMART_PRODUCT_UNITS_IN_BOX') .$this->product->product_box;
       ?>
        </div>
       <?php if (!empty($this->product->customfieldsSorted['my-position'])) {
       $this->position='my-position';
       echo $this->loadTemplate('customfields');
       }
       ?>
    <?php } // Product Packaging END
    ?>

Using this code snippet in PHP was a bad experience for me

kelecz

Need assist. My problem is on the pisture. I can not add fields,no problem with "creating" custom field, Cart Variant.
Is that Jquery problem? I already have some mess with popups but now is fine.


THX in advance.

Joomla 2.5.28
VM 2.6.14
Live www.petproba.konji.rs

[attachment cleanup by admin]