Testing with Joomla! 3.6.5 and Virtuemart 3.2.1:
Related products are shown below product. That's fine so far.
Trouble is:
- I can't get language override working to get rid of standard phrases.
- In related products it shows name of current product AND name of related product.
In image attached AMS 125 ELIXIR CR is current product. Other ones are related.
Any help appriciated. :D
Forgot to mention:
Names displayed are stored in image description / name and the like at each product.
Ok, had a little time to think about problem with names shown:
Virtuemart stores meta information related to product images in _virtuemart_medias.
In case a manufacturer provides one image for several products and you "forget" to generate a separate copy of the image for each product but enter correct description at product level things get messed up.
Must find files to override image_desc and the like in whole virtuemart for this...
Problem with overriding language persists.
btw: Situation with image descriptions might be a problem with international shops as well.
to hide current product in related products (or to give it a style etc.):
1. add a unique css-class to product-page in MY_TEMPLATE\html\com_virtuemart\productdetails\default.php on first div:
<div class="productdetails-view productdetails product-container my-unique-product-class-<?php echo $this->product->virtuemart_product_id ?>">
2. add unique css-classes to related-products in MY_TEMPLATE\html\com_virtuemart\sublayouts\related.php
and hide if match (customised related.php vm 3.0.18):
<?php defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();
$related = $viewData['related'];
$customfield = $viewData['customfield'];
$thumb = $viewData['thumb'];
$document->addStyleDeclaration('.my-unique-product-class-' . $related->virtuemart_product_id . ' .my-unique-related-product-class-' . $related->virtuemart_product_id . ' { display: none; }');
//juri::root() For whatever reason, we used this here, maybe it was for the mails
echo JHtml::link (JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $related->virtuemart_product_id . '&virtuemart_category_id=' . $related->virtuemart_category_id), $thumb . $related->product_name, array('class' => 'my-unique-related-product-class-' . $related->virtuemart_product_id,'title' => $related->product_name));
if($customfield->wPrice){
$currency = calculationHelper::getInstance()->_currencyDisplay;
echo $currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $related->prices);
}
if($customfield->wDescr){
echo '<p class="product_s_desc">'.$related->product_s_desc.'</p>';
}
gogo32, thank you very much.
Here is a proof of concept to show problem with international shops when product name has to be translated (no matter images are for one or multiple products):
update j25_virtuemart_medias
join j25_virtuemart_product_medias on j25_virtuemart_medias.virtuemart_media_id = j25_virtuemart_product_medias.virtuemart_media_id
join j25_virtuemart_products_de_de on j25_virtuemart_product_medias.virtuemart_product_id = j25_virtuemart_products_de_de.virtuemart_product_id
set j25_virtuemart_medias.file_title = j25_virtuemart_products_de_de.product_name,
j25_virtuemart_medias.file_meta = j25_virtuemart_products_de_de.product_name,
j25_virtuemart_medias.file_description = j25_virtuemart_products_de_de.product_name;
Switch to another language (not german) than.
please new topic per issue ;)
(and mark [SOLVED] if solved)