Author Topic: SKU  (Read 14235 times)

Nalle

  • Beginner
  • *
  • Posts: 8
SKU
« 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!

John2400

  • Virtuemart - the Future is ever Changing
  • Global Moderator
  • Full Member
  • *
  • Posts: 1568
  • VirtueMart Version: Use VM3.6+
Re: SKU
« Reply #1 on: June 04, 2012, 13:41:39 pm »

Nalle

  • Beginner
  • *
  • Posts: 8
Re: SKU
« Reply #2 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...


gldproducts

  • Beginner
  • *
  • Posts: 40
Re: SKU
« Reply #3 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..  ;)

Nalle

  • Beginner
  • *
  • Posts: 8
Re: SKU
« Reply #4 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

gldproducts

  • Beginner
  • *
  • Posts: 40
Re: SKU
« Reply #5 on: June 04, 2012, 20:02:28 pm »
Nalle,

can you provide your URL?

Also, what file in VirtueMart did you edit?

Nalle

  • Beginner
  • *
  • Posts: 8
Re: SKU
« Reply #6 on: June 05, 2012, 14:13:24 pm »
default_customfields.php is the last one i tested to add the line in...

ren3784

  • Beginner
  • *
  • Posts: 29
Re: SKU
« Reply #7 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:

Code: [Select]
<?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:


Code: [Select]
<!-- 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

  • Beginner
  • *
  • Posts: 8
Re: SKU
« Reply #8 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 :)

ren3784

  • Beginner
  • *
  • Posts: 29
Re: SKU
« Reply #9 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 :)
Renee Heyward
Developerz Block
http://developerzblock.com

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27780
  • Always on vacation
    • Jenkin Hill Internet
Re: SKU
« Reply #10 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
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.8.4.10335 on Joomla 3.9.19 PHP 7.3.18