News:

Looking for documentation? Take a look on our wiki

Main Menu

Category Page Fields for Templating

Started by PRO, February 08, 2012, 19:42:18 PM

Previous topic - Next topic

PRO

Quote from: Kbroeren on September 29, 2012, 11:39:53 AM
Dears,

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

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


Galena

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

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

Quote from: sajtfokus 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?
http://forum.virtuemart.net/index.php?topic=90935.0

locoman

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

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

#97
i'm using this to display an icon on a featured (special) product.
<?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

Quote from: sorema on November 30, 2012, 23:11:39 PM
i'm using this to display an icon on a featured (special) product.
<?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

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

Hi,

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

PRO

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

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

Quote from: edirola 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?



<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

Tnaks PRO for comment. Like you said, I was trying to put it in wrong places