News:

Support the VirtueMart project and become a member

Main Menu

Custom Field Types (Explained)

Started by PRO, March 07, 2012, 18:04:25 PM

Previous topic - Next topic

amorino

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

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
   }}
   ?>

amorino

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

ok, I cannot get any image to work in category besides # 0

which is the main image

amorino

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

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>

amorino

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

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

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



imageinaction

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

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

Quote from: lipes on June 06, 2012, 18:17:55 PM
yep now its showing the image CF in the Category with products... it's working with:
<?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

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

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

It's possible to set position layout of custom fields in category view to filter specific custom fields?