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

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #45 on: August 16, 2012, 02:19:46 am »
Hello,
I'm sure that I'm almost near the solution but I'm missing something ;)
Best regards
Amorino
Création sites web Tunisie
http://www.idealconception.com

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Custom Field Types (Explained)
« Reply #46 on: August 16, 2012, 16:09:46 pm »
THIS code looks right, BUT >1  should probably not be there

THE main image is  0, the next is 1. So you would have to have 3 images for a display to happen

try this

<?php
//Pro Hack PDF to position
if (!empty($product->images) {
    ?>
    <div class="additional-images">
   <?php
   // List all Images
   if (count($product->images) > 0) {
       foreach ($product->images as $image) {
       // Displays ONLY pdf files
        if ($image->file_extension ==pdf) {
      echo '<div class="floatleft"><strong> Télécharger la brochure : </strong> <br>' . $image->displayMediaThumb('class="product-image"', true, 'class="modal"', true, true) . '</div>'; //'class="modal"'
       }}
        // PRO DONE, added the close tag
   }}
   ?>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #47 on: August 16, 2012, 17:05:29 pm »
Thank you pro
I tried that code and it gave me the 1st image and not the PDF file wich is in the second position

Pro when I do
<?php echo "<pre>"; print_r( $product->images ); echo "</pre>"; // CATEGORY PAGE ?>

I see only the jpg image in the media and not the pdf
How to make this page read the second file?
Thank you for your help
Best regards
Amorino
Création sites web Tunisie
http://www.idealconception.com

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Custom Field Types (Explained)
« Reply #48 on: August 16, 2012, 19:16:11 pm »
ok, I cannot get any image to work in category besides # 0

which is the main image
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #49 on: August 16, 2012, 20:02:20 pm »
Thank you for your help Pro
So it's not possible to get the pdf icon in the category page like in the details page?
Best regards
Amorino
Création sites web Tunisie
http://www.idealconception.com

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Custom Field Types (Explained)
« Reply #50 on: August 16, 2012, 20:20:56 pm »
You can use the "internal notes" as a field.

Put the url of the pdf in the internal notes.

Then in the category


<a href="<?php echo $product->intnotes ?>">IMAGE FOR PDF</a>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #51 on: August 16, 2012, 22:10:19 pm »
What a good idea
Could you please wich file should I modify to get editor in Internal note
So I will install JCE with the File manager and just put : <?php echo $product->intnotes ?>

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

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #52 on: August 16, 2012, 23:29:42 pm »
Or what do you think about custom field "editor"
Could you help me to figure it out?
Best regards
Amorino
Création sites web Tunisie
http://www.idealconception.com

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Custom Field Types (Explained)
« Reply #53 on: August 17, 2012, 12:42:26 pm »
amorino,

I told you how to do it

in your category template do this

<?php if (!empty($product->intnotes)){?>
<a href="<?php echo $product->intnotes ?>">IMAGE FOR PDF</a>
<?php } ?>


THEN, in the internal notes just write it like this


www.url.com/pdf/123.pdf


J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

imageinaction

  • Beginner
  • *
  • Posts: 31
Re: Custom Field Types (Explained)
« Reply #54 on: October 04, 2012, 09:58:13 am »
A question about the M=Image option

Hello ...

It would be good have the images behave as a button and dispose of the ugly radio buttons. How can this be done?

uschmi

  • Jr. Member
  • **
  • Posts: 108
Custom Field in Category view
« Reply #55 on: November 08, 2012, 12:38:33 pm »
Sorry, I didn´t got it how to show a custom text field in category view.
Could someone please show me an example how to do this.

When trying to use the examples in this thread, I only get Edit forms in the view instead of a normal table view.

webbits

  • Beginner
  • *
  • Posts: 34
Re: Custom Field Types (Explained)
« Reply #56 on: November 13, 2012, 00:33:15 am »
yep now its showing the image CF in the Category with products... it's working with:
Code: [Select]
<?php $custom_title null
if (!empty(
$product->customfields)) {
foreach (
$product->customfields as $field) {
if (
$field->is_hidden //OSP http://forum.virtuemart.net/index.php?topic=99320.0
continue;
if (
$field->display) { ?>

<span class="product-field-display"><?php echo $field->display ?></span>
<?php ?> <?php ?> <?php }  ?>

Are there additional steps I am not getting?  I've tried this code in many positions etc. and still can not get the list for quantity variations to show on the category page.  Currently it is placed in the <div class="product floatleft just before the </div>

Using VM 2.0.12f  and Joomla 2.5.6

Please help - with a simple and direct solution as I am not proficient in php.  Thanks!

Mole_LR

  • Beginner
  • *
  • Posts: 34
Re: Custom Field Types (Explained)
« Reply #57 on: November 15, 2012, 01:47:26 am »
What is the syntax to show THE CustomField, for example, CustomFieldX (not using foreach) into Category View. I'm using CategoryView as table and I need to show needed customfields in columns:

product_sku   customfieldX customfieldY
1111                  valueX1      valueY1
222                    valueX2       valueY2

Every product can have more customfields (also customfieldZ, customfieldA), but I need to show only these 2!

Is it possible, if yes - HOW?

Thank You!   

amorino

  • Jr. Member
  • **
  • Posts: 144
    • Création sites web Tunisie
Re: Custom Field Types (Explained)
« Reply #58 on: December 07, 2012, 17:17:35 pm »
Hello
I would hide "add to cart" on some productes (details page + category pages)

Could I make some condition with the custom fields
Any help please?

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

B4rZAg0nE

  • Beginner
  • *
  • Posts: 7
Re: Custom Field Types (Explained)
« Reply #59 on: December 17, 2012, 05:26:44 am »
It's possible to set position layout of custom fields in category view to filter specific custom fields?