Post by mikeytrw » Wed Oct 29, 2008 11:38 pm

Hi All,

This is an update of the related products contrib from jarek from http://forum.opencart.com/index.php/topic,1244.0.html this thread, to work with openCart 0.7.9-RC3.

Ive also added images with related products.

Thanks

Mike

Attachments


New member

Posts

Joined
Tue May 27, 2008 9:28 pm

Post by ambassador » Tue Dec 09, 2008 10:04 am

Notice: Undefined index: min_qty in /home/ambassad/public_html/store/opencart/catalog/controller/product.php on line 92
I receive that error at the top of the page of items with related products once all updated are made

any suggestions?

afc@ambassadorfamily.com
Last edited by ambassador on Tue Dec 09, 2008 10:07 am, edited 1 time in total.

Newbie

Posts

Joined
Tue Oct 21, 2008 6:06 am

Post by Qphoria » Tue Dec 09, 2008 12:22 pm

Well it looks like the updated version wasn't quite complete.

Try this one. It is up to date to the latest SVN version right now:
Last edited by Qphoria on Mon Jan 05, 2009 8:07 pm, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ambassador » Wed Dec 10, 2008 12:57 am

Fatal error: Call to undefined method Request::gethtml() in /home/ambassad/public_html/store/opencart/catalog/controller/product.php on line 27
============here is line 27 ============
$product_info = $database->getRow("select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where p.product_id = '" . (int)$request->gethtml('product_id') . "' and pd.language_id = '" . (int)$language->getId() . "' and p.date_available < now() and p.status = '1'");

Newbie

Posts

Joined
Tue Oct 21, 2008 6:06 am

Post by Qphoria » Wed Dec 10, 2008 1:03 am

You need to upgrade to the latest version of opencart. You have 0.7.8. You need 0.7.9

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by bthirsk » Mon Dec 29, 2008 12:16 am

In admin/controller/product.php  in function getform,
Do we need to change the get to gethtml.  ??

        // Related products

    $related_data = array();
 
    $results = $database->getRows("select p.product_id, pd.name from product p left join product_description pd on (p.product_id = pd.product_id) where pd.language_id = '" . (int)$language->getId() . "'");

    foreach ($results as $result) {
if (($request->get('product_id')) && (!$request->isPost())) {
  $related_info = $database->getRow("select * from related_products where product_id = '" . (int)$request->get('product_id') . "' and related_product_id = '" . (int)$result['product_id'] . "'");
}
     
$related_data[] = array(
        'product_id' => $result['product_id'],
        'name'        => $result['name'],
'related' => (isset($related_info) ? $related_info : in_array($result['product_id'], $request->get('related', 'post', array()))));
    }

    $view->set('related', $related_data);

        // End related products

Brent


Active Member

Posts

Joined
Wed Sep 03, 2008 11:33 am
Location - Canada

Post by Qphoria » Mon Dec 29, 2008 12:18 am

Probably should.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by bthirsk » Mon Jan 05, 2009 12:29 am

Related Products 7.9-RC5
admin/controller/product.php

function delete()
if (($request->gethtml('product_id')) && ($this->validateDelete())) {

You need to add the following for product deletes

$database->query("delete from related_products where product_id = '" . (int)$request->gethtml('product_id') . "'");  //  Related Products

Brent


Active Member

Posts

Joined
Wed Sep 03, 2008 11:33 am
Location - Canada

Post by hm2k » Mon Jan 05, 2009 1:10 am

bthirsk wrote: In admin/controller/product.php  in function getform,
Do we need to change the get to gethtml.  ??

        // Related products

    $related_data = array();
   
    $results = $database->getRows("select p.product_id, pd.name from product p left join product_description pd on (p.product_id = pd.product_id) where pd.language_id = '" . (int)$language->getId() . "'");

    foreach ($results as $result) {
if (($request->get('product_id')) && (!$request->isPost())) {
  $related_info = $database->getRow("select * from related_products where product_id = '" . (int)$request->get('product_id') . "' and related_product_id = '" . (int)$result['product_id'] . "'");
}
     
$related_data[] = array(
        'product_id' => $result['product_id'],
        'name'        => $result['name'],
'related' => (isset($related_info) ? $related_info : in_array($result['product_id'], $request->get('related', 'post', array()))));
    }

    $view->set('related', $related_data);

        // End related products
First and second don't need to be as they aren't actually being used, just checked, third probably should be, but it's not that important as it's part of the admin area.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by bthirsk » Tue Jan 20, 2009 9:57 pm

This is a remake of Related Products for 7.9 RC6.

It is a stand alone module similar to Latest/Featured/Specials.
It is designed as a companion to be used with Latest/Featured/Specials.
It does require LFS contribution to be installed first.

What it does:
It will allow displaying Related products where ever you desire on the products page.
It allows including Specials on the product page, in a third colum or under the current
product, where specials are replaced by related products it 'related' is set for the
current product.
Total number of related products to display is set in admin.
If the number of related products of the current PRODUCT exceeds the number to display,
related products are randomly chosen.

The readme file in the attached zip further explains features.

Attachments


Brent


Active Member

Posts

Joined
Wed Sep 03, 2008 11:33 am
Location - Canada

Post by Qphoria » Tue Jan 20, 2009 10:27 pm

bthirsk wrote: It is a stand alone module similar to Latest/Featured/Specials.
It is designed as a companion to be used with Latest/Featured/Specials.
It does require LFS contribution to be installed first.
Kind of an oxymoron ey?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by bthirsk » Tue Jan 20, 2009 11:08 pm

I am referring to the catalog output.
the controller file is module/related.php and the template is module/related.tpl
They are separate files not embedded in the product.php which facilitates the features above.

Brent


Active Member

Posts

Joined
Wed Sep 03, 2008 11:33 am
Location - Canada

Post by ambassador » Thu Jan 22, 2009 7:44 am

attempted to install the LFS Contribution
uploaded all the files - ok
ran the myPHP to add sql - ok
can see the modules in the admin page - ok
cannot add the module by pressing "+" key - Not OK

Permission Denied!
You do not have permission to access this page, please refer to your system administrator.

any suggestions

Newbie

Posts

Joined
Tue Oct 21, 2008 6:06 am

Post by ambassador » Thu Jan 22, 2009 8:17 am

after installing the module and sql i was unable to install the module from the admin page
i received an error
Permission Denied!
You do not have permission to access this page, please refer to your system administrator.
solution:

go to Admin -> Configuration -> users -> user groups

and enable permission for the new modules installed

then go back and configure them

Newbie

Posts

Joined
Tue Oct 21, 2008 6:06 am
Who is online

Users browsing this forum: No registered users and 6 guests