News:

Looking for documentation? Take a look on our wiki

Main Menu

SKU

Started by Nalle, June 04, 2012, 12:11:28 PM

Previous topic - Next topic

Nalle

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!

John2400


Nalle

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


gldproducts

I would like to know this as well. Trying to get SKU to display on product detail page..  ;)

Nalle

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

gldproducts

Nalle,

can you provide your URL?

Also, what file in VirtueMart did you edit?

Nalle

default_customfields.php is the last one i tested to add the line in...

ren3784

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.
Renee Heyward
Developerz Block
http://developerzblock.com

Nalle

Great thanks ALOT! :)
now i just got figureout why i cant search on a sku id and get a hit too lol :)

ren3784

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 :)
Renee Heyward
Developerz Block
http://developerzblock.com

jenkinhill

You should use template overrides to avoid having to repeat edits = http://forum.virtuemart.net/index.php?topic=90935.0
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum