VirtueMart Forum

VirtueMart 2 + 3 => Templating & Layouts => Topic started by: PRO on February 08, 2012, 19:42:18 pm

Title: Category Page Fields for Templating
Post by: PRO on February 08, 2012, 19:42:18 pm
These fields are for use in the category view
For product page fields, look here http://forum.virtuemart.net/index.php?topic=92756

Product fields that are not listed here can be used like this
 <?php echo $product->COLUMN_NAME ?>

The difference between category and product page is $this
$this->product      is for product page
$product->   is for product fields on the category page.

SO, to add weight to the category page. You can do
<?php echo $product->product_weight ?>

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

Category Description
<?php echo $this->category->category_description ; ?>

Product Name with Link
<?php echo JHTML::link($product->link, $product->product_name) ?>

Product Details Link with anchor “Product Details”
<?php echo JHTML::link($product->link, JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' =>
'product-details'));?>

Order by list
<?php echo $this->orderByList['orderby']; ?>

Manufacturer Dropdown
<?php echo $this->orderByList['manufacturer']; ?>

Pages/Links/Pagination
<?php echo $this->vmPagination->getResultsCounter();?>
<?php echo $this->vmPagination->getLimitBox(); ?>
<?php echo $this->vmPagination->getPagesLinks(); ?>
<?php echo $this->vmPagination->getPagesCounter(); ?>

Short Description
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>

^^ Notice the 40 above. limitStringByWord strips the text to 40 characters. You can change the "40"
For full short desc
 <?php echo $product->product_s_desc ?>

POP UP Product Image
<?php echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'"
',true,'class="modal"'); ?>

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

Stock Level
<?php echo $product->stock->stock_level ?>

# Products in Stock
<?php echo $product->product_in_stock ?>
Title: Re: Category Page Fields for Templating
Post by: balai on February 09, 2012, 00:38:25 am
Truly interesting post.
Thank you
Title: Re: Category Page Fields for Templating
Post by: Lexiboy on February 10, 2012, 11:35:30 am
To display the product weight in a usable format:

// custom code to display weight 
     if ($product->product_weight <> '0'){
     echo "Упаковка: ";
     echo $product->product_weight;
     // echo $product->product_weight_uom;
     if ($product->product_weight_uom == "LB") echo 'мл.';
     if ($product->product_weight_uom == "OZ") echo 'л.';
     if ($product->product_weight_uom == "GR") echo 'гр.';
     if ($product->product_weight_uom == "KG") echo 'Кг.';
     if ($product->product_weight_uom == "MG") echo 'мг.';
     // print_r($product);
     }

Of course I could have dug a bit deeper into the source to find build in functionality to display the labels. To find more options, print_r is your friend :)
Title: Re: Category Page Fields for Templating
Post by: itsystem on February 17, 2012, 11:36:52 am
Hi,

I would like to display product_sku but when I use <?php echo $this->product->product_sku ?> it dosn't work.
What's the appropriate format ?

Thanks a lot
Title: Re: Category Page Fields for Templating
Post by: itsystem on February 17, 2012, 11:50:45 am
Well, I use :

Code: [Select]
<?php // Product Sku
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->product_sku, array ('title' => $product->product_sku ) ); ?>
Title: Re: Category Page Fields for Templating
Post by: PRO on February 17, 2012, 13:19:32 pm
Hi,

I would like to display product_sku but when I use <?php echo $this->product->product_sku ?> it dosn't work.
What's the appropriate format ?

Thanks a lot


$this->   Refers to the current object. So $this-> ON THE CATEGORY page is calling category variables

$product->
Title: What about items qty in each category ?
Post by: coxi on February 22, 2012, 19:21:32 pm
Hi,
At first, thanks a lot for the support. I could make hack and my website is fine.
But...
It would be better if number of item could be shown in category.

Like this :
Category1 (3)           Category2 (17)            Category3 (4)
instead of
Category1                Category2                    Category3

Unfortunatly, i didn't find the solution. Any idea ?
Regards from France. Alain
Title: Re: Category Page Fields for Templating
Post by: dontflinch on March 02, 2012, 01:08:16 am
I'm trying to test for a category image before echoing its link.

I've tried:

Code: [Select]
<?php if(!empty($this->category->images)) { ?>
       <div id=""><img src="<?php echo $this->category->images[0]->file_url_thumb?>"  alt="" /></div>
<?php }  ?>

but the test does not work (image renders fine if there is one), any ideas anyone?


=========================================================
solution edit: this works (thanks banquet tables pro!):

http://forum.virtuemart.net/index.php?topic=97744.msg326572#msg326572
Title: Re: Category Page Fields for Templating
Post by: PRO on March 02, 2012, 01:17:23 am
I'm trying to test for a category image before echoing its link.

I've tried:

Code: [Select]
<?php if(!empty($this->category->images)) { ?>
       <div id=""><img src="<?php echo $this->category->images[0]->file_url_thumb?>"  alt="" /></div>
<?php }  ?>

but the test does not work (image renders fine if there is one), any ideas anyone?

have you tried?

category->images[0]
Title: Re: Category Page Fields for Templating
Post by: dontflinch on March 02, 2012, 03:32:03 am
I have tried many variations of $this and $category with and without the
Code: [Select]
[0]

trying this makes the image disappear even on pages where there is one:

Code: [Select]
<?php if(!empty($category->images[0])) { ?>
<div id=""><img src="<?php echo $this->category->images[0]->file_url_thumb?>" alt="" /></div>
<?php ?>


btw I think you are the one I saw first say to use this 
Code: [Select]
echo $this->category->images[0]->file_url_thumb; and I modeled my 'if not empty' on your snippet for the product additional images, thanks.

Title: Re: Category Page Fields for Templating
Post by: PRO on March 02, 2012, 12:58:07 pm
<?php if($this->category->images[0]->file_url_thumb) { ?>
       <div id=""><img src="<?php echo $this->category->images[0]->file_url_thumb; ?>"  alt="" /></div>
<?php }  ?>
Title: Re: Category Page Fields for Templating
Post by: amanda mc donald on March 10, 2012, 12:40:40 pm
THANK YOU!!!!!

This helped me so much!

Another question.... can you help me with adding new fields to products information page (I do NOT want to add attributes ... I want to add extra fields).
Joomla 1.7 Vm 2

Thank you
Title: Re: Category Page Fields for Templating
Post by: amanda mc donald on March 10, 2012, 13:17:38 pm
Hi

I want to use this code (linking image to a product):

<?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="browseProductImage" border="0"',false)); ?>

BUT instead of linking the image to a product ... I want to link the image to a URL ... how do I do that?

Thank you
amanda
Title: Re: Category Page Fields for Templating
Post by: dontflinch on March 10, 2012, 16:47:26 pm
what sort of url (i.e. dynamic or one/static)? I think you'll have to be more specific than this.

Hi

I want to use this code (linking image to a product):

<?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="browseProductImage" border="0"',false)); ?>

BUT instead of linking the image to a product ... I want to link the image to a URL ... how do I do that?

Thank you
amanda
Title: Re: Category Page Fields for Templating
Post by: amanda mc donald on March 11, 2012, 20:34:13 pm

I want to link an image to a URL on the internet (e.g. a specific youtube video)

Title: Re: Category Page Fields for Templating
Post by: PRO on March 12, 2012, 10:25:33 am
I want to link an image to a URL on the internet (e.g. a specific youtube video)

You are going to have to save the url in one of the "other fields", and use that variable in the url creation.

Title: Re: Category Page Fields for Templating
Post by: corymp on March 19, 2012, 18:23:19 pm
How can I display a product's custom field on the category page. So far I have:

Code: [Select]
<?php
if (!empty($product->customfieldsSorted['myposition'])) { 
       foreach (
$product->customfieldsSorted['myposition'] as $field) {
if ($field->display) {
if ($field->custom_title != $custom_title) { 
echo $field->display;
}

?>
Title: Re: Category Page Fields for Templating
Post by: corymp on March 20, 2012, 18:01:06 pm
No response on this? it's not possible?
Title: Re: Category Page Fields for Templating
Post by: hollywooood on March 21, 2012, 08:11:02 am
Essentially, I have my category, productdetails and categories folders in the com_virtuemart, html folder.  The product details page works, the categories page works but the category page is non functional.  I have read and re-read this post 5 or 6 times, copied and pasted the coding (which is still the same as what I have) but all this has been done in vain. 

This all started when i made the migration from VM2.0 to VM2.0.2...  My head is really spinning here and all the numbers and letters are starting to merge together and NO, I am not on drugs.

Here is my product coding from the category page:
Code: [Select]
// Show Products ?>
<div class="product floatleft<?php echo $Browsecellwidth $show_vertical_separator ?>">
<div class="spacer">
<div class="floatleft center width140">
               
<?php /** @todo make image popup */
echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
?>



<!-- The "Average Customer Rating" Part -->
<?php if (VmConfig::get('pshop_allow_reviews') == 1) { ?>
<span class="contentpagetitle"><?php echo JText::_('COM_VIRTUEMART_CUSTOMER_RATING'?>:</span>
<br />
<?php
// $img_url = JURI::root().VmConfig::get('assets_general_path').'/reviews/'.$product->votes->rating.'.gif';
// echo JHTML::image($img_url, $product->votes->rating.' '.JText::_('COM_VIRTUEMART_REVIEW_STARS'));
// echo JText::_('COM_VIRTUEMART_TOTAL_VOTES').": ". $product->votes->allvotes; ?>

<?php ?>
<div id="productname-box">
                    <br/>
<h2><?php echo JHTML::link($product->link$product->product_name); ?></h2>

<?php // Product Short Description
if(!empty($product->product_s_desc)) { ?>

<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc40'...'?>
</p>
<?php ?>

<div class="product-price marginbottom12" id="productPrice<?php echo $product->virtuemart_product_id ?>">
<?php
if ($this->show_prices == '1') {
if( $product->product_unit && VmConfig::get('vm_price_show_packaging_pricelabel')) {
echo "<strong>"JText::_('COM_VIRTUEMART_CART_PRICE_PER_UNIT').' ('.$product->product_unit."):</strong>";
}

//todo add config settings
if( $this->showBasePrice){
echo $this->currency->createPriceDiv('basePrice','COM_VIRTUEMART_PRODUCT_BASEPRICE',$product->prices);
echo $this->currency->createPriceDiv('basePriceVariant','COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT',$product->prices);
}
echo $this->currency->createPriceDiv('variantModification','COM_VIRTUEMART_PRODUCT_VARIANT_MOD',$product->prices);
echo $this->currency->createPriceDiv('basePriceWithTax','COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX',$product->prices);
echo $this->currency->createPriceDiv('discountedPriceWithoutTax','COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE',$product->prices);
echo $this->currency->createPriceDiv('salesPriceWithDiscount','COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT',$product->prices);
echo $this->currency->createPriceDiv('salesPrice','COM_VIRTUEMART_PRODUCT_SALESPRICE',$product->prices);
echo $this->currency->createPriceDiv('priceWithoutTax','COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX',$product->prices);
echo $this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices);
echo $this->currency->createPriceDiv('taxAmount','COM_VIRTUEMART_PRODUCT_TAX_AMOUNT',$product->prices);
?>

</div>
                    <br/>
<p class="prodetails-button">
<?php // Product Details Button
echo JHTML::link($product->linkJText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details'));
?>

</p>

</div>

The proper number of products is being shown on the page but no images or product names and the links are not going anywhere. 

I really really really appreciate any insight on this.  Also please note that I have search everywhere for this but as I said I am a bit head spun.
Title: Re: Category Page Fields for Templating
Post by: PRO on March 21, 2012, 11:00:35 am
hollywooood, I am not going to read that code and look for a problem.

Are all images published in the "shop media files"?

AND: what happens when you take a clean category default.php, and put it in the template override folder?



Title: Re: Category Page Fields for Templating
Post by: corymp on March 21, 2012, 11:31:10 am
Banquet, Is there a way yet to put custom fields from the product onto the category page?
Title: Re: Category Page Fields for Templating
Post by: hollywooood on March 21, 2012, 11:38:24 am
Hi Banquet...thanks for the reply.  All images are published in "Shop Media" and just to be sure I popped in a clean default, again, and still having the issue.  I just noticed there are spaces in the image name, would this be a problem?  I didn't think anything of this since the images show everywhere else..

also, none of the product names are showing..
Title: Re: Category Page Fields for Templating
Post by: PRO on March 21, 2012, 11:47:10 am
Hi Banquet...thanks for the reply.  All images are published in "Shop Media" and just to be sure I popped in a clean default, again, and still having the issue.  I just noticed there are spaces in the image name, would this be a problem?  I didn't think anything of this since the images show everywhere else..

also, none of the product names are showing..

have you tried the tool "install or update tables if necessary"

Title: Re: Category Page Fields for Templating
Post by: PRO on March 21, 2012, 11:47:43 am
Banquet, Is there a way yet to put custom fields from the product onto the category page?

what custom field?
Title: Re: Category Page Fields for Templating
Post by: corymp on March 21, 2012, 11:49:36 am
If I create a custom field and place it on the product page, say Warranty. Set it to position "Waranty". Can I take that same custom field and put it on the category page for that product?
So far I have this to place a custom positioned string on my product page

Code: [Select]
<?php
if (!empty($this->product->customfieldsSorted['myposition'])) { 
       foreach (
$product->customfieldsSorted['myposition'] as $field) {
if ($field->display) {
if ($field->custom_title != $custom_title) { 
echo $field->display;
}

?>

I want to place the same custom field on the category page for the product
Title: Re: Category Page Fields for Templating
Post by: hollywooood on March 21, 2012, 11:57:36 am
Just tried this and no luck... :o  ...any other ideas?
Title: Re: Category Page Fields for Templating
Post by: PRO on March 21, 2012, 13:32:08 pm
If I create a custom field and place it on the product page, say Warranty. Set it to position "Waranty". Can I take that same custom field and put it on the category page for that product?
So far I have this to place a custom positioned string on my product page

Code: [Select]
<?php
if (!empty($this->product->customfieldsSorted['myposition'])) { 
       foreach (
$product->customfieldsSorted['myposition'] as $field) {
if ($field->display) {
if ($field->custom_title != $custom_title) { 
echo $field->display;
}

?>

I want to place the same custom field on the category page for the product

this wont work in category. It would take some custom coding.



Title: Re: Category Page Fields for Templating
Post by: hollywooood on March 22, 2012, 04:10:21 am
What more information can I provide to sort out why my product data (image and product name) isn't displaying on my category page?  Any other ideas or suggestions other than the obvious on this one?  I greatly appreciate a solution on this....

Thanks in advance for any help..
Title: Re: Category Page Fields for Templating
Post by: hollywooood on March 22, 2012, 04:53:04 am
I just reset all tables and installed sample data from the tools menu and still this issue occurs...Writing this off as a bug since i am unable to resolve here...appreciate all the help...
Title: Re: Category Page Fields for Templating
Post by: hollywooood on March 22, 2012, 14:16:21 pm
My issue has been resolved...turns out, virtuemart does not like Falang as a translating option.  How in the heck does one figure these things out?  Turn off every plugin one by one until things start working again.  Painful process but learned a great deal...

Title: Re: Category Page Fields for Templating
Post by: jenkinhill on March 22, 2012, 18:01:23 pm
The Falang incompatibility is already reported here: http://forum.virtuemart.net/index.php?topic=97880
Title: Re: Category Page Fields for Templating
Post by: hollywooood on March 23, 2012, 14:38:43 pm
Good to know this now but I don't think anyone would know the affect it would have to pinpoint that it is in fact Falang.  Perhaps putting "causes product display errors" in the title might make it easier to find the associated problem.  Maybe I'm nitpicking here, not sure, spent a lot of time trying to sort that out.

Title: Re: Category Page Fields for Templating
Post by: baggeler on March 29, 2012, 15:03:41 pm
Suggestion for Forum management:

There is a HUGE amount of information here on the board and identified bugs may be pretty difficult to discover, even with search.
However, a simple solution of moderators tagging all relevant messages (similar like sticky) which contain such identified bugs or other important messages would be an excellent mean to reduce a huge amount of duplication and frustratin for both moderators and users.

Like the faq and the sticky, this would be one of the first places for everybody to rapidly find solutions or at least identify known issues... Virtuemart is growing fast and I guess this solution would be beneficial for everybody.
Title: Re: Category Page Fields for Templating
Post by: PRO on April 09, 2012, 11:57:30 am
I disabled image popup function in category page. But I want the image to link to the product page so I

Deleted below lines

<?php /** @todo make image popup */ echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',false,'class="modal"');?>

and replaced with this below but not working...

<?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="browseProductImage" border="0"',false)); ?>

What did I do wrong?

Thank you-:)

what is it doing?
Title: Re: Category Page Fields for Templating
Post by: hebole on April 10, 2012, 13:43:50 pm
What code should I use to measure the length, width and height to display in the category page?
Title: Re: Category Page Fields for Templating
Post by: RuBAN on April 14, 2012, 14:14:14 pm
Can I translate units (GR, M, etc.) to another language without PHP fixes?
Title: Re: Category Page Fields for Templating
Post by: lipes on April 19, 2012, 21:59:40 pm
Hi. It's possible to have a Normal Manufacturer List (like a menu) instead of a Dropdown list ?
<?php echo $this->orderByList['manufacturer']; ?>
Title: Re: Category Page Fields for Templating
Post by: PRO on April 20, 2012, 13:53:20 pm
lipes, ofcourse.

The only difference is the css

Title: Re: Category Page Fields for Templating
Post by: lipes on April 24, 2012, 14:25:52 pm
its possible to call some php code function like:
<?php echo $this->orderByList['manufacturer_product_categories']; ?>  or <?php echo $this->orderByList['mf_categories']; ?> or <?php echo $this->orderByList['categories']; ?> ?
When we are in a Manufacturer Page Users Could see the Available Product Categories of that Brand ...

In fact I dont know what php name could call Product Categories on the specific Manufacturer ...
Or we have to have this option first: http://img839.imageshack.us/img839/7343/60507342.png 
to do that ?

Thanks!
Title: Re: Category Page Fields for Templating
Post by: PRO on April 24, 2012, 21:37:02 pm
its possible to call some php code function like:
<?php echo $this->orderByList['manufacturer_product_categories']; ?>  or <?php echo $this->orderByList['mf_categories']; ?> or <?php echo $this->orderByList['categories']; ?> ?
When we are in a Manufacturer Page Users Could see the Available Product Categories of that Brand ...

In fact I dont know what php name could call Product Categories on the specific Manufacturer ...
Or we have to have this option first: http://img839.imageshack.us/img839/7343/60507342.png 
to do that ?

Thanks!

no,

I just did this
<?php print_r($this->manufacturer) ?>

and did not get the data you were looking for


You could always use modules to add extra stuff to pages
Title: Re: Category Page Fields for Templating
Post by: lipes on April 25, 2012, 00:08:31 am
http://localhost/mp5/index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=3

I'm trying to see in Manufacturer Id 3 ( or any other Manufacturer ID )... but cant find a solution to print all the possible commands

I've tryed to insert this <?php print_r($this->manufacturer) ?>  in my template folder /html/com_virtuemart / manufacturer / default.php

but dont work :(

Maybe could be related with this code in Module VM Category
$category->childs = $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $category->virtuemart_category_id );

to get all Child Category Listing in the Manufacturer brand ?
But i dont know how to do it.. :/
Title: Re: Category Page Fields for Templating
Post by: PRO on April 25, 2012, 12:20:10 pm
http://localhost/mp5/index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=3

I'm trying to see in Manufacturer Id 3 ( or any other Manufacturer ID )... but cant find a solution to print all the possible commands

I've tryed to insert this <?php print_r($this->manufacturer) ?>  in my template folder /html/com_virtuemart / manufacturer / default.php

but dont work :(

Maybe could be related with this code in Module VM Category
$category->childs = $cache->call( array( 'VirtueMartModelCategory', 'getChildCategoryList' ),$vendorId, $category->virtuemart_category_id );

to get all Child Category Listing in the Manufacturer brand ?
But i dont know how to do it.. :/

$this->manufacturer
http://forum.virtuemart.net/index.php?topic=100696.0

^^ ONLY works on    details
$this->   REFERS to the CURRENT object, which can be identified by the   ID in the url

Product Page  $this->   refers to the product that the product id is in the url
Category Page $this-> Refers to the category that the ID is in the URL
Manufacturer Page Detail $this-> Refers to the manufacturer that the ID is in the url

Title: Re: Category Page Fields for Templating
Post by: lipes on April 25, 2012, 17:00:37 pm
yes i already know that precious rules. But I'am in Module Manufacturer List View that comes with this url attached (index.php?option=com_virtuemart&view=manufacturer&Itemid=131)

and with the link in One Manufacturer Brand (id 2) ( index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=2 )

is different that comming from the normal Product Categories the url ( index.php?option=com_virtuemart&view=category&virtuemart_category_id=2 )
............................
In that Manufacturer (ID 2) Category (or Categories View i dont know the difference because i think this is working bad) the page doesnt show to me the Header Title of Manufacturer too... only displays this in html: <h1></h1> .. no title Name of Manufacturer!! :|
Title: Re: Category Page Fields for Templating
Post by: readyforchange on April 30, 2012, 19:33:31 pm
Hello Guys,

I have three requests...  I have taken out my product details button with the help of this forum ( you guys ). 

1.  I need help with making the product image link to my product details page.  I tried cutting and pasting in the solution but i keep on getting errors.  Can someone show me what text to replace with what... to get that to work?

2.  I need a new add to cart button that matches the buttons in Yootheme.  http://www.yootheme.com/demo/joomla/cloud <<< the details button.  How do I do that?

3. I would also like to add ... the add to cart button in the category product view... how do i do that?

Thank you very much.
Title: Re: Category Page Fields for Templating
Post by: iMacvador on May 09, 2012, 12:50:32 pm
if i understand right, those codes are a part of the solution i need and posted on this topic :

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

if they are what i need... how to use them to have my products page looking like i show in the photos hoped image... ?
Title: Re: Category Page Fields for Templating
Post by: Mandig on May 09, 2012, 14:09:17 pm
Hi,

I'm trying to add the manufacturer's name in category view too. I spent a lot of time on this but right now still no success.

Is there someone out there who can help me?

Thanks in advance.
Title: Re: Category Page Fields for Templating
Post by: dontflinch on May 09, 2012, 19:06:09 pm
I am trying to add a pdf icon and function to our full product listing in the category / default view.

I have tried both of these with no success yet:


Code: [Select]
    <?php

    
$link 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=0';

echo $this->linkIcon($link '&format=pdf''COM_VIRTUEMART_PDF''pdf_button''pdf_button_enable'false);

    ?>


Code: [Select]
    <?php

    
$link 'index.php?option=com_virtuemart&view=category';

echo $this->linkIcon($link '&format=pdf''COM_VIRTUEMART_PDF''pdf_button''pdf_button_enable'false);

    ?>

it doesn't break but just looks like a regular page.

any suggestions?
Title: Re: Category Page Fields for Templating
Post by: PRO on May 10, 2012, 14:47:23 pm
I am trying to add a pdf icon and function to our full product listing in the category / default view.

I have tried both of these with no success yet:


Code: [Select]
    <?php

    
$link 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=0';

echo $this->linkIcon($link '&format=pdf''COM_VIRTUEMART_PDF''pdf_button''pdf_button_enable'false);

    ?>


Code: [Select]
    <?php

    
$link 'index.php?option=com_virtuemart&view=category';

echo $this->linkIcon($link '&format=pdf''COM_VIRTUEMART_PDF''pdf_button''pdf_button_enable'false);

    ?>

it doesn't break but just looks like a regular page.

any suggestions?

WHAT are you trying to do?


Send them straight to the pdf product details view?

what are you sending them to category?
$link = 'index.php?option=com_virtuemart&view=category';

Title: Re: Category Page Fields for Templating
Post by: dontflinch on May 10, 2012, 16:10:12 pm
Hi BTpro, thanks for the reply.  I am trying to pdf the entire listing page, not a particular detail.  The product detail pdf function works great but we want our entire catalog listing to be pdf'able.  I will pm you a link to the page I mean.
Title: Re: Category Page Fields for Templating
Post by: pierretraf on May 15, 2012, 12:48:39 pm
I'm using Virtuemart 2 and I would like to open the product detail in a new window when the "product detail" or product name is clicked on. The currently open in the same window. I know it should be target="_blank" but how do I implement that on the category default page?

It has to be specified somewhere in here:
<div class="product-details2 floatright">
               <?php // Product Details Button
               echo JHTML::link($product->link, JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details'));
               ?>
               </div>
Title: Re: Category Page Fields for Templating
Post by: PRO on May 16, 2012, 13:19:42 pm
I'm using Virtuemart 2 and I would like to open the product detail in a new window when the "product detail" or product name is clicked on. The currently open in the same window. I know it should be target="_blank" but how do I implement that on the category default page?

It has to be specified somewhere in here:
<div class="product-details2 floatright">
               <?php // Product Details Button
               echo JHTML::link($product->link, JText::_('COM_VIRTUEMART_PRODUCT_DETAILS'), array('title' => $product->product_name,'class' => 'product-details'));
               ?>
               </div>



<a target="_blank" href="<?php echo $product->link ?>" ><?php echo $product->product_name ?></a>
Title: Re: Category Page Fields for Templating
Post by: euge001 on June 06, 2012, 18:57:17 pm
Hello!

Sorry for stupid question, but
 
I tried to put 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="browseProductImage" border="0"',false)); ?>


This code everywhere, but I just saw after that only white screen.
Could someone please explain me where exactly to put this piece of code to avoid a mistake.

Thank you!
Title: Re: Category Page Fields for Templating
Post by: PRO on June 06, 2012, 22:15:31 pm
Hello!

Sorry for stupid question, but
 
I tried to put 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="browseProductImage" border="0"',false)); ?>


This code everywhere, but I just saw after that only white screen.
Could someone please explain me where exactly to put this piece of code to avoid a mistake.

Thank you!

change this
<?php /** @todo make image popup */
                     echo $product->images[0]->displayMediaThumb('class="browseProductImage" border="0" title="'.$product->product_name.'" ',true,'class="modal"');
                  ?>

to this


<?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));
                  ?>
Title: Re: Category Page Fields for Templating
Post by: euge001 on June 07, 2012, 09:12:52 am
thank you! it works now
Title: Re: Category Page Fields for Templating
Post by: ereallstaff on June 11, 2012, 18:09:05 pm
Sorry for the OT but I can't find any information

Is there any chance to put a module only in category page ( or f.e. in cart page ) ?

Thanks
Title: Re: Category Page Fields for Templating
Post by: PRO on June 11, 2012, 20:28:12 pm
Sorry for the OT but I can't find any information

Is there any chance to put a module only in category page ( or f.e. in cart page ) ?

Thanks

http://www.kaizenmediaworks.com/virtuemart-template-and-module-control
http://www.metamodpro.com/metamod/shop16

Title: Re: Category Page Fields for Templating
Post by: PaulJUK on June 12, 2012, 16:57:55 pm
Hi, looking for some guidance on getting the category name of the product within the category view.

I have used <?php echo $product->category_name; ?> but this returns the main category level not the child category that the product is inside.
I would like to show the name of the child category inside the set of products.
I have tried many variations of this to try and get the required information.

any thoughts?
Title: Re: What about items qty in each category ?
Post by: perlarenee on July 10, 2012, 22:08:33 pm
Does anyone know a solution such as how the amount of products in a category can be called?

Hi,
At first, thanks a lot for the support. I could make hack and my website is fine.
But...
It would be better if number of item could be shown in category.

Like this :
Category1 (3)           Category2 (17)            Category3 (4)
instead of
Category1                Category2                    Category3

Unfortunatly, i didn't find the solution. Any idea ?
Regards from France. Alain
Title: Re: Category Page Fields for Templating
Post by: alinea49 on July 11, 2012, 19:21:33 pm
Hello folks
I would like display a table  with one product per line, with
id product, thumbnail, product sku, short description, quantity, and add to cart field.

a sort of flat list product.

This table is shown when you select a category, or after a search request.

Help will be graceful recieved !

(I known I speak english as a spanish cow - I am a froggy... ;)

some idea how to ?
joomla 1.5 WM 2.x


Title: Re: Category Page Fields for Templating
Post by: PRO on July 15, 2012, 21:30:29 pm
alinea49,

you are going to change the category template by doing a template override, or do it with css, and set 1 product per row
Title: Re: Category Page Fields for Templating
Post by: PaulJUK on July 17, 2012, 22:49:20 pm
Hi, looking for some guidance on getting the category name of the product within the category view.

I have used <?php echo $product->category_name; ?> but this returns the main category level not the child category that the product is inside.
I would like to show the name of the child category inside the set of products.
I have tried many variations of this to try and get the required information.

any thoughts?


Any suggestions for this one yet?
Title: Re: Category Page Fields for Templating
Post by: PRO on July 18, 2012, 18:05:21 pm
Hi, looking for some guidance on getting the category name of the product within the category view.

I have used <?php echo $product->category_name; ?> but this returns the main category level not the child category that the product is inside.
I would like to show the name of the child category inside the set of products.
I have tried many variations of this to try and get the required information.

any thoughts?


Any suggestions for this one yet?

you are not going to be able to do this without writing some code to query the database.


Or, you could use a separate field.
You could use internal notes

<?php echo $product->intnotes ?>

Title: Re: Category Page Fields for Templating
Post by: robboh69 on July 25, 2012, 00:25:08 am
Hi.

Some how would it be possible to iterate and show the categories (like in the categories view) on the category view?
And how would you do that?

the $this-trick will not do that from what I can figure out?  :)
Title: Re: Category Page Fields for Templating
Post by: perlarenee on July 27, 2012, 17:18:09 pm
arg, i've seen this question at least 5 or 6 times in various places here and so far no answer cuz the thread keeps going to different topics.

yes i already know that precious rules. But I'am in Module Manufacturer List View that comes with this url attached (index.php?option=com_virtuemart&view=manufacturer&Itemid=131)

and with the link in One Manufacturer Brand (id 2) ( index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=2 )

is different that comming from the normal Product Categories the url ( index.php?option=com_virtuemart&view=category&virtuemart_category_id=2 )
............................
In that Manufacturer (ID 2) Category (or Categories View i dont know the difference because i think this is working bad) the page doesnt show to me the Header Title of Manufacturer too... only displays this in html: <h1></h1> .. no title Name of Manufacturer!! :|
Title: Re: Category Page Fields for Templating
Post by: guidocx842 on August 02, 2012, 14:15:40 pm
Hi everybody!
I need your help to change my category style. What I need is very simple (.. I suppose)
I have many menu voices that are setted to show VM - Single Category. For example, I choose Garden Tools category, from example data.

Now I need to see my category page in this way:

Only the name of the product at the top of the product image, i.e. 300x200 px (image centered). I will set three product for each row.
The image have to be a link to the product page (i.e. http://mysite.it/products/space-treatment/nutrition/ladder-detail) and not to the image file (http://mysite.it/images/stories/virtuemart/product/resized/ladder_90x90.jpg)... not popup...

Can somebody help me please? I find something in /components/com_virtuemart/views/category/tmpl/default.php

I think that I've to modify from // Show Products section (row 439 of the original default.php file)... but I don't know how.

THANKS A LOT!
Title: Re: Category Page Fields for Templating
Post by: PRO on August 02, 2012, 18:02:07 pm
Hi everybody!
I need your help to change my category style. What I need is very simple (.. I suppose)
I have many menu voices that are setted to show VM - Single Category. For example, I choose Garden Tools category, from example data.

Now I need to see my category page in this way:

Only the name of the product at the top of the product image, i.e. 300x200 px (image centered). I will set three product for each row.
The image have to be a link to the product page (i.e. http://mysite.it/products/space-treatment/nutrition/ladder-detail) and not to the image file (http://mysite.it/images/stories/virtuemart/product/resized/ladder_90x90.jpg)... not popup...

Can somebody help me please? I find something in /components/com_virtuemart/views/category/tmpl/default.php

I think that I've to modify from // Show Products section (row 439 of the original default.php file)... but I don't know how.

THANKS A LOT!


guidocx842,


So you want

NAME
IMAGE



and NOTHING else?   Y Nada?

Title: Re: Category Page Fields for Templating
Post by: guidocx842 on August 02, 2012, 19:45:03 pm
Yes! Nada de nada  :D
My category view will be composed by many rows. On each row three image of the products with at top the name of the products. When the user click on the image he can go to the product specific page where he will find all informations: prices, description, etc.
Is it possible? Many thanks four your help! I really appreciate!
Title: Re: Category Page Fields for Templating
Post by: PRO on August 02, 2012, 20:21:46 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="browseProductImage" border="0"',false)); ?>

Product Name with Link
<?php echo JHTML::link($product->link, $product->product_name) ?>

Code below is the  category/tmpl/default.php

It displayes

IMAGE
Product-Name

Code: [Select]
<?php
/**
*
* Show the products in a category
*
* @package VirtueMart
* @subpackage
* @author RolandD
* @author Max Milbers
* @todo add pagination
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: default.php 6297 2012-07-24 19:19:34Z Milbo $
*/

//vmdebug('$this->category',$this->category);
vmdebug('$this->category '.$this->category->category_name);
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
JHTML::_'behavior.modal' );
/* javascript for list Slide
  Only here for the order list
  can be changed by the template maker
*/
$js "
jQuery(document).ready(function () {
jQuery('.orderlistcontainer').hover(
function() { jQuery(this).find('.orderlist').stop().show()},
function() { jQuery(this).find('.orderlist').stop().hide()}
)
});
"
;

$document JFactory::getDocument();
$document->addScriptDeclaration($js);

/*$edit_link = '';
if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php');
if (Permissions::getInstance()->check("admin,storeadmin")) {
$edit_link = '<a href="'.JURI::root().'index.php?option=com_virtuemart&tmpl=component&view=category&task=edit&virtuemart_category_id='.$this->category->virtuemart_category_id.'">
'.JHTML::_('image', 'images/M_images/edit.png', JText::_('COM_VIRTUEMART_PRODUCT_FORM_EDIT_PRODUCT'), array('width' => 16, 'height' => 16, 'border' => 0)).'</a>';
}

echo $edit_link; */
if ( empty($this->keyword) ) {
?>

<div class="category_description">
<?php echo $this->category->category_description ?>
</div>
<?php
}

/* Show child categories */

if ( VmConfig::get('showCategory',1) and empty($this->keyword)) {
if ($this->category->haschildren) {

// Category and Columns Counter
$iCol 1;
$iCategory 1;

// Calculating Categories Per Row
$categories_per_row VmConfig::get 'categories_per_row');
$category_cellwidth ' width'.floor 100 $categories_per_row );

// Separator
$verticalseparator " vertical-separator";
?>


<div class="category-view">

<?php // Start the Output
if(!empty($this->category->children)){
foreach ( $this->category->children as $category ) {

// Show the horizontal seperator
if ($iCol == && $iCategory $categories_per_row) { ?>

<div class="horizontal-separator"></div>
<?php }

// this is an indicator wether a row needs to be opened or not
if ($iCol == 1) { ?>

<div class="row">
<?php }

// Show the vertical seperator
if ($iCategory == $categories_per_row or $iCategory $categories_per_row == 0) {
$show_vertical_separator ' ';
} else {
$show_vertical_separator $verticalseparator;
}

// Category Link
$caturl JRoute::'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' $category->virtuemart_category_id );

// Show Category ?>

<div class="category floatleft<?php echo $category_cellwidth $show_vertical_separator ?>">
<div class="spacer">
<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
<?php echo $category->category_name ?>
<br />
<?php // if ($category->ids) {
echo $category->images[0]->displayMediaThumb("",false);
//} ?>

</a>
</h2>
</div>
</div>
<?php
$iCategory ++;

// Do we need to close the current row now?
if ($iCol == $categories_per_row) { ?>

<div class="clear"></div>
</div>
<?php
$iCol 1;
} else {
$iCol ++;
}
}
}
// Do we need a final closing row tag?
if ($iCol != 1) { ?>

<div class="clear"></div>
</div>
<?php ?>
</div>

<?php }
}
?>

<div class="browse-view">
    <?php
if (!empty($this->keyword)) {
?>

<h3><?php echo $this->keyword?></h3>
<?php
?>

  <?php if ($this->search !==null ) { ?>
    <form action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=category&limitstart=0&virtuemart_category_id='.$this->category->virtuemart_category_id ); ?>" method="get">

    <!--BEGIN Search Box --><div class="virtuemart_search">
    <?php echo $this->searchcustom ?>
    <br />
    <?php echo $this->searchcustomvalues ?>
    <input name="keyword" class="inputbox" type="text" size="20" value="<?php echo $this->keyword ?>" />
    <input type="submit" value="<?php echo JText::_('COM_VIRTUEMART_SEARCH'?>" class="button" onclick="this.form.keyword.focus();"/>
    </div>
    <input type="hidden" name="search" value="true" />
    <input type="hidden" name="view" value="category" />

    </form>
<!-- End Search Box -->
<?php ?>

<?php // Show child categories
if (!empty($this->products)) {
?>

<div class="orderby-displaynumber">
<div class="width70 floatleft">
<?php echo $this->orderByList['orderby']; ?>
<?php echo $this->orderByList['manufacturer']; ?>
</div>
<div class="width30 floatright display-number"><?php echo $this->vmPagination->getResultsCounter();?><br/><?php echo $this->vmPagination->getLimitBox(); ?></div>
<div class="vm-pagination">
<?php echo $this->vmPagination->getPagesLinks(); ?>
<span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span>
</div>

<div class="clear"></div>
</div> <!-- end of orderby-displaynumber -->

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

<?php
// Category and Columns Counter
$iBrowseCol 1;
$iBrowseProduct 1;

// Calculating Products Per Row
$BrowseProducts_per_row $this->perRow;
$Browsecellwidth ' width'.floor 100 $BrowseProducts_per_row );

// Separator
$verticalseparator " vertical-separator";

// Count products ?? why not just count ($this->products)  ?? note by Max Milbers
$BrowseTotalProducts 0;
foreach ( 
$this->products as $product ) {
   
$BrowseTotalProducts ++;
}

// Start the Output
foreach ( $this->products as $product ) {

// Show the horizontal seperator
if ($iBrowseCol == && $iBrowseProduct $BrowseProducts_per_row) { ?>

<div class="horizontal-separator"></div>
<?php }

// this is an indicator wether a row needs to be opened or not
if ($iBrowseCol == 1) { ?>

<div class="row">
<?php }

// Show the vertical seperator
if ($iBrowseProduct == $BrowseProducts_per_row or $iBrowseProduct $BrowseProducts_per_row == 0) {
$show_vertical_separator ' ';
} else {
$show_vertical_separator $verticalseparator;
}

// Show Products ?>

<div class="product floatleft<?php echo $Browsecellwidth $show_vertical_separator ?>">
<div class="spacer">
<div class="center">
<?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));
?>

</div><div class="clear"></div>

<div class="product-name">

<h2><?php echo JHTML::link($product->link$product->product_name); ?></h2></div>


<div class="clear"></div>
</div><!-- end of spacer -->
</div> <!-- end of product -->
<?php

   
// Do we need to close the current row now?
   
if ($iBrowseCol == $BrowseProducts_per_row || $iBrowseProduct == $BrowseTotalProducts) {?>

   <div class="clear"></div>
   </div> <!-- end of row -->
      <?php
      $iBrowseCol 
1;
   } else {
      
$iBrowseCol ++;
   }

   
$iBrowseProduct ++;
// end of foreach ( $this->products as $product )
// Do we need a final closing row tag?
if ($iBrowseCol != 1) { ?>

<div class="clear"></div>

<?php
}
?>

<!-- /div removed valerie -->
<div class="vm-pagination"><?php echo $this->vmPagination->getPagesLinks(); ?><span style="float:right"><?php echo $this->vmPagination->getPagesCounter(); ?></span></div>
<!-- /div removed valerie -->
<?php } elseif ($this->search !==null ) echo JText::_('COM_VIRTUEMART_NO_RESULT').($this->keyword' : ('$this->keyword')' '')
?>

</div><!-- end browse-view -->
Title: Re: Category Page Fields for Templating
Post by: guidocx842 on August 03, 2012, 10:00:31 am
Hi!! You're the best!!! Thanks!!
Last thing: at the top of the category I find the name of the category view (i.e. Garden Tools).
I think I found the code that show me that name.

Code: [Select]
// Show Category ?>

<div class="category floatleft<?php echo $category_cellwidth $show_vertical_separator ?>">

<div class="spacer">

<h2>

<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">

<?php echo $category->category_name ?>

<br />

<?php // if ($category->ids) {

echo $category->images[0]->displayMediaThumb("",false);

//} ?>


</a>

</h2>

</div>

</div>

In addition I need to show the category description that I write when I create a category on virtuemart backoffice.
How can I add this description under the name of category? Thanks a lot! Have a nice day.
Title: Re: Category Page Fields for Templating
Post by: PRO on August 03, 2012, 15:12:18 pm
Its at the top of that file
<div class="category_description">
   <?php echo $this->category->category_description ; ?>
   </div>
Title: Re: Category Page Fields for Templating
Post by: guidocx842 on August 03, 2012, 23:55:20 pm
You're in right! Thank you very much for your help! Thanks a lot! See you on the forum!  ;)
Title: Re: Category Page Fields for Templating
Post by: babouz on August 08, 2012, 15:22:24 pm
Hi everybody,
I would like to know something. Is it possible to show custom fields of each products on category page ?

Thank you
Title: Re: Category Page Fields for Templating
Post by: Sid. on August 27, 2012, 15:13:42 pm
So I wanted to link the thumbnail on my Category page to an external URL (a YouTube video), but I wanted the video to popup in a modal window. I installed RokBox and updated the product thumbnail code on my Category page to this:

Code: [Select]
<?php echo JHTML::_('link'JRoute::_($product->product_url),$product->images[0]->displayMediaThumb('class="catImage" border="0"',false),'rel="rokbox"'); ?>

It works beautifully.
Title: Re: Category Page Fields for Templating
Post by: troken on September 01, 2012, 11:11:03 am
Hello
how I can remove the link to the product name in category template?
In this
Code: [Select]
<?php echo JHTML::link($product->link$product->product_name); ?> remove link
Thanks
Title: Re: Category Page Fields for Templating
Post by: PRO on September 03, 2012, 15:39:26 pm
Hello
how I can remove the link to the product name in category template?
In this
Code: [Select]
<?php echo JHTML::link($product->link$product->product_name); ?> remove link
Thanks

You want just the name?

<?php echo $product->product_name ?>
Title: Re: Category Page Fields for Templating
Post by: mustang888 on September 06, 2012, 08:58:57 am
Hello

as we know, on the category page there is title and an image, if we click on the title, it will direct the page to the list of product page. and there is an image which is unclickable. How do I make the image clickable and link to the list of product page?

Sorry for bad english.
Thanks in advance.
Title: Re: Category Page Fields for Templating
Post by: PRO on September 06, 2012, 18:11:48 pm
Hello

as we know, on the category page there is title and an image, if we click on the title, it will direct the page to the list of product page. and there is an image which is unclickable. How do I make the image clickable and link to the list of product page?

Sorry for bad english.
Thanks in advance.

are you talking about the category childlist?

or the product links?

Title: Re: Category Page Fields for Templating
Post by: mustang888 on September 07, 2012, 06:59:34 am
This is the site.
http://www.indoneka.com/aksesoris_mobil/home/allproducts/aksesoris-mobil.html

How to make the images clickable?

Thank you.
Title: Re: Category Page Fields for Templating
Post by: jason45 on September 07, 2012, 09:50:46 am
I need to product_sku also and find that while using different options the outcomes are not as required. Would like to know the most effective format.
Title: Re: Category Page Fields for Templating
Post by: PRO on September 07, 2012, 14:38:52 pm
This is the site.
http://www.indoneka.com/aksesoris_mobil/home/allproducts/aksesoris-mobil.html

How to make the images clickable?

Thank you.

that page was not loading for me
Title: Re: Category Page Fields for Templating
Post by: mustang888 on September 07, 2012, 15:23:56 pm
Hi Pro, please take a loot at images below
the first image is parent category and the second image is child category

http://i48.tinypic.com/33c3uok.jpg
http://i48.tinypic.com/oa4pqx.jpg


Any suggestion would be very appreciated! Thanks
Title: Re: Category Page Fields for Templating
Post by: PRO on September 07, 2012, 16:33:12 pm
Hi Pro, please take a loot at images below
the first image is parent category and the second image is child category

http://i48.tinypic.com/33c3uok.jpg
http://i48.tinypic.com/oa4pqx.jpg


Any suggestion would be very appreciated! Thanks


are you using a commercial template?

I just looked in the code, and the category childlist has clickable images
Title: Re: Category Page Fields for Templating
Post by: mustang888 on September 08, 2012, 13:01:07 pm
Hi Pro, please take a loot at images below
the first image is parent category and the second image is child category

http://i48.tinypic.com/33c3uok.jpg
http://i48.tinypic.com/oa4pqx.jpg


Any suggestion would be very appreciated! Thanks


are you using a commercial template?

I just looked in the code, and the category childlist has clickable images

But it doesn't happen on my website. As well as linking product image to product detail but later i got the tutorial on this forum. it just doesn't apply to category pages.
I am using Gavick Pro e-sport Joomla 2.5 and VM 2.
Title: Re: Category Page Fields for Templating
Post by: PRO on September 08, 2012, 14:43:16 pm
Hi Pro, please take a loot at images below
the first image is parent category and the second image is child category

http://i48.tinypic.com/33c3uok.jpg
http://i48.tinypic.com/oa4pqx.jpg


Any suggestion would be very appreciated! Thanks


are you using a commercial template?

I just looked in the code, and the category childlist has clickable images

But it doesn't happen on my website. As well as linking product image to product detail but later i got the tutorial on this forum. it just doesn't apply to category pages.
I am using Gavick Pro e-sport Joomla 2.5 and VM 2.



views/category/tmpl/default.php


This is the code that links the category name and image to the url

// Category Link
         $caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

            // Show Category ?>
            <div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
               <div class="spacer">
                  <h2>
                     <a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
                     <?php echo $category->category_name ?>
                     <br />
                     <?php // if ($category->ids) {
                        echo $category->images[0]->displayMediaThumb("",false);
                     //} ?>
                     </a>
                  </h2>
               </div>
            </div>

Title: Re: Category Page Fields for Templating
Post by: ysdoar on September 11, 2012, 12:38:11 pm
How to display Additional Images in category view? i tried:

Code: [Select]
<?php if(!empty($product->images) && count($product->images)>1) { 
         foreach (
$product->images as $image) {
            echo 
$displayMediaThumb('class="product-image"',true,'class="modal"'); //'class="modal"'
         

}
?>

nothing.. please halp!

Title: Re: Category Page Fields for Templating
Post by: PRO on September 11, 2012, 14:41:17 pm
How to display Additional Images in category view? i tried:

Code: [Select]
<?php if(!empty($product->images) && count($product->images)>1) { 
         foreach (
$product->images as $image) {
            echo 
$displayMediaThumb('class="product-image"',true,'class="modal"'); //'class="modal"'
         

}
?>

nothing.. please halp!



I dont think you can,.
Title: Re: Category Page Fields for Templating
Post by: ysdoar on September 11, 2012, 16:09:51 pm
i tried to add Product custom_fields but nothing yet:

Code: [Select]
<?php // Product custom_fields
if (!empty($product->customfieldsCart)) {  ?>

<div class="product-fields">
<?php foreach ($product->customfieldsCart as $field) { ?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
<span class="product-fields-title" ><b><?php echo  JText::_($field->custom_title?></b></span>
<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-cat-desc"><?php echo $field->custom_field_desc ?></span>
</div><br/ >

<?php
?>

</div>
<?php ?>

what i need to change?
Title: Re: Category Page Fields for Templating
Post by: zorro lee on September 22, 2012, 14:26:58 pm
One thing where are all files which need to be modified to have my custom vm theme (template) I bought template from templatemonster and it has all modifications which I need, but when VM update is installed I lost all images and CSS. How to copy paste all CSS jQuery and all what that template is using. (Template is on vm 2.06 joomla 2.5.4. and works fine until is updated)
Title: Re: Category Page Fields for Templating
Post by: jenkinhill on September 28, 2012, 13:59:30 pm
The template probably uses overrides. These will be in joomla_root/templates/(your template)/html/com_virtuemart/

VirtueMart 2.0.6 to 2.0.10  layout changes are described in http://virtuemart.net/component/content/article/416  and also for people who prefer pictures, in com_virtuemart.2.0.8_layout_changes.zip  and  com_virtuemart.2.0.10_layout_changes.zip  which you can get from http://dev.virtuemart.net/projects/virtuemart/files


Your Joomla 2.5.4 version is insecure, suggest you update to Joomla 2.5.7
Title: Re: Category Page Fields for Templating
Post by: 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:

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
Title: Re: Category Page Fields for Templating
Post by: PRO 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


Title: Re: Category Page Fields for Templating
Post by: Kbroeren on September 29, 2012, 13:43:05 pm
Works perfect thank you !!
Title: Re: Category Page Fields for Templating
Post by: Galena 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!
Title: Re: Category Page Fields for Templating
Post by: 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?
Title: Re: Category Page Fields for Templating
Post by: PRO 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
Title: Re: Category Page Fields for Templating
Post by: locoman 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!
Title: Re: Category Page Fields for Templating
Post by: _stu 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!
Title: Re: Category Page Fields for Templating
Post by: sorema 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.
Title: Re: Category Page Fields for Templating
Post by: PRO 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
Title: Re: Category Page Fields for Templating
Post by: jaderotheram 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
Title: Re: Category Page Fields for Templating
Post by: sajtfokus 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?
Title: Re: Category Page Fields for Templating
Post by: PRO 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));
                  ?>
Title: Re: Category Page Fields for Templating
Post by: 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?
Title: Re: Category Page Fields for Templating
Post by: PRO 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
Title: Re: Category Page Fields for Templating
Post by: edirola on March 06, 2013, 15:39:34 pm
Tnaks PRO for comment. Like you said, I was trying to put it in wrong places
Title: Re: Category Page Fields for Templating
Post by: jey09 on March 27, 2013, 11:51:37 am
hi
I tried to put the complete short description, but I cant, i put: Short Description

 <?php echo $product->product_s_desc ?>

where before was
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>

but it still having the description with final "..." and stripping the text.

I use virtuemart 2.0.2 and joomla 2.5,
the php file that i'm modifing is \templates\ot_bicyclegreen\html\mod_virtuemart_product\default.php

what more can I do to see all the short description and manufacturer and product name in product list?

thanks
Title: Re: Category Page Fields for Templating
Post by: PRO on March 27, 2013, 12:31:00 pm
hi
I tried to put the complete short description, but I cant, i put: Short Description

 <?php echo $product->product_s_desc ?>

where before was
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>

but it still having the description with final "..." and stripping the text.

I use virtuemart 2.0.2 and joomla 2.5,
the php file that i'm modifing is \templates\ot_bicyclegreen\html\mod_virtuemart_product\default.php

what more can I do to see all the short description and manufacturer and product name in product list?

thanks


thats the profuct MODULE, not the category.

short description is not available in the product module
Title: Re: Category Page Fields for Templating
Post by: jey09 on March 27, 2013, 12:50:25 pm
Sorry but I don't undestand what are you saying,
In my page when you click on a category, it displays a list of the products inside, this products in list, appears with only a photo and the short description (cut version) and the prize, but I want the whole description and the name, but it doesnt change

here a picture of it

[attachment cleanup by admin]
Title: Re: Category Page Fields for Templating
Post by: PRO on March 27, 2013, 14:48:07 pm
THIS
\templates\ot_bicyclegreen\html\mod_virtuemart_product\default.php

is the product module,

NOT the category page

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

YOU ARE EDITING THE WRONG FILE
Title: Re: Category Page Fields for Templating
Post by: jey09 on March 28, 2013, 09:43:45 am
Ok, Thanks! :)
Title: Re: Category Page Fields for Templating
Post by: Ninjab on April 28, 2013, 13:14:36 pm
Hi, how do I call a products extra field in category view? My extra field is called Backup? I want to display my edit form type extra field that has html in it in my category view only as my product will not display this info.

Thanks.
Title: Re: Category Page Fields for Templating
Post by: PRO on April 28, 2013, 17:48:48 pm
Hi, how do I call a products extra field in category view? My extra field is called Backup? I want to display my edit form type extra field that has html in it in my category view only as my product will not display this info.

Thanks.

a custom field?
Title: Re: Category Page Fields for Templating
Post by: Ninjab on April 29, 2013, 09:49:40 am
Yes a custom field.....sorry.
Title: Re: Category Page Fields for Templating
Post by: PRO on April 30, 2013, 16:57:53 pm
Yes a custom field.....sorry.

I do not know of a way to do this

but, you can look here
http://forum.virtuemart.net/index.php?topic=100191.0

Title: Re: Category Page Fields for Templating
Post by: Ninjab on April 30, 2013, 22:41:08 pm
Thanks. ...I tried that but I will if I can't do the layout overrides method. .. Thanks mate.
Title: Re: Category Page Fields for Templating
Post by: StantonJBond on May 20, 2013, 20:30:51 pm
Please, what is the name of the webpage file these category page edits should be applied to and where in the HTML directory might it be found?
Title: Re: Category Page Fields for Templating
Post by: PRO on May 20, 2013, 22:50:43 pm
Please, what is the name of the webpage file these category page edits should be applied to and where in the HTML directory might it be found?

http://forum.virtuemart.net/index.php?topic=90935.0
Title: Re: Category Page Fields for Templating
Post by: metosas on November 19, 2013, 08:10:25 am
hi
I tried to put the complete short description, but I cant, i put: Short Description

 <?php echo $product->product_s_desc ?>

where before was
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>

but it still having the description with final "..." and stripping the text.

I use virtuemart 2.0.2 and joomla 2.5,
the php file that i'm modifing is \templates\ot_bicyclegreen\html\mod_virtuemart_product\default.php

what more can I do to see all the short description and manufacturer and product name in product list?

thanks


thats the profuct MODULE, not the category.

short description is not available in the product module


It is not clear for me how to add full product description in category page. I want to have short product description with limit words and after that i need to get full product description. Yagendoo is template name wich i use, i tried to add  <?php echo $product->product_desc ?>. but it is not working. please help.                                                                                       
Title: Re: Category Page Fields for Templating
Post by: Maxim Pishnyak on November 22, 2013, 20:12:30 pm
Don't violate Yagendo copyright.

Why you don't use such simple construction like this
 <?php echo $product->product_desc ?>
?
Title: Re: Category Page Fields for Templating
Post by: Piombo on December 26, 2013, 10:35:51 am
Hello!

How can I get a direct url to thumb image in category page? (components\com_virtuemart\views\category\tmpl\default.php)

This code
Code: [Select]
<?php echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false); ?>creates an <img ... src="url to thumb image"...> tag.

I tried:

Code: [Select]

echo $product->category->images[0]->file_url_thumb;
or
echo $this->category->images[0]->file_url_thumb;
or
echo $this->product->file_url_thumb
or
echo $this->product->images[0]->file_url_thumb;

and a few more options. dosent work :(


This code works in product pages.
Code: [Select]
<?php echo $this->product->images[0]->file_url_thumb?>

Please help!
Title: Re: Category Page Fields for Templating
Post by: PRO on December 29, 2013, 03:01:30 am
Hello!

How can I get a direct url to thumb image in category page? (components\com_virtuemart\views\category\tmpl\default.php)

This code
Code: [Select]
<?php echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false); ?>creates an <img ... src="url to thumb image"...> tag.

I tried:

Code: [Select]

echo $product->category->images[0]->file_url_thumb;
or
echo $this->category->images[0]->file_url_thumb;
or
echo $this->product->file_url_thumb
or
echo $this->product->images[0]->file_url_thumb;

and a few more options. dosent work :(


This code works in product pages.
Code: [Select]
<?php echo $this->product->images[0]->file_url_thumb?>

Please help!

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

$this-> does not work for products in a category

$product
Title: Re: Category Page Fields for Templating
Post by: Piombo on December 30, 2013, 09:51:04 am
Thanks a lot!

This code is correct

Code: [Select]
<?php echo $product->images[0]->file_url_thumb?>
Title: Re: Category Page Fields for Templating
Post by: DOall on January 05, 2014, 16:21:59 pm
I would like to add the stock quantity at my page only for register users.
The code <?php echo $this->product->product_in_stock ?> works fine but i only want to show this function to register users. which code i need to add?

thanks in advance
Title: Re: Category Page Fields for Templating
Post by: jenkinhill on January 05, 2014, 17:17:11 pm
Use JFactory/getUser

See http://bit.ly/Ktnw5j
Title: Re: Category Page Fields for Templating
Post by: DOall on January 05, 2014, 22:23:19 pm
Thanks for the help but i can't use that function correctly.

<?php
$user =& JFactory::getUser();
if( $user->shopper ) {
echo $this->product->product_in_stock
}
else{
echo 'Login in please'
}
<?php endif; ?>

what i'm missing?

PS: I have no knowledge of php


Thanks in advance
Title: Re: Category Page Fields for Templating
Post by: PRO on January 06, 2014, 01:00:19 am
if ($user->id)

or

($user->id !=0 )
Title: Re: Category Page Fields for Templating
Post by: lupinlady on February 20, 2014, 02:14:03 am
Im trying to get the customfields area on to the category page. The Add to Cart button was already there, came with the template. Im new to php.


I edited /hot_watches/html/com_virtuemart/category/default.php  Since the 'Add to Cart' button was hard coded in I copied the code from /components/com_virtuemart/views/productdetails/tmpl/default_customfields.php and added it above the cart button.

First I added the 'custom fields position above the 'product fields' but it didnt work so I moved it below, still not working. Then changed$this->product to $product and I also removed the part -- echo $this->loadTemplate ('customfields' ); -- since the template is already there.

Ive also added default_customfields.php to the category folder renamed as default_customfields_category.php and tried an include per some of the suggestions on this site.

Not sure what else to try. Any help would be great.

The code I tried first is below:

// Show Products
   ?>
   <div class="product floatleft<?php echo $Browsecellwidth . $show_vertical_separator ?>">
   <div class="spacer">

   <div class="product_intro">

   <h3 style="float:left;"><a href="javascript:;">
   <?php // Product Name
      echo $product->product_name; ?>
      </a></h3>
      <div style="float:right;" class="rotated_image">
      <a title="<?php echo $product->link ?>" rel="vm-additional-images" href="<?php echo $product->link; ?>">
   <?php
      echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false);
   ?>
   </a>
   </div>
   <div class="clr"></div>
   </div>

   <div class="product_details_box">
               
   <div class="normal_image">
   <?php if ($product->images) {
   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="featuredProductImage" border="0"',false,'class="modal"' ) );
   } ?>
   </div>
                   
   <div class="product_details_box2">
   <div class="product_details_box3">
   <?php // Product Short Description
   if (!empty($product->product_desc)) {
   ?>
   <p class="product_s_desc">
      <?php echo shopFunctionsF::limitStringByWord ($product->product_desc, 1000, '...') ?>
   </p>
   <?php } ?>
                               
<!-- I copied the 'product fields' from /components/com_virtuemart/views/productdetails/tmpl/default_customfields.php and placed it here -->                           
                                                               
   <div class="product-fields">
      <?php
        $custom_title = null;
        foreach ($product->customfieldsSorted[$this->position] as $field) {
        if ( $field->is_hidden ) //OSP http://forum.virtuemart.net/index.php?topic=99320.0
        continue;
        if ($field->display) {
      ?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
      <?php if ($field->custom_title != $custom_title && $field->show_title) { ?>
      <span class="product-fields-title" ><?php echo JText::_($field->custom_title); ?></span>
      <?php
        if ($field->custom_tip)
        echo JHTML::tooltip($field->custom_tip, JText::_($field->custom_title), 'tooltip.png');
        }
        ?>
          <span class="product-field-display"><?php echo $field->display ?></span>
          <span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
        </div>
      <?php
        $custom_title = $field->custom_title;
         }
          }
      ?>
      </div>
<!-- I copied the 'custom fields position' from /templates/hot_watches/html/com_virtuemart/productdetails/default.php --->           
      <div>
        <?php
      if (!empty($product->customfieldsSorted['normal'])) {
      $this->position = 'normal';
       }
    ?>
     </div>
   <div style="padding:20px 0;">   
   <form method="post" class="product" action="index.php" id="addtocartproduct<?php echo $product->virtuemart_product_id ?>">
   <div class="addtocart-bar">

   <?php // Display the quantity box ?>
   <!-- <label for="quantity<?php echo $this->product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
   <span class="quantity-box">
   <input  type="text" class="quantity-input" name="quantity[]" value="1" />
   </span>
   <span class="quantity-controls">
   <input type="button" class="quantity-controls quantity-plus" />
   <input type="button" class="quantity-controls quantity-minus" />
   </span>
   <?php // Display the quantity box END ?>

   <?php // Add the button
      $button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO');
      $button_cls = ''; //$button_cls = 'addtocart_button';
      if (VmConfig::get('check_stock') == '1' && !$this->product->product_in_stock) {
      $button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY');
      $button_cls = 'notify-button';
   } ?>

   <?php // Display the add to cart button ?>
      <span class="addtocart-button">
      <input type="submit" name="addtocart"  class="addtocart-button" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
      </span>
Title: Re: Category Page Fields for Templating
Post by: csg22 on November 07, 2014, 10:58:31 am
The problem is in virtuemart 2.6.6, if you use URL in product information &this->product->product_url, the $this->product->virtuemart_category_id will be replaced with the product url :)))
Try it: <?php echo $this->product->virtuemart_category_id; ?> As a result I see my referral link :D
Title: Re: Category Page Fields for Templating
Post by: Troels_E on April 16, 2015, 20:49:21 pm
Thanks a lot for the very very helpful posts about Product and Category pages. From a non developer perspective who hasn't got a clue regarding PHP these are truly great as it helped me comment out certain parts and pasting code needed.
Without these forums and a helpful community I'd be lost in VM/Joomla and stuck with a webshop based on Bricksite or the like (and this is much more fun!!)
Title: Re: Category Page Fields for Templating
Post by: aminweb on July 20, 2016, 08:08:58 am
this code :
Code: [Select]
<div class="img-wrapper">
                                   <?php
                                            $image 
$product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImageFirst" id="Img_to_Js_'.$product->virtuemart_product_id.'" border="0"',false) ;
if(!empty($product->images[1])){
 $image2 $product->images[1]->displayMediaThumb('class="browseProductImage featuredProductImageSecond"  border="0"',false) ;
} else {$image2$product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImageSecond"  border="0"',false) ;}
                                            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),'<div class="front">'.$image.'</div><div class="back">'.$image2.'</div>');
                                    
?>

                                    </div>
                                   

output code :
Code: [Select]
<div class="img-wrapper">
    <a href="link to product">
     <div class="front">
             <img product >
         </div>
         <div class="back">
             <img product >
         </div>
    </a>                             
 </div>

Now,I want add class to  <a href="libk to product">
how do it?
please help me
thanks
Title: Re: Category Page Fields for Templating
Post by: PRO on July 20, 2016, 13:25:34 pm
you can do it with css, without changing the html

.img-wrapper a{}
Title: Re: Category Page Fields for Templating
Post by: aminweb on July 20, 2016, 14:58:02 pm
no, I dont want use css...
I want only add class for <a href .....
please help
Title: Re: Category Page Fields for Templating
Post by: PRO on July 20, 2016, 20:12:41 pm
I prefer to not have the class in the html,

BECAUSE

say for example on the category page, you have 100 products

and the class name is 5 characters.

THAT MAKES THE HTML DOCUMENT 500 CHARACTERS LONGER, and has to be parsed
Less html, means faster site.

but try this

 <div class="img-wrapper">
                                   <?php
                                            $image = $product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImageFirst" id="Img_to_Js_'.$product->virtuemart_product_id.'" border="0"',false) ;
                                 if(!empty($product->images[1])){
                                  $image2 = $product->images[1]->displayMediaThumb('class="browseProductImage featuredProductImageSecond"  border="0"',false) ;
                                 } else {$image2= $product->images[0]->displayMediaThumb('class="browseProductImage featuredProductImageSecond"  border="0"',false) ;}
                                            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),'<div class="front">'.$image.'</div><div class="back">'.$image2.'</div>','class="my-class"');
                                    ?>
                                    </div>

just change   my-class