Viewing 15 posts - 1 through 15 (of 28 total)
  • Author
    Posts
  • Luna Garden Moderator
    #936255

    Hi,

    In backend of K2 category Truck, you set Template to ‘grid’, this template only support to show K2 Extra field with name is GooglePlus, Linkedin, Facebook, Twitter, Skype, Mobile.

    If you want to show the normal extra field, just switch Template K2 to Default.

    gary1234 Friend
    #936519

    Yes that is true, but on the original initial install, the attributes created with K2 extra fields were were showing with the template set to grid so I don’t understand why changing the name of the Category all of a sudden causes the extra field not to show.

    Luna Garden Moderator
    #936703

    I checked the code, no extra field is set to show except the Extra Field with name as above. If you want to show the Extra Field on Grid Template, I’ll help you fix the code to show them.

    gary1234 Friend
    #936812

    I created another site from scratch, as you can see from the link below, the car options are showing, so I do not understand why these extra fields are not showing now.
    http://caninfo1.securesites.net/dcc/index.php/choose-cars/item/36-nissan-micra

    Yes, that would be nice thank you. I would like all of the extra fields to show up the detail page with the price, similar to the look on your version of Rent.
    Please remember that the link to the site that I am working on remains the same.
    http://caninfo1.securesites.net/directcreditconnection/administrator

    Thanks
    Gary

    Luna Garden Moderator
    #937037

    Hi,

    I have fixed in file

    templates/ja_rent/html/com_k2/grid/item.php

    of site http://caninfo1.securesites.net/directcreditconnection/

    gary1234 Friend
    #937159

    Thank you for all your help. I also like to add on more item and that is the word sold on certain vehicles on both the category and detail pages of the K2 pages on the website.

    Thanks

    Luna Garden Moderator
    #937243

    I also like to add on more item and that is the word sold on certain vehicles on both the category and detail pages of the K2 pages on the website.

    Could you clarify more details of what you want to add? it would be better with image capture

    gary1234 Friend
    #937599

    I just want a way to show that a vehicle has been sold and want it displayed on both the category and item pages.

    Luna Garden Moderator
    #938040

    You can add extra field name Sold, type Text Field, then in file

    templates\ja_rent\html\com_k2\grid\category_item.php
    templates\ja_rent\html\com_k2\grid\item.php

    add code checking if Extra Field named ‘Sold’ is not Null, show the word ‘SOLD’

    gary1234 Friend
    #940513

    Could you please provide me with an example piece of code?

    Thanks

    Luna Garden Moderator
    #941043

    Hi,

    Here is my suggestion code:

    <?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
                <?php if($extraField->value != ''): ?>
                    <?php if($extraField->name == 'Sold'): ?>
                        <?php echo '<div class="item-sold">'.$extraField->value.'</div>'; ?>
                    <?php endif; ?>
                <?php endif; ?>
                <?php endforeach; ?>

    You have a K2 Extra field name ‘Sold’ type Text Field, add value ‘Sold’ if this vehicle is Sold, else let it Null. Above code will check name, and status of K2 Extra Field and show the text Sold if it has all condition.

    gary1234 Friend
    #941207

    Hi I added the code as you suggested. When I add the word sold to the "Sold" field the word does show up but when I remove the word sold from the field and go to save the K2 items article an error icon shows up and I am unable to save the article.

    enter image description here

    Another problem is the that the word sold appears 2 times on the item.php page.

    Thanks

    Luna Garden Moderator
    #941317

    Did you set the K2 Extra Field name Sold to Required, set to Required to No and try again.

    gary1234 Friend
    #941525

    Thank you that worked, however another problem has appeared. An element style has added style="min-height: 503px; to the category-item.php page, causing a large space below the word sold. Could you please tell where I can go to alter this so that I can reduce this gap?

    Thanks

    Luna Garden Moderator
    #942018

    Could you provide the exact link with the error, I couldn’t see it in your website URL: http://caninfo1.securesites.net/directcreditconnection/

Viewing 15 posts - 1 through 15 (of 28 total)

This topic contains 28 replies, has 2 voices, and was last updated by  gary1234 8 years, 4 months ago.

The topic ‘K2 Extra Fields not showing.’ is closed to new replies.