Author Topic: Category Page Fields for Templating  (Read 253198 times)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10440
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #90 on: September 29, 2012, 12:40:59 pm »
Dears,

How we can display an image in the category view when a product is special?
We use the code for the product page:

Code: [Select]
<?php if ($this->category->product_special == 1) { ?>
                  <div>SALE ITEM!!!!! </div>
               <?php    }?>

But that doesn't work for the category page!

Can anybody help me out?

Thanks in advanced!
kevin

$product->product_special



Kbroeren

  • Beginner
  • *
  • Posts: 2
Re: Category Page Fields for Templating
« Reply #91 on: September 29, 2012, 13:43:05 pm »
Works perfect thank you !!

Galena

  • Beginner
  • *
  • Posts: 3
Re: Category Page Fields for Templating
« Reply #92 on: October 07, 2012, 09:51:00 am »
Hi all

I'm trying to add button Order (Order=Ask Question) in Category, but cant write correct $url for this case:

$url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$this->category->virtuemart_category_id.'&tmpl=component');

My problem - product id:
virtuemart_product_id='.$product->virtuemart_product_id.' - it does not work

Is there someone out there who can help me? Thanks!

sajtfokus

  • Beginner
  • *
  • Posts: 14
    • Cute Things and Gifts
Re: Category Page Fields for Templating
« Reply #93 on: October 09, 2012, 21:54:23 pm »
I want to edit price font in Category view, so I found out using Firebug that I need to change some file in ...\components\com_virtuemart\assets\css\ folder.

Is it ok if I change css settings there? Is new VM update going to rewrite those settings?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10440
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #94 on: October 10, 2012, 00:23:45 am »
I want to edit price font in Category view, so I found out using Firebug that I need to change some file in ...\components\com_virtuemart\assets\css\ folder.

Is it ok if I change css settings there? Is new VM update going to rewrite those settings?
http://forum.virtuemart.net/index.php?topic=90935.0

locoman

  • Jr. Member
  • **
  • Posts: 74
Re: Category Page Fields for Templating
« Reply #95 on: October 14, 2012, 00:56:26 am »
hi

i was trying to write for some help but than i realised how to help myself

in the /com_virtuemart/views/category/tmpl/default.php 

// Show Category
            ?>
            <div class="category floatleft ..... 

  but class="category" does not display category    elements like the class  "product"

in order to display category right like   I I I (the per row number) i changed  category with product

// Show Category
            ?>
            <div class="product floatleft center<?php echo $category_cellwidth . $show_vertical_separator ?> ">
               <div class="spacer" > 

i have no ideea about css and how to change it with css, but someone maybe need this trick!

_stu

  • Beginner
  • *
  • Posts: 29
Re: Category Page Fields for Templating
« Reply #96 on: October 20, 2012, 06:51:46 am »
After much searching and trying lots of different suggestions, this is what worked for me.

Question: How to add custom fields to the category page?
Answer: From http://forum.virtuemart.net/index.php?topic=99225.msg344246#msg344246
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 }  ?>

Thank you, lipes!

sorema

  • Beginner
  • *
  • Posts: 27
Re: Category Page Fields for Templating
« Reply #97 on: November 30, 2012, 23:11:39 pm »
i'm using this to display an icon on a featured (special) product.
Code: [Select]
<?php  if ($this->product->product_special == 1){
$image_class='special';}?>

<div id="<?php echo $image_class ?>">
and it works perfectly in product details view

i'm trying to do the same thing in category view.
it shows the image but...over the wrong product! what's happening? :( thank you.

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10440
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #98 on: December 03, 2012, 20:35:42 pm »
i'm using this to display an icon on a featured (special) product.
Code: [Select]
<?php  if ($this->product->product_special == 1){
$image_class='special';}?>

<div id="<?php echo $image_class ?>">
and it works perfectly in product details view

i'm trying to do the same thing in category view.
it shows the image but...over the wrong product! what's happening? :( thank you.


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

jaderotheram

  • Beginner
  • *
  • Posts: 20
Re: Category Page Fields for Templating
« Reply #99 on: January 17, 2013, 12:56:55 pm »
How would I go about changing it so that when I click on a Category Image it takes me to the Sub Category Page, and then so on until the Product Listing.

I have tried this code...

<?php echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb('class="catImage" border="0"',false));
                  ?>

On these files with no change...

template/html/com_virtuemart/virtuemart/default.php
template/html/com_virtuemart/virtuemart/default_categories.php
template/html/com_virtuemart/category/default.php

components/com_virtuemart/views/category/tmpl/default.php
components/com_virtuemart/views/virtuemart/tmpl/default.php
components/com_virtuemart/views/virtuemart/tmpl/default_categories.php

sajtfokus

  • Beginner
  • *
  • Posts: 14
    • Cute Things and Gifts
Re: Category Page Fields for Templating
« Reply #100 on: March 04, 2013, 03:07:40 am »
Hi,

how can I set product thumbnail (from category page, not from product details) to link to URL specified in product information?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10440
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #101 on: March 04, 2013, 21:17:33 pm »
Link Image to product page
   <?php echo JHTML::_('link', JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.'&virtuemart_category_id='.$product->virtuemart_category_id),$product->images[0]->displayMediaThumb('class="catImage" border="0"',false));
                  ?>

edirola

  • Beginner
  • *
  • Posts: 10
Re: Category Page Fields for Templating
« Reply #102 on: March 06, 2013, 10:10:32 am »
Hi,

I'm trying to display category title in category view, but without success. I need the title to display before category description. I'm getting error when entering this:

<?php echo $this->category->category_name; ?>

Almost three days trying to do this. Could somebody help?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10440
  • VirtueMart Version: 3+
Re: Category Page Fields for Templating
« Reply #103 on: March 06, 2013, 15:06:59 pm »
Hi,

I'm trying to display category title in category view, but without success. I need the title to display before category description. I'm getting error when entering this:

<?php echo $this->category->category_name; ?>

Almost three days trying to do this. Could somebody help?



<h1><?php echo $this->category->category_name; ?></h1>

here is the default code in the default.php

sounds like you may be putting it inside of something you should not

edirola

  • Beginner
  • *
  • Posts: 10
Re: Category Page Fields for Templating
« Reply #104 on: March 06, 2013, 15:39:34 pm »
Tnaks PRO for comment. Like you said, I was trying to put it in wrong places