News:

Support the VirtueMart project and become a member

Main Menu

SKU: product_sku in product details

Started by chrisrbk, April 18, 2015, 23:36:34 PM

Previous topic - Next topic

chrisrbk

Hi everyone,

I'm using Joomla 3.3.6 and Virtuemart 3.0.6.2 and PHP 5.5.22.
After reading a lot of forums (in this forum too) I tried this change in all the ways I could, but they doesn't work for me.

I tried the following codes:

   <?php
   
if( !empty( $products_sku )) { ?>

   Product SKU:<?php echo $products_sku ?>


   <div class="product-sku">
   <?php echo JText::('COM_VIRTUEMART_PRODUCT_SKU'); ?> :
   <?php echo $this->product->product_sku?>
   <>

   
   <?php //Modifica Prodotto SKU
    
if($product->product_sku) echo JText::'COM_VIRTUEMART_PRODUCT_SKU' ).": ".$product->product_sku;
   
?>
   
   
     
   <?php
   
// Product SKU
   
echo $this->product->product_sku
   ?>
   


I used them as an override: mydomain/html/com_virtuemart/productdetails
and I used them in the original file: mydomain/components/com_virtuemart/views/productdetails

But nothing is changing in my product pages.
Please, could you help me and show me where I'm wrong?

A product page of my test site here http://www.easylabs.it/test/en/negozio/giochi-adattati/pesciolino-freddie-bolle-di-sapone-detail

Thank you for your help,
chrisrbk

GJC Web Design

correct is

<?php echo '<span class="bold">'.JText::_("COM_VIRTUEMART_PRODUCT_SKU").'</span> : '.$this->product->product_sku; ?>

if nothing is showing are u even sure your over ride is working?

add

<!--MY proddetails over ride-->

in the over ride html

check the source to make sure it's there
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

chrisrbk

Thank you so much GJC,

your code is perfect and I finally found that my template already had all php files overridden in "my_domain/templates/my_template/html/com-virtuemart" folder.
And now it works fine!

Please, could I also ask you how should I change the code below (part of productdetails deafult.php) if I would like to have Base price in first position in place of Sales Price?
Or should I open a new post?

<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
<?php
if ($this->product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) {
$askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component', FALSE);
?>

<a class="ask-a-question bold" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::('COM_VIRTUEMART_PRODUCT_ASKPRICE'?></a>
<?php
} else {
echo $this->currency->createPriceDiv ('salesPrice''COM_VIRTUEMART_PRODUCT_SALESPRICE'$this->product->prices);
if ($this->product->prices['discountedPriceWithoutTax'] != $this->product->prices['priceWithoutTax']) {
echo $this->currency->createPriceDiv ('discountedPriceWithoutTax''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX'$this->product->prices);
} else {
echo $this->currency->createPriceDiv ('priceWithoutTax''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX'$this->product->prices);
}

echo $this->currency->createPriceDiv ('basePrice''COM_VIRTUEMART_PRODUCT_BASEPRICE'$this->product->prices);
echo $this->currency->createPriceDiv ('basePriceVariant''COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT'$this->product->prices);
echo $this->currency->createPriceDiv ('variantModification''COM_VIRTUEMART_PRODUCT_VARIANT_MOD'$this->product->prices);

if (round($this->product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' $this->currency->createPriceDiv ('basePriceWithTax''COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX'$this->product->prices) . "</span>";
}
if (round($this->product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $this->product->prices['salesPrice']) {
echo $this->currency->createPriceDiv ('salesPriceWithDiscount''COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT'$this->product->prices);
}
echo $this->currency->createPriceDiv ('discountAmount''COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT'$this->product->prices);
echo $this->currency->createPriceDiv ('taxAmount''COM_VIRTUEMART_PRODUCT_TAX_AMOUNT'$this->product->prices);
$unitPriceDescription vmText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE'vmText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
echo $this->currency->createPriceDiv ('unitPrice'$unitPriceDescription$this->product->prices);
}
?>

</div>


Thank you for your previous help and in case you could help me for this issue.
Best,
chrisrbk

GJC Web Design

just move

echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices);

to after

}else{
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation