Post by grgr » Tue Jul 19, 2011 4:36 pm

This is a related product module that can be displayed in the side column (or content top and bottom if you wanted).

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.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by jomeza001 » Sun Aug 14, 2011 3:37 am

New files or some files re modified?? If so which are thos modified files?

Can't wait to use this mod!!

User avatar
Active Member

Posts

Joined
Tue May 17, 2011 10:55 am

Post by grgr » Sun Aug 14, 2011 4:40 am

None. Just upload and go.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by webpie it. » Sun Aug 14, 2011 4:51 am

Just curious is there any chance you could make it 1.5.0.5 compatiable.

If not no worries, just being cheeky, sorry hate to ask!

Great contribution!

Regards

Chris


Active Member

Posts

Joined
Mon Jan 31, 2011 7:28 pm

Post by grgr » Thu Aug 18, 2011 1:50 pm

I am a little busy at the moment so not very likely.

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!

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by klessk » Sun Apr 22, 2012 9:11 am

Hi, thanks for the extension is very usefull. How can i translate the "Related" Title? Thankx for your help

Newbie

Posts

Joined
Sun Apr 22, 2012 9:10 am

Post by grgr » Sun Apr 22, 2012 7:46 pm

Either edit ../catalog/language/english/module/related.php

Or copy the file to ../catalog/language/YOUR LANGUAGE/module/

and then translate it.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by rupaknepali » Mon Apr 23, 2012 2:58 pm

thanking you for this module

Rupak Nepali
webocreation.com@gmail.com
http://webocreation.com
Enjoy! Tips and tricks as well as free module.


Active Member

Posts

Joined
Mon Apr 25, 2011 7:04 pm

Post by sergiensergien » Thu May 10, 2012 2:55 am

Hi,

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.
In both cases, the results are checked for not having duplicates with the main content of the page.

It's only needed to modify the file:

Code: Select all

catalog/controller/module/related.php
I've just replace the line:

Code: Select all

 
               $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
with

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);
and before the end:

Code: Select all

}
?>
I've just added this function:

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;
        }
The $data variable can be easily set to order the products as needed (bestsellers, price-related, ...).

I hope this helps somebody!

Best regards,
Sergien


Posts

Joined
Mon Mar 19, 2012 6:57 pm

Post by cmonk » Fri May 18, 2012 5:45 am

just what i needed for the product page. however, now that i have this, how do i remove the tab from the product page?

Please go easy on me newbie : )

Thanks!

Newbie

Posts

Joined
Fri May 11, 2012 3:33 am

Post by copy » Mon Oct 22, 2012 10:38 pm

Hi all,

Someone please tell me what changes I have to do to make this module is compatible with version 1.5.0

try to install it but I get an error mysql_real_escape_string ()

Thanks a Greeting

New member

Posts

Joined
Mon May 14, 2012 10:57 pm

Post by wysocki » Wed Apr 03, 2013 11:00 am

I added the module (WHEW!) which I feel is pretty good for a newb! I'd like to put this on my checkout page so as someone is checking their cart they have one more prompt to buy something else too. However in the settings under the Layout column, I only had Homepage, Category Page, and StoreDefault so I added Checkout then added related products to some of my items. Is there any way to get this to appear on the checkout page? Or should I just crawl back to my cave?

Newbie

Posts

Joined
Tue Mar 26, 2013 7:49 am
Location - Los Angeles area

Post by i2Paq » Thu Apr 04, 2013 2:30 am

Never distract a customer on checkout!

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.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by grgr » Thu Apr 04, 2013 4:56 am

This won't work on any other page than a product page.

There are some extensions that will work on the checkout pages, but I equally agree that you don't want to do it.

-
Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK
Who is online

Users browsing this forum: No registered users and 3 guests