Jump to content
Skittles

Optional Related Products, Version 4.0

Recommended Posts

Dear Rainer

 

thank you my problem is that i have thousand of products and associate one to one wiil be a long time work, and also for the problem that they are changing a lot this work will need to be chek a lot.

 

is not possible to make additional code using this:

 http://addons.oscommerce.com/info/8862

 

regards

 

MATTEO

Share this post


Link to post
Share on other sites

Hello Matteo @@teol79,

 

Optional related products does what it is intended for: show related products on the product page where the store owner decides which products keep relation.

 

If you wish to show random products without any defined relation, just a random selection out of all existing products, it can be coded modifying the database query.

 

Have a look on the query of the add-on you refer to as a reference and apply that query to the related products query.

Then you can remove all admin part of the related products add-on.

 

regards

Rainer

Share this post


Link to post
Share on other sites

@@teol79, but it may be noticeable slow to random query all your products if you have a lot.

Share this post


Link to post
Share on other sites

Hello, can I know how this addon works ?

I know it show other related products on a product info page. But does it do this automatically or I should relate the products to each others manually ?

Share this post


Link to post
Share on other sites

@@Psytanium,

 

Yes, you need to define the relations in Admin for each product. Although there are options to add all relations of an already defined product to another, so you do not repeat one by one once you have several related products defined.

Share this post


Link to post
Share on other sites

@@Psytanium,

 

Similar add-ons I know are cross-sell (x-sell) and the commercial 07 - Featured Products on Index add-on from burt:

http://forums.oscommerce.com/topic/399572-28-days-of-code-february-2015-rocking-oscommerce/

 

However as far as I know they are both manual, just different approaches how the relations are defined.

 

I do not know any which does it automatic like you wish. But it doesn't mean that it doesn't exist :)

 

However the aproach is slightly different, same price doesn't mean that they could be related and same category is already obvious to find.

 

regards

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Hello,

I had Related Products BS http://addons.oscommerce.com/info/9499 after i update it for the new one (Related_Products_234_BS_6.0),

in product_info page where there is related product, the left column disappear, and  right column shows just before the footer.

but if there is no related product to product, the page show fine..

 

ps. when remove the module.. everything work fine..

 

any help plz

BR

Omar


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@@Omar_one,

 

It sounds like you have unbalanced div tags. The divs in the module itself didn't change since the previous version and all shows correct in my test store.

Sure you are using 2.3.4 bootstrap? Standard version is not supported in the new version.

Maybe you had your old version modified to fit your store modifications.

You should check your html source code for missing closing </div> tag.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

@@raiwa

 

I checked the product_info.php for missing closing </div> tag.. i didn't found any missing  closing </div> tag

BR

Omar

Edited by Omar_one

Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@@Omar_one,

 

Ohhps, yes you are right. I removed a div tag at the beginning and missed to remove the closing tag.

Please in:

includes/modules/content/product_info/cm_pi_related_products.php

remove line 157:

                $optional_rel_prods_content .=  '</div>'; // row
 

Please confirm and Ill upload the fix.

 

thanks and kind regards

Rainer

Share this post


Link to post
Share on other sites

@@Omar_one,

 

Just uploaded the new version Update Version 6.1r1 BS with the fix.

 

Thanks and kind regards

Rainer

 

Share this post


Link to post
Share on other sites

Hi @ll, hi @@raiwa !

 

Actually I try to find a contrib thats able to display a random set of products from a choosen

category below a product which is ranged in an other choosen category.

I think @@naiadomare has tried to do the same about eight years ago in the same thread.

 

Has anyone got this to work ? Or contains this contrib the requested function already ?

 

I would be grateful for any help !

 

SEE YA !

Denzel.

Share this post


Link to post
Share on other sites

Hello Dennis @@Denzel,

 

This option is not yet included in the actual add-on.

As far as I know something like this is not available already.

 

rgds

Rainer

Share this post


Link to post
Share on other sites

Hi,

i removed the module and reinstall it again, now the module not shown and there is error on the admin side when i try go to Catalog => related products

 and here is the error

1054 - Unknown column 'pd.products_name' in 'order clause'

select distinct p.products_id from products p, products_related_products pa where pa.pop_products_id_master = p.products_id order by pd.products_name

I dont know what i have been done o:)

 

Thank you for any help

BR

Omar


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@@Omar_one,

 

Is it possible that you updated to a newer version.

If you are using the latest 6.x version, there may appear this error if you have switched off "show products name".

 

Please try this fix:

in: catalog/admin/optional_related_products.php

 

move line 193:

  				$related_from .=  ", products_description pd";

up below line 186:

  			$related_from =  " from products p, products_related_products pa";

Please let me know if it works, then I will upload the fix.

 

Between: please let us always know your exact add-on and store version, it makes it easier to help

 

rgds

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

@@Omar_one,

 

there are more places which need to be changed:

 

Move also :

line 311 below 304

line 410 below line 403

line 443 below line 436

 

rgds

Rainer

Share this post


Link to post
Share on other sites

 Thank you @@raiwa

sorry about not type what the exact add-on and store version..

Related_Products_234_BS_6.1r2 and oscommerce 2.3 bs edeg

 I made the changes but still same error.

 

BR

Omar


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

here the changes

$related_what = "p.products_id";    			
  			$related_from =  " from products p, products_related_products pa";
			$related_from .=  ", products_description pd"; 
    		$related_where =  " where pa.pop_products_id_master = p.products_id";
  			if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_MODEL == 'True') {
  				$related_what .= ", p.products_model";
  			}
  			if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_NAME == 'True') {
  				$related_what .= ", pd.products_name";
  				//$related_from .=  ", products_description pd";
  				$related_where .=  " and p.products_id = pd.products_id";
  				$related_where .=  " and pd.language_id = '" . $languages_id . "'";
// edit relation master product menu
    						$related_what = "p.products_id";   
						 $related_from .=  ", products_description pd";
    						$related_from =  " from products p";
    						$related_where =  " where p.products_id > '0'";
    						if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_MODEL == 'True') {
    							$related_what .= ", p.products_model";
    						}
    						if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_NAME == 'True') {
    							$related_what .= ", pd.products_name";
    							//$related_from .=  ", products_description pd";
    							$related_where .=  " and p.products_id = pd.products_id";
    							$related_where .=  " and pd.language_id = '" . $languages_id . "'";
    						}
<?php			$related_what = "p.products_id"; 
		       $related_from .=  ", products_description pd";
    		       $related_from =  " from products p";
    		       $related_where =  " where p.products_id > '0'";
    		       if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_MODEL == 'True') {
    		         $related_what .= ", p.products_model";
    				}
    			if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_NAME == 'True') {
    				$related_what .= ", pd.products_name";
    				//$related_from .=  ", products_description pd";
    				$related_where .=  " and p.products_id = pd.products_id";
    				$related_where .=  " and pd.language_id = '" . $languages_id . "'";
    								}
                $related_what = "p.products_id";
		$related_from .=  ", products_description pd";
		$related_from =  " from products p";
    		$related_where =  " where p.products_id > '0'";
    		if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_MODEL == 'True') {
    		$related_what .= ", p.products_model";
    		}
    		if (MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_USE_NAME == 'True') {
    		$related_what .= ", pd.products_name";
    		//$related_from .=  ", products_description pd";
    		$related_where .=  " and p.products_id = pd.products_id";
    		$related_where .=  " and pd.language_id = '" . $languages_id . "'";

and now new error appear

Products with relations: 	
>>
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 'MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS' at line 5

select pa.*, pd.products_id from products_related_products pa left join products_description pd on pa.pop_products_id_master = pd.products_id and pd.language_id = '5' order by pd.products_name, pa.pop_order_id, pa.pop_id LIMIT 0, MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS

Edited by Omar_one

Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

In changes 2-4 the lines must be oposite order:

		$related_from =  " from products p";
		$related_from .=  ", products_description pd";

Share this post


Link to post
Share on other sites

:(

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 'MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS' at line 5

select pa.*, pd.products_id from products_related_products pa left join products_description pd on pa.pop_products_id_master = pd.products_id and pd.language_id = '5' order by pd.products_name, pa.pop_order_id, pa.pop_id LIMIT 0, MODULE_CONTENT_PRODUCT_INFO_ADMIN_RELATED_PRODUCTS_MAX_ROW_LISTS_OPTIONS


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

@@Omar_one,

 

Just a stupid question: you have the product info content module installed??

Share this post


Link to post
Share on other sites

@@raiwa They say (There are no stupid questions, only stupid answers.)

I dont have product info content module installed..

but now its work fine ..

i just remove module and install it again with your code changes and now its WORKING :thumbsup:

 

Thank you Rainer

Edited by Omar_one

Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Hello, Will be possible to have a query that compile the database table "products_related_products" ? 

 

I mean somenthing to compile the table as this:

Take product A create a prelationship with up to:

-max 3 items available from the same manufacturer / category

-max 3 products available in the same category but not the manufactures

-max 3 products from the same manufacturer but different category.

-If the number of reports is less than 9 add random products avaible 
 
The shop owner in this way should update this table once he need to refresh the relationship of his stock

                         - 

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

×