Jump to content
Skittles

Optional Related Products, Version 4.0

Recommended Posts

Never mind figured it out by moving the delete to only delete if the product categories ==0 like so:

 

if ($product_categories['total'] == '0') {
	    tep_remove_product($product_id);
   /* Optional Related Products (ORP) */
	  tep_db_query("delete from " . TABLE_PRODUCTS_RELATED_PRODUCTS . " where pop_products_id_master = '" . (int)$product_id . "'");
	  tep_db_query("delete from " . TABLE_PRODUCTS_RELATED_PRODUCTS . " where pop_products_id_slave = '" . (int)$product_id . "'");
    //ORP: end
	  }

Share this post


Link to post
Share on other sites

Hey guys; i installed the related products and it works just fine expect when I go to edit a product I get a break stating the following:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/savingsh/public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/savingsh/public_html/admin/includes/classes/object_info.php on line 18

 

 

Here is what it says in object_info.php:

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class objectInfo {

 

// class constructor

function objectInfo($object_array) {

reset($object_array);

while (list($key, $value) = each($object_array)) {

$this->$key = tep_db_prepare_input($value);

}

}

}

?>

 

Any ideas?

Share this post


Link to post
Share on other sites

Question. Is it possible to create some extra fields in Easy Populate so relations can be established by spreadsheet?

 

I have a large shop and it would seem easier to locate in excel and match the items. Or better yet match the products to all products in a certain category. I know that option was available in the other cross sell contributions for version 2.2. This is a great contribution and that's my idea for making it greater. If I was good at php I would attempt that feat myself.

 

Thanks for your time.

Share this post


Link to post
Share on other sites

Hi

 

I have added Optional related Products on my XAMPP server to a website I plan to upgrade. SO far so good. But I get to Catalog > related products and on the SQL database.

 

And Whether I press the New Install SQL for Version 4 or the Upgrade SQL to Version 4, I get the following error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 7

 

CREATE TABLE IF NOT EXISTS `products_related_products` ( `pop_id` int(11) NOT NULL auto_increment, `pop_products_id_master` int(11) NOT NULL default '0', `pop_products_id_slave` int(11) NOT NULL default '0', `pop_order_id` smallint(6) NOT NULL default '0', PRIMARY KEY (`pop_id`) ) TYPE=MyISAM;

 

[TEP STOP]

 

I tried creating the table in SQL, doing it from scratch using the existing one I have.

 

Please could someone shed some light?? unsure.png


Debbie Harrison

 

Share this post


Link to post
Share on other sites

I have managed to override the SQL issues by changing TYPE=MYISAM; to ENGINE=MyISAM; and that now works. Sadly the product pages do not show. This isn't a new install for me as I had ORP on the old 2.2 site.

 

Please help whats happening??


Debbie Harrison

 

Share this post


Link to post
Share on other sites

I have re-installed and the existing related products now tie up. However, I cannot view from Catalog > Related products, existing products and when I call an individual product, I don't get its record, I am asked to create a New one. Furthermore new ones do not show up.

 

I take it support has dried up on this once great contribution? Thats is a shame. :'(


Debbie Harrison

 

Share this post


Link to post
Share on other sites

Hi,

 

I've installed the contribution, but I cannot get it running. Everything in configuration is visible, no problem, but when I click catalogue>related products, I see this error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS' at line 8

 

SELECT pa.* FROM products_related_products pa LEFT JOIN products_description pd ON pa.pop_products_id_master = pd.products_id AND pd.language_id = '4' WHERE pd.products_id = '31' ORDER BY pd.products_name, pa.pop_order_id, pa.pop_id LIMIT 0, RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS

 

On the live website likewise:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RELATED_PRODUCTS_MAX_DISP' at line 14

 

SELECT pop_products_id_slave, products_name, products_model, products_price, products_quantity, products_tax_class_id, products_image FROM products_related_products, products_description pa, products pb WHERE pop_products_id_slave = pa.products_id AND pa.products_id = pb.products_id AND language_id = '4' AND pop_products_id_master = '31' AND products_status='1' ORDER BY rand() limit RELATED_PRODUCTS_MAX_DISP

 

 

In this thread, someone else had this problem, but didn't share the answer when fixed. Can anyone help me out? I have installed the osc 2.2 version.

 

Thank you!

 

Michiel

Share this post


Link to post
Share on other sites

Hello,

 

Sorry for my bad English.

 

I added the contribution "Related products" tailored to Cso 2.3.1

I have the admin configuration menu (Related products).

I have the category menu BOX_CATALOG_CATEGORIES_RELATED-PRODUCTS that installs configuration menu (Related products).

 

And now what do I do? I see nothing in the various menus (products, product attributes, etc.) for create relationships between products.

 

Can someone enlighten me please.

Share this post


Link to post
Share on other sites

For clarity, when I'm on a product, I should have a button "Add related products" next to the other buttons: "modify", "delete", "move" and "copy".

 

But i have an new button entitled him "IMAGE_RELATED_PRODUCTS" and when i clic he going to the screen Utility installation / uninstall SQL tables (HEADING_TITLE_ORP), whereas previously I installed the SQL.

 

Strange !

Share this post


Link to post
Share on other sites

Can anyone point me to what changes need making to get it to write the products_model in the db instead of the product_id ?

 

I can see its $products_id_master &$products_id_slave but cannot see where product_id is assigned to these ?

Share this post


Link to post
Share on other sites

Hi all, I have added this to my live site, but as you can see from http://www.kelscrafts.co.uk/product_info.php?products_id=858 The related products are nowhere to be seen.

 

I have gone through the changes and uploads with a fine tooth comb. Please could anyone help me please??

 

Also on the admin section, the page links do not work the url (eg page 15) appear but not the actual content of page 15.

 

Please can anyone advise? TIA


Debbie Harrison

 

Share this post


Link to post
Share on other sites

I was wondering if it there is a simple fix to output the related products into a carousel rather into a table?

 

Thanks in advance

Share this post


Link to post
Share on other sites

Hi all!!!

 

Great contribution, works fine but I have just one problem, hoping someone could help me to get it through.

 

I can't get appear the right price on products which have a special or discount price.

 

Same problem here :(

 

I just testing Xsell too... I found that this contrib (Related Products) is more flexible but...but... what about prices?

Xsell Displays Correctly...

Do u have a solution?

Share this post


Link to post
Share on other sites

Me too. Anyone knows if we can add related products into Easy Populate ?

 

Question. Is it possible to create some extra fields in Easy Populate so relations can be established by spreadsheet?

 

I have a large shop and it would seem easier to locate in excel and match the items. Or better yet match the products to all products in a certain category. I know that option was available in the other cross sell contributions for version 2.2. This is a great contribution and that's my idea for making it greater. If I was good at php I would attempt that feat myself.

 

Thanks for your time.

Share this post


Link to post
Share on other sites

I have installed Vers 4.0 of this contribution in an Oscommerce 2.3.3 shop. Everything works great except that related products are shown without being included in a box on product_info page. I did not expect the box being exactly like the 2.3.3 "also purshaced" box but I had expected some sort of box around the related products.

 

I suppose this has something to do with includes/modules/optional_related_products.php but I have just uploaded the included file.

 

Anyone has an idea what could be wrong?

Share this post


Link to post
Share on other sites

I have looked at the includes/modules/optional_related_products.php file and it does not contain code for info_box_content like it was used for 2.2 oscommerce or "div class="ui-widget infoBoxContainer" like it should be for 2.3.1.

 

Anyone has a proper optional_related_products.php that I can use to get the related products included in a box?

 

I use the latest Related Products Add-on http://addons.oscommerce.com/info/8057

Share this post


Link to post
Share on other sites

Hey guys!

 

Do you guys know of a feeder/module that will automatically cross-related products together with other products? I want it to automatically add 3+ products to the products, when one sells another gets replaced. Can this work? Please let me know.

Share this post


Link to post
Share on other sites

I know this addon is probably old and outdated since 2007, but I installed it and seems to be ok with adding new related products in admin. but not getting any hits on the database in the optional_related_products.php sql query. So the section does not show even though I know the database contains the corrected data. Below is the query.

$attributes = "

SELECT

pop_products_id_slave,

products_name,

products_model,

products_price,

products_quantity,

products_tax_class_id,

products_image

FROM " .

TABLE_PRODUCTS_RELATED_PRODUCTS . ", " .

TABLE_PRODUCTS_DESCRIPTION . " pd, ".

TABLE_PRODUCTS . " p

WHERE pop_products_id_slave = p.products_id

AND pd.products_id = p.products_id

AND language_id = '" . (int)$languages_id . "'

AND pop_products_id_master = '".$HTTP_GET_VARS['products_id']."'

AND products_status='1' " . $orderBy;

$attribute_query = tep_db_query($attributes);

if (tep_db_num_rows($attribute_query)>0) {

$count = 0;

?>

 

Thanks if anyone can help..

Share this post


Link to post
Share on other sites

Is this contribution osC 2.3.3 friendly?


- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Share this post


Link to post
Share on other sites

My site is heavily modified. I just had to issues to pass along after installing this update of 2.3.3.2.

 

Addon module: Related products.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /includes/modules/optional_related_products.php on line 42

Reads: if (mysql_num_rows($attribute_query)>0)

Changed mysql to tep_db_

Add-Ons that use the mysql_* or mysqli_* functions should use the tep_db_* functions instead. It's an easy update to perform and as Gary stated, conforms to the osCommerce standards.”

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×