Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Optional Related Products, Version 4.0


Skittles

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
	  }

Link to comment
Share on other sites

  • 1 month later...

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?

Link to comment
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.

Link to comment
Share on other sites

  • 2 months later...

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

 

Link to comment
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

 

Link to comment
Share on other sites

  • 2 weeks later...

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

 

Link to comment
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

Link to comment
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.

Link to comment
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 !

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

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

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...

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?

Link to comment
Share on other sites

  • 1 month later...

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.

Link to comment
Share on other sites

  • 3 months later...

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?

Link to comment
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

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

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..

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

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.”

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...