VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: djanael on July 01, 2015, 22:22:08 PM

Title: RELATED PRODUCTS BY SKU
Post by: djanael on July 01, 2015, 22:22:08 PM
How to?

<?php if (JRequest::getVar('$this->product->virtuemart_product_sku')=='$THIS->product->virtuemart_product_sku') { ?>
<div id="productmod"><jdoc:include type="modules" name="productdetails" /></div>
<?php } ?>

=/ not show...
Title: Re: RELATED PRODUCTS BY SKU
Post by: PRO on July 02, 2015, 14:09:49 PM
please explain better what you want to do?


& what versions of vmart & joomla are you using?

Title: SOLVED: RELATED PRODUCTS BY SKU
Post by: djanael on July 02, 2015, 18:46:19 PM
vm3.0.9.4, joomla 3.4.3

I need to modify the module that lists the products so that list based on the product's SKU code


UPDATE


<?php
$productModel 
VmModel::getModel ('product');
$productModel->setId($this->product->virtuemart_product_id);
$uncatChildren $productModel->getUncategorizedChildren ($customfield->withParent);
$mediaModel VmModel::getModel ('Media');
if(
count($uncatChildren)>0) {
foreach ($uncatChildren as $child) {
$M_link JRoute::('index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' $this->product->virtuemart_category_id '&virtuemart_product_id=' $child['virtuemart_product_id'],FALSE);

//getFiles() SAYS is meant only for backend use but i couldnt find any other function.
$M_images $mediaModel->getFiles(truefalse$child['virtuemart_product_id']); 
$M_thumb $M_images[0]->file_url_thumb;
$M_full $M_images[0]->file_url;

if($M_thumb!='') {
$M_image $M_thumb;
} elseif($M_full!='') {
$M_image $M_full;
} else {
//Pull default image here
}
$f_img[] = '<div style="float:left;""><a href="'.$M_link.'" title="'.htmlentities($child['product_name']).'"><p>"'.htmlentities($child['product_name']).'"</p><p><img src="'.$M_image.'" style="height:60px;"></p></a></div>';
}

//handle html display here
foreach($f_img as $imgval){
echo $imgval;
}
}
?>


??? Sorry about that