Hello, i added in my template override the code <?php echo $product->product_sku ?>
in category view of products and the <?php echo $this->product->product_sku ?>
in product details. How can i add in these codes also and the language text of Sku Product?
I use joomla 3.9.24 Virtuemart 3.8.6 10373 and php 7.3.26 .
Search the JOOMLA language override manager and You WILL find the keys to use. Search for SKU in language keys.
Jörgen @ Kreativ Fotografi
Yes but where i must put the COM_VIRTUEMART_PRODUCT_SKU in the code ?
I found the solution for product details here https://forum.virtuemart.net/index.php?topic=129510.msg445722#msg445722
But for products in category it is not work.
If You refer to this line of code:
<?php echo '<span class="bold">'.JText::_("COM_VIRTUEMART_PRODUCT_SKU").'</span> : '.$this->product->product_sku; ?>
Add only the jText part :)
Presenting the SKU you say you already have figured out.
Jörgen
This line is for in product details as <?php echo $this->product->product_sku ?>
is work there but in category this is give error.
For category products this line <?php echo $product->product_sku ?>
works but i am not able to use correctly the '<span class="bold">'.JText::_("COM_VIRTUEMART_PRODUCT_SKU").'</span>
there
You have to brush up your php skills. If in HTML mode then add <?php ...... ?> and echo the function result.
Please read what echo does in PHP.net
https://www.php.net/manual/en/function.echo.php (https://www.php.net/manual/en/function.echo.php)
This is actually a PHP question nothing with JOOMLA or VM to do.
Jörgen
ribo in product details view
<?php echo '<span class="bold">'.JText::_("COM_VIRTUEMART_PRODUCT_SKU").'</span> : '.$this->product->product_sku; ?>
In the category
<?php echo '<span class="bold">'.JText::_("COM_VIRTUEMART_PRODUCT_SKU").'</span> : '.$product->product_sku; ?>
The category use sublayouts and need to be in
/templates/YOURTEMPLATE/html/com_virtuemart/sublayouts/products.php
Original virtuemart file is
/components/com_virtuemart/sublayouts/products.php