News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Add SKU to product category

Started by earthrat, March 22, 2012, 02:48:57 AM

Previous topic - Next topic

earthrat

I found the field (I think) to add the SKU to the product category:

<?php echo $this->product->product_sku ?>

I have tried to add it to a few different locations in the com_virtuemart/category/tmpl/default.php file but I cannot get it to show up. Am I looking in the right file to add this functionality?

earthrat

#1
I found this code in another post and it works but it does not show the name only the SKU. Also it creates a link from the code and I just want it to display.

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

Where in this code do I place the title name that will display on the product category page?

PRO

earthrat,

$this->

refers to the CURRENT object. AS IN whats in the URL. SO, when you are on the category page , and you use $this-> ITS ONLY going to call information about the current category.

$this->   ON THE product page, calls product variables,


so, on the category page, calling product variables is like this
$product->

Here is what You want
<?php echo $product->product_sku ?>

THEN:
read these two threads, or atleast use them next time
http://forum.virtuemart.net/index.php?topic=97744.0
http://forum.virtuemart.net/index.php?topic=92756.0

earthrat

#3
Thanks Banquet,

I am used to looking in documents for help files like this and not having to search and wade through the forum, sifting through comment after comment to find these useful pages. A forum should be used to ask questions for things they cannot find in the documents, not the catch all support system. Granted this is at the top of this category, but it does not come up on top when searching and is why I did not catch it. Creating an actual wiki or document system would be much more helpful than this forum which does not even have a way for me to follow a topic and I have to either leave the window open or waste time searching posts to find it (Not to mention the search feature royally sucks!). I know this forum has such a feature, why is it disabled? NM don't answer that because I probably won't return here, but this forum feature would be extremely handy and since 2.0 is out and there is still no help documents that would really help to have this ability. Seems to me as much complaining as the support staff does here about repeat questions that have been answered elsewhere they would have figured out that just maybe it is not all the posters fault that they cannot find the answer to their problem.