Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

Hi All,

 

I have a heavily modified shop (osCommerce 2.2 MS2) with SEO-G, STS, HTC, SPPC, Options as Images, OTF, PDF Catalog etc, plus some other modification by myself.

 

Now I am thinking to install Master Products. However, after doing some research on this forum, it seems SPPC will clashed directly with Master Products.

 

So.. have anyone succesfully installed Master Products and SPPC together? What is the level of difficulty to fix all the conflicting codes?

 

Thank You!

Link to comment
Share on other sites

Hi All,

 

I have a heavily modified shop (osCommerce 2.2 MS2) with SEO-G, STS, HTC, SPPC, Options as Images, OTF, PDF Catalog etc, plus some other modification by myself.

 

Now I am thinking to install Master Products. However, after doing some research on this forum, it seems SPPC will clashed directly with Master Products.

 

So.. have anyone succesfully installed Master Products and SPPC together? What is the level of difficulty to fix all the conflicting codes?

 

Thank You!

 

Anything can be done, but I am sure you will find it quite time consuming. Master/Slave will need some of the mySQL calls re-written for PHP 5 & mySQL 5, and you may find other problems crop up. Had some problems with SPCC hide products/categories, and still having problems getting wishlist to work properly with it.

 

I have sppc, master-slave, gift vouchers and coupons, affiliates, and probably a 100 or so other major and minor contributions installed. SPPC has such convoluted code I re-wrote the contribution eliminating several hundred lines of code with a couple minor modifications to existing functions. Now it works with any mods I make to the system. One of these days I will post the updates, as have all working with PHP 5 and mySQL 5.0.x, but still have some register-globals-off problems.

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

I have Master Products and SPPC (among many others) installed and running. It wasn't too bad to setup, you just have to remember to adjust the catalog/includes/modules/master_listing.php and master_products.php files too.

 

If you get going and find you have troubles PM me with your email and I can send you over a copy of whatever page is giving you problems so you can compare the code. The bugger is the admin side as you have to make the changes for both the stock osC codes and the Master Products codes. I still don't have that one functioning perfectly, but it is functioning :blush:

 

 

Anything can be done, but I am sure you will find it quite time consuming. Master/Slave will need some of the mySQL calls re-written for PHP 5 & mySQL 5, and you may find other problems crop up. Had some problems with SPCC hide products/categories, and still having problems getting wishlist to work properly with it.

 

I have sppc, master-slave, gift vouchers and coupons, affiliates, and probably a 100 or so other major and minor contributions installed. SPPC has such convoluted code I re-wrote the contribution eliminating several hundred lines of code with a couple minor modifications to existing functions. Now it works with any mods I make to the system. One of these days I will post the updates, as have all working with PHP 5 and mySQL 5.0.x, but still have some register-globals-off problems.

~Tracy
 

Link to comment
Share on other sites

I have Master Products and SPPC (among many others) installed and running. It wasn't too bad to setup, you just have to remember to adjust the catalog/includes/modules/master_listing.php and master_products.php files too.

 

If you get going and find you have troubles PM me with your email and I can send you over a copy of whatever page is giving you problems so you can compare the code. The bugger is the admin side as you have to make the changes for both the stock osC codes and the Master Products codes. I still don't have that one functioning perfectly, but it is functioning :blush:

 

 

The SPPC work is done. Only need to compile it back into a basic cart to upload the work as a contribution. I did away with almost all the loops and contortions, except in a few places in Admin files that really didn't matter.

 

Problem now is getting Wishlist 2.0 to work with Master-Slave. I can pass the order on a single item, but not master items, and also lost the attributes. I think I know where the problem is, but haven't really had time to dig into it.

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

We don't have the Master items for sale, they are used basically for the definition of the item and then the slaves are the one's that are purchasable. I haven't used Wishlist yet (planning on adding it in the future though) - but I am guessing it would have to do with the query - you may want to try different things with the "where products_master_status =" section, or maybe even remove that from the query and see if it then allows both masters and slaves? :huh:

 

 

 

The SPPC work is done. Only need to compile it back into a basic cart to upload the work as a contribution. I did away with almost all the loops and contortions, except in a few places in Admin files that really didn't matter.

 

Problem now is getting Wishlist 2.0 to work with Master-Slave. I can pass the order on a single item, but not master items, and also lost the attributes. I think I know where the problem is, but haven't really had time to dig into it.

~Tracy
 

Link to comment
Share on other sites

We don't have the Master items for sale, they are used basically for the definition of the item and then the slaves are the one's that are purchasable. I haven't used Wishlist yet (planning on adding it in the future though) - but I am guessing it would have to do with the query - you may want to try different things with the "where products_master_status =" section, or maybe even remove that from the query and see if it then allows both masters and slaves? :huh:

 

Actually, I think it is with the code that is inserted in application top. I don't think it seeing the arrays for product id, and almost certainly not on attributes. But, when time permits.......

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

  • 2 weeks later...
G'day,

 

I have successfully managed to add master products to my site and have hit upon a problem.

 

I sell a range of licensed giftware covering different sports in Australia i.e. Rugby League, AFL, Football etc. Each product I sell is available in each team. Using easy populate I was able to add each team by setting them up as a slave to the master product. What I would like to do now is set a minimum quantity pack size required for each product. The problem is I need the minimum quantity to be calculated from the total slaves.

 

Coffee Mug <Master>

Team 1 <Slave 1> - qty 7

Team 2 <Slave 2> - qty 0

Team 3 <Slave 3> - qty 3

Team 4 <Slave 4> - qty 1

 

Using the example, the total mugs ordered would be 11 however I require the minimum quantity ordered to be 12.

 

What is the best way of doing this?

 

Cheers.

 

Any ides??

 

Cheers,

 

Christian

Link to comment
Share on other sites

Any ides??

 

Cheers,

 

Christian

 

 

If I understand correctly, you don't care how many of any one slave item they order, as long as the total is 12 or a multiple of 12?

 

George

 

ps. Just from a marketing stand point for my curiosity only, what was the reasoning behind setting the item as master as opposed to setting the team as master?

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

If I understand correctly, you don't care how many of any one slave item they order, as long as the total is 12 or a multiple of 12?

 

George

 

ps. Just from a marketing stand point for my curiosity only, what was the reasoning behind setting the item as master as opposed to setting the team as master?

 

In most cases i just require the combination of slaves to equal 12, however sometimes i have pack sizes of 24 and sometimes 6. Using minimum order quintity i could get the products to be ordered in multiples per slave but i can't work out how to calculate a minimum based on a combination.

 

The reason we had the item as a master was because we sell each item in every team and it was easier for customers to look for a white mug then choosing form 16 teams as opposed to team A then trying to find the mug in the list if 200 items. Also i figured it would be easier to set a minimum if the slaves were grouped together. However i have had no luck as yet.

 

On another note, it seems that if i have a slave for a master product with id 1234 it will also become the slave for master product with id 123. Not sure why this is.

 

Cheers,

 

Christian

Link to comment
Share on other sites

In most cases i just require the combination of slaves to equal 12, however sometimes i have pack sizes of 24 and sometimes 6. Using minimum order quintity i could get the products to be ordered in multiples per slave but i can't work out how to calculate a minimum based on a combination.

 

The reason we had the item as a master was because we sell each item in every team and it was easier for customers to look for a white mug then choosing form 16 teams as opposed to team A then trying to find the mug in the list if 200 items. Also i figured it would be easier to set a minimum if the slaves were grouped together. However i have had no luck as yet.

 

On another note, it seems that if i have a slave for a master product with id 1234 it will also become the slave for master product with id 123. Not sure why this is.

 

Cheers,

 

Christian

 

Good reason for setting the master/ slave combinations. I probably would have looked at it the other way, and created a nightmare.

 

I will take a look to see if anything comes to mind on your quantity problem, but may be a few days as am closing down one of our retail stores this week and have very little time before the middle of next week.

 

As to the last mention. The original code had some database calls for master LIKE instead of =, which I think causes the problem. I haven't corrected mine, since I have no customers with enough items for the bad call to cause a problem. My set up here is PHP 5.x and mySQL 5.0.x, so will fix that and post the updates here if you can't find all of them. The correction should work okay on PHP 4.3.x + and mySQL 4.1.x + without problems.

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Good reason for setting the master/ slave combinations. I probably would have looked at it the other way, and created a nightmare.

 

I will take a look to see if anything comes to mind on your quantity problem, but may be a few days as am closing down one of our retail stores this week and have very little time before the middle of next week.

 

As to the last mention. The original code had some database calls for master LIKE instead of =, which I think causes the problem. I haven't corrected mine, since I have no customers with enough items for the bad call to cause a problem. My set up here is PHP 5.x and mySQL 5.0.x, so will fix that and post the updates here if you can't find all of them. The correction should work okay on PHP 4.3.x + and mySQL 4.1.x + without problems.

 

 

Thankyou for your help.

 

Christian

Link to comment
Share on other sites

Hi All,

 

This is a great Contribution. It works fine for 2 sites we run and will be incorporated into a further two in the next couple of weeks.#

But we have a small "oddity"...

Some Master products have listed not just their own Slave products, but also Slave products from a different Master. It looks as though it is due to a query using a "LIKE" clause because the error occurs where the product_id of the master is part of the product_id of another Master product.

So we get

Master 1 (product_id = 55)

Slave 1 of Master 1

Slave 2 of Master 1

Slave 1 of Master 2 (where Master 2 has product_id of 155)

Slave 2 of Master 2

 

I think the erroneous statement is in "/product_info.php" at about line 290, i.e

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'");

where the clause

... where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'"

will select any item whose id contains (in my example above) 55

 

I am using Master Products 1.5

 

Has anyone else found the problem and have I got the right place for a correction, which I think should be to drop the leading %, ie:

 

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE  '" . $HTTP_GET_VARS['products_id'] . "%'");

 

or to make the LIKES Equals (=) i.e

 

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master =  " . $HTTP_GET_VARS['products_id'] );

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

I am trying to setup an RC1 site with Master Products and I've run into a problem I can't seem to find a resolution to. For some reason, my products_info.php page is not showing the slave products to the Master Product. If I am on the Category page I can see the Master and the Slaves, I can add the slaves to my cart (master has a price of $0.00 so it doesn't add to cart which is what I want). When I click on the Master though - the slaves do not show up on the product_info.

 

Any ideas on what could be causing this? I've been comparing the Master Products files (v1.2), as well as comparing it with a working 2.2ms2 - 060817 that I have heavily modified. I cannot seem to find any discrepancies in the Master Products code, so the only thing I can think of is something in the code needs to change for the new RC1 code changes :huh:

 

Anybody have any ideas? Anyone else experienced any problems getting this to work on RC1 ?

~Tracy
 

Link to comment
Share on other sites

I am using this contribution perfect and was wondering. I want to insert an image "line" between each slave to seperate them. Is there a way to do this and where would I put it?

 

 

I believe this would be in catalog/includes/modules/master_listing.php

"Will code for food"

www.AHitchhiker.com

Link to comment
Share on other sites

I am trying to setup an RC1 site with Master Products and I've run into a problem I can't seem to find a resolution to. For some reason, my products_info.php page is not showing the slave products to the Master Product. If I am on the Category page I can see the Master and the Slaves, I can add the slaves to my cart (master has a price of $0.00 so it doesn't add to cart which is what I want). When I click on the Master though - the slaves do not show up on the product_info.

 

Any ideas on what could be causing this? I've been comparing the Master Products files (v1.2), as well as comparing it with a working 2.2ms2 - 060817 that I have heavily modified. I cannot seem to find any discrepancies in the Master Products code, so the only thing I can think of is something in the code needs to change for the new RC1 code changes :huh:

 

Anybody have any ideas? Anyone else experienced any problems getting this to work on RC1 ?

 

 

I installed this on RC1 and I recall having to make soem specific changes, I will try to find the files and post them here.

"Will code for food"

www.AHitchhiker.com

Link to comment
Share on other sites

Yes this is where the problem originates. I remember reading the fix somewhere. I believe it is changing the Like to = or ==

Hi All,

 

This is a great Contribution. It works fine for 2 sites we run and will be incorporated into a further two in the next couple of weeks.#

But we have a small "oddity"...

Some Master products have listed not just their own Slave products, but also Slave products from a different Master. It looks as though it is due to a query using a "LIKE" clause because the error occurs where the product_id of the master is part of the product_id of another Master product.

So we get

Master 1 (product_id = 55)

Slave 1 of Master 1

Slave 2 of Master 1

Slave 1 of Master 2 (where Master 2 has product_id of 155)

Slave 2 of Master 2

 

I think the erroneous statement is in "/product_info.php" at about line 290, i.e

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'");

where the clause

... where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'"

will select any item whose id contains (in my example above) 55

 

I am using Master Products 1.5

 

Has anyone else found the problem and have I got the right place for a correction, which I think should be to drop the leading %, ie:

 

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE  '" . $HTTP_GET_VARS['products_id'] . "%'");

 

or to make the LIKES Equals (=) i.e

 

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master =  " . $HTTP_GET_VARS['products_id'] );

 

Thanks

"Will code for food"

www.AHitchhiker.com

Link to comment
Share on other sites

If memory serves me correctly - yes, you have the correct spot in the query - but I think the query is on more than one page? Double check both master_listing.php and master_products.php (and possibly product_listing.php) just to make sure there aren't any other "LIKE" queries in there :)

 

Yes this is where the problem originates. I remember reading the fix somewhere. I believe it is changing the Like to = or ==

~Tracy
 

Link to comment
Share on other sites

Ok, this makes me recall, that what I ended up doing was changing LIKE to = and then changing the code to seperate the product_ids with a comma instead of a space. as I recall thsi fixed it up just fine.

Yeah... I already tried that, but since the products_master field is a string of various id's (ie. "310 56 107 209") separated only by spaces it doesn't work. If the product's ID is 45 then it checks to see if any of any of those fields are equal to 45; you could only have one master for the product and it would have to be 45 for it to work properly... it can't be 45 AND 317, for instance, because "45" != "45 317". Thanks for the response though, I appreciate your time and input.

 

-Ian

"Will code for food"

www.AHitchhiker.com

Link to comment
Share on other sites

Ok, this makes me recall, that what I ended up doing was changing LIKE to = and then changing the code to seperate the product_ids with a comma instead of a space. as I recall thsi fixed it up just fine.

 

Ok, me thinks me has it. Change LIKE to = wherever the query appears. Now, when you enter your Master IDs in admin seperate them each with a comma rather than a space.

 

Please forgive me, I actually use MP 1.1.5 which doesnt have the slave to multiple masters feature. I did try it out at some point withing the last year or two and am working solely form memory. But I am pretty sure thats all there is to it.

"Will code for food"

www.AHitchhiker.com

Link to comment
Share on other sites

If memory serves me correctly - yes, you have the correct spot in the query - but I think the query is on more than one page? Double check both master_listing.php and master_products.php (and possibly product_listing.php) just to make sure there aren't any other "LIKE" queries in there :)

I confirm that the changes are to: product_info.php around line 290

change

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'");

to

$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master = " . $HTTP_GET_VARS['products_id']);

and in includes/modules/master_products.php

change line 19 from

$master_query = tep_db_query("select products_master from " . TABLE_PRODUCTS . " where products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%'");

to

$master_query = tep_db_query("select products_master from " . TABLE_PRODUCTS . " where products_master = " . $HTTP_GET_VARS['products_id']);

change line 70 from

$master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE  '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

to

$master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master = " . $HTTP_GET_VARS['products_id'] . " and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

Note that you can only assign a slave product to 1 master product

Link to comment
Share on other sites

I installed this on RC1 and I recall having to make soem specific changes, I will try to find the files and post them here.

 

 

Could you please post them, or have already deleted the files? Cuz im trying the same thing here, and got the same results.

Link to comment
Share on other sites

Found it by myself, after 1 hour of looking in the Sources..

 

in the product_info.php on line 250

 

edit

 

if (($results['products_id'] != null) && ($product_info['products_master_status'] == 1)) {

 

to

 

if (($results['products_id'] != NULL) && ($product_info['products_master_status'] == 1)) {

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