VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Nalle on June 04, 2012, 12:11:28 PM

Title: SKU
Post by: Nalle on June 04, 2012, 12:11:28 PM
Hello
please tell me how i can get sku to show in virtuemart 2 i been trying for along time and nothing will get it to show
desprate for help!

cheers!
Title: Re: SKU
Post by: John2400 on June 04, 2012, 13:41:39 PM
I'm sure other will have a a better answer but I saw this post

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

http://forum.virtuemart.net/index.php?topic=97744.msg323841;topicseen#msg323841
Title: Re: SKU
Post by: Nalle on June 04, 2012, 16:10:25 PM
thanks for your reply
i have read those threads but i still dont get it to work

i copyeddefault_customfields.php  to  templets/mytemple/html/com_virtuemart/productdetails/

and i added the code
<?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 ) ); ?>

but i pretty sure i dont put it where its supposed tobe...

Title: Re: SKU
Post by: gldproducts on June 04, 2012, 17:26:08 PM
I would like to know this as well. Trying to get SKU to display on product detail page..  ;)
Title: Re: SKU
Post by: Nalle on June 04, 2012, 18:15:46 PM
good to know im not alone lol

wierd i cant get the SKU to show but its show the images names.....
under each product image there is the file name of the image haha like this  4d5e4ce70a980.jpg
Title: Re: SKU
Post by: gldproducts on June 04, 2012, 20:02:28 PM
Nalle,

can you provide your URL?

Also, what file in VirtueMart did you edit?
Title: Re: SKU
Post by: Nalle on June 05, 2012, 14:13:24 PM
default_customfields.php is the last one i tested to add the line in...
Title: Re: SKU
Post by: ren3784 on June 05, 2012, 17:20:51 PM
I went around it, because I do not know how to use the custom fields either

Go to components/com_virtuemart/views/productdetails/tmpl/default.php and open it with Dreamweaver, preferrably, or some type of color-coded HTML/PHP editor so you can find it easier.

Find this code for the manufacturers link:


<?php
// Manufacturer of the Product
if (VmConfig::get('show_manufacturers'1) && !empty($this->product->virtuemart_manufacturer_id)) {
    echo $this->loadTemplate('manufacturer');
}
?>



I placed this code:



<!-- SKU Number -->
        <div class="skuNumber"><br />
<?php echo JText::_('COM_VIRTUEMART_CART_SKU'?>: <?php echo $this->product->product_sku?>
        </div>


Be careful when messing around in these .php files, especially this one! This is your product details page. Hope this helps! I also hope there's an easier way.
Title: Re: SKU
Post by: Nalle on June 06, 2012, 15:12:00 PM
Great thanks ALOT! :)
now i just got figureout why i cant search on a sku id and get a hit too lol :)
Title: Re: SKU
Post by: ren3784 on June 08, 2012, 17:18:08 PM
Yes, but remember this is a workaround... someone reminded me that if you update Virtuemart, this addition may go away, so at least keep this SKU code on hand to drop it in again. Or keep searching for a better solution :)
Title: Re: SKU
Post by: jenkinhill on June 08, 2012, 18:09:41 PM
You should use template overrides to avoid having to repeat edits = http://forum.virtuemart.net/index.php?topic=90935.0