It shows the same related products that appear in the tabs on the product info page but makes them more obvious by allowing them to be displayed in the side column - this is beneficial I think for site 'browsers' rather than those there to purchase. It can also be limited to x number of products.
If anyone else can make use of it then feel free: http://www.opencart.com/index.php?route ... on_id=2649
Simply upload and go.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
If not no worries, just being cheeky, sorry hate to ask!
Great contribution!
Regards
Chris
I did think that most people would have upgraded to 1.5.1 which is why I didn't bother doing it at the time, if I get chance I'll have a go at it but don't be holding you breath!
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
Or copy the file to ../catalog/language/YOUR LANGUAGE/module/
and then translate it.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
Rupak Nepali
webocreation.com@gmail.com
http://webocreation.com
Enjoy! Tips and tricks as well as free module.
First of all .. thank you for this module!
I've make a minor modification in order to have:
- Related products to a Category, when the module is used on a Category listing.
- Related products to the contents of the Cart, when the module is used in the Cart view at the checkout.
It's only needed to modify the file:
Code: Select all
catalog/controller/module/related.php
Code: Select all
$results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
Code: Select all
$results = array();
if (isset($this->request->get['product_id'])) {
$results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
} elseif (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
$category_id = array_pop($parts);
$data = array(
'filter_category_id' => $category_id,
'sort' => '',
'order' => '',
'start' => '',
'limit' => ''
);
$products = $this->model_catalog_product->getProducts($data);
foreach ($products as $product) {
$results += $this->model_catalog_product->getProductRelated($product['product_id']);
}
$results = $this->arr_diff($results, $products);
} elseif ($this->cart->hasProducts()) {
$products = $this->cart->getProducts();
foreach ($products as $product) {
$results += $this->model_catalog_product->getProductRelated($product['product_id']);
}
$results = $this->arr_diff($results, $products);
}
$results = array_unique($results, SORT_REGULAR);
Code: Select all
}
?>
Code: Select all
private function arr_diff($array1, $array2){
$diff = array();
foreach($array1 as $key => $value){
// unset($jocker);
$jocker = '';
if (is_int($key)){
// Compare values
if (array_search($value, $array2) === false)
$jocker = $value;
else if(is_array($value))
$jocker = $this->arr_diff($value, $array2[$key]);
if ($jocker)
$diff[] = $jocker;
} else {
// Compare noninteger keys
if(!$array2[$key])
$jocker = $value;
else if(is_array($value))
$jocker = $this->arr_diff($value, $array2[$key]);
if ($jocker)
$diff[$key] = $jocker;
}
}
return $diff;
}
I hope this helps somebody!
Best regards,
Sergien
Norman in 't Veldt
Moderator OpenCart Forums
_________________ READ and Search BEFORE POSTING _________________
Our FREE search: Find your answer FAST!.
[How to] BTW + Verzend + betaal setup.
There are some extensions that will work on the checkout pages, but I equally agree that you don't want to do it.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
Users browsing this forum: No registered users and 3 guests