Author Topic: Custom Field Types (Explained)  (Read 107321 times)

cspub

  • Jr. Member
  • **
  • Posts: 59
Re: Custom Field Types (Explained)
« Reply #15 on: June 11, 2012, 23:38:47 pm »
I'm having a hard time trying to do something basic and not sure if the custom fields and cart variant is the way to go. Please advise.
We have products, say shirts. Most of the shirts can add monogramming. THere are 3 types of monogram and each has a different cost. We want to add drop down that says Monogram. From there they select the monogram type they want and it add the cost to the product.

Then they need to pick monogram font and color and enter text for monogram. Do i do this with custom fields? If so how do i group so that it is a drop down?

cspub

  • Jr. Member
  • **
  • Posts: 59
Re: Custom Field Types (Explained)
« Reply #16 on: June 13, 2012, 07:17:15 am »
i have cart variant and add price to product. when you go to cart then it shows the added price as a discount and subtract.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10270
  • VirtueMart Version: 3+
Re: Custom Field Types (Explained)
« Reply #17 on: June 13, 2012, 14:21:27 pm »
i have cart variant and add price to product. when you go to cart then it shows the added price as a discount and subtract.


wrong thread, this thread is NOT about cart variants
http://forum.virtuemart.net/index.php?topic=90833.0
I do NOT do development work for hire.

Mole_LR

  • Beginner
  • *
  • Posts: 34
Re: Custom Field Types (Explained)
« Reply #18 on: July 25, 2012, 00:35:38 am »
Hello!

What I have to do if I want to display product CustomFields into pdf? I'm trying to modify standard Joomla pdf plugin to print normally all information about the product - name, description, prices, images and CustomFields! All, except CustomFields, prints to pdf normally, but I can't make that CustomFields shows into pdf..

Thank You!

Parsimonious

  • Beginner
  • *
  • Posts: 47
Re: Custom Field Types (Explained)
« Reply #19 on: July 28, 2012, 23:38:21 pm »


Using a String to Link to related articles, installation instructions etc.


Create a Custom field  type "string" with the name "Installation Instructions" or whatever you want the anchor text to be.
Assign it to the position "link"
In Edit Product apply the field. Paste the url
This below is the code for displaying the link.

<div class="product-fields">
       <?php
       $custom_title = null;
       foreach ($this->product->customfieldsSorted[link] as $field) {
      if ($field->display) {
          ?>
          <?php if ($field->custom_title != $custom_title) { ?>
             <a href="<?php echo $field->display ?>" ><?php echo JText::_($field->custom_title); ?></a>
<?php } ?>
          <?php } ?> <?php } ?>
        </div>

I'm not understanding what I need to do. I created a custom custom field type: string, gave it a title, added it to a product, pasted the url in the empty box under value (i verified my url is valid). Now I don't know what to do to make it show in the front end. Do I have to put the code somewhere? If so where?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10270
  • VirtueMart Version: 3+
I do NOT do development work for hire.

RevoLion

  • Jr. Member
  • **
  • Posts: 67
  • Joomla Covert Operations
Re: Custom Field Types (Explained)
« Reply #21 on: August 06, 2012, 23:38:38 pm »
Hi BanquetTables.pro,

Is there any documentation any where on how to add a date picker as a cart attribute in VM 2.0. I saw that "date" is a selection as a custom field and I need it to be a custom field. I tried adding it, but all it did was display todays date instead of allowing a customer to pick the date they want their greeting card delivered by.

Thanks for any help,
Jeremy

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10270
  • VirtueMart Version: 3+
Re: Custom Field Types (Explained)
« Reply #22 on: August 07, 2012, 13:26:09 pm »
no , I dont know of one
I do NOT do development work for hire.

RevoLion

  • Jr. Member
  • **
  • Posts: 67
  • Joomla Covert Operations
Re: Custom Field Types (Explained)
« Reply #23 on: August 07, 2012, 18:19:24 pm »
What would be the best way to go about this?

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #24 on: August 08, 2012, 18:34:35 pm »
Hello,
thank you very much for this tutorial

Could you please tell me how to do to put a custom field to upload pdfs and than show automaticly an icon on the product page that we can clic to download the pdf?

Best regards
Amorino
Création sites web Tunisie
http://www.idealconception.com

PolishedGeek

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 263
  • Joomla! Innovation Refined.
    • Polished Geek, LLC - Joomla! extensions, web development & custom integrations
Re: Custom Field Types (Explained)
« Reply #25 on: August 08, 2012, 18:51:58 pm »
@Amorino -

There's not a file upload Custom Field per se. However, you can do this by using Custom Field Type = editor, and using that to paste in a URL to the PDF, or a linked icon. You'll have to upload your PDFs first of course. Then you can place the PDF links into the product area the way I describe.
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #26 on: August 08, 2012, 18:56:26 pm »
Hello PolishedGeek,
thank you for your answer
in the Virtuemart 1. it was so simple by adding the file in the media

There is no way to do it again with Virtuemart 2?

Best regards
Amorino
Création sites web Tunisie
http://www.idealconception.com

PolishedGeek

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 263
  • Joomla! Innovation Refined.
    • Polished Geek, LLC - Joomla! extensions, web development & custom integrations
Re: Custom Field Types (Explained)
« Reply #27 on: August 08, 2012, 19:06:12 pm »
VM2 is a very different world than 1.1...... in many ways a better world, in other ways, not so much. Perhaps BanquetTables Pro knows another method and can suggest alternatives. He knows the custom fields functionality better than almost anyone on the forums.

Of course, you can always do the exact same thing with an icon and link in the product description field too, once the file has been uploaded to your media directory. But placing it into the product description won't give you the consistency in layout and presentation as putting it in its own specific field, and then controlling where that shows up on the page.
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10270
  • VirtueMart Version: 3+
Re: Custom Field Types (Explained)
« Reply #28 on: August 09, 2012, 00:00:36 am »
Hello PolishedGeek,
thank you for your answer
in the Virtuemart 1. it was so simple by adding the file in the media

There is no way to do it again with Virtuemart 2?

Best regards
Amorino


Using a String to Link to related articles, installation instructions etc.
http://forum.virtuemart.net/index.php?topic=99225.msg327903#msg327903

Create a Custom field  type "string" with the name "Installation Instructions" or whatever you want the anchor text to be.
Assign it to the position "link"
In Edit Product apply the field. Paste the url
This below is the code for displaying the link.

<div class="product-fields">
       <?php
       $custom_title = null;
       foreach ($this->product->customfieldsSorted[link] as $field) {
      if ($field->display) {
          ?>
          <?php if ($field->custom_title != $custom_title) { ?>
             <a href="<?php echo $field->display ?>" ><?php echo JText::_($field->custom_title); ?></a>
<?php } ?>
          <?php } ?> <?php } ?>
        </div>



AND:

have you tried checking the "Downloadable"   in the product image tab?


I do NOT do development work for hire.

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #29 on: August 09, 2012, 05:26:52 am »
AND:

have you tried checking the "Downloadable"   in the product image tab?

Thank you a lot BanquetTables.pro
I tried downlable
I see it in the backend with the medias and it has a pdf icon
But how to insert that icon (cliccable) it in the category template and in the product template?

Best rgegards
Amorino

[Edit:]
Now it's OK in the details page by adding it in the custom field
But I need it in the categorie view because I will not use the detail page
I tried this code :
Code: [Select]
<?php
    
// Product Files
    // foreach ($this->product->images as $fkey => $file) {
    // Todo add downloadable files again
    // if( $file->filesize > 0.5) $filesize_display = ' ('. number_format($file->filesize, 2,',','.')." MB)";
    // else $filesize_display = ' ('. number_format($file->filesize*1024, 2,',','.')." KB)";

    /* Show pdf in a new Window, other file types will be offered as download */
    // $target = stristr($file->file_mimetype, "pdf") ? "_blank" : "_self";
    // $link = JRoute::_('index.php?view=productdetails&task=getfile&virtuemart_media_id='.$file->virtuemart_media_id.'&virtuemart_product_id='.$this->product->virtuemart_product_id);
    // echo JHTMl::_('link', $link, $file->file_title.$filesize_display, array('target' => $target));
    // }
    
if (!empty($this->product->customfieldsRelatedProducts)) {
echo $this->loadTemplate('relatedproducts');
    } 
// Product customfieldsRelatedProducts END

    
if (!empty($this->product->customfieldsRelatedCategories)) {
echo $this->loadTemplate('relatedcategories');
    } 
// Product customfieldsRelatedCategories END
    // Show child categories
    
if (VmConfig::get('showCategory'1)) {
echo $this->loadTemplate('showcategory');
    }
    if (!empty(
$this->product->customfieldsSorted['onbot'])) {
    
$this->position='onbot';
    
echo $this->loadTemplate('customfields');
    } 
// Product Custom ontop end
    
?>

in the category template but it didn't work
Any help please?
Best regards
Amorino
Création sites web Tunisie
http://www.idealconception.com