Jump to content
Johnson

Master Products - MS2

Recommended Posts

Ah... I just re-installed osC clean and Master Products will be the first contrib i put in.

 

I may be back...

I'm back and it WORKED!!!

 

Seems that alternative SQL file was the trick.

 

Thanks!

Share this post


Link to post
Share on other sites

I've read through all 51 (and counting) pages of this thread and couldn't find an answer. Perhaps I skipped over it...it's getting late here.

 

I have Master Products up and running here:

http://www.bluenoteweb.com/howiemerch/

That's a temporary URL while I'm still developing.

 

I'm using Master Products to keep track of the t-shirts and all their different sizes. I would also like to use Master Products for the stickers. The client has 5 different kinds of stickers, each costing $2. He wants to sell all five as a package for $5. So...I've added each sticker as a slave, with the package as the master. I can add the stickers individually for a cost of $2 apiece, or the package for a cost of $5. So far so good.

 

Now, if a customer buys the package deal, I want to lower the stock level of each individual sticker by one. The package deal probably should be marked out of stock if any of the individual stickers is out of stock.

 

Is there a configuration variable I missed somewhere that will allow me to do this? Or do I need to get into the code for it?

 

FYI - I have this running with MaxiDVD's UltraPics/HTML Editor contribution. The categories.php file took me forever to get right. I don't think it's worthy of being its own contribution, but if anyone out there needs a copy feel free to email me and I'll send it to you.


Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Share this post


Link to post
Share on other sites

Hello,

 

This looks like 1 awesome contribution. I just wanted to ask what you all feel about installing this contribution on a *highly* modified store. I have no problem with going through php code and cutting pasting etc. but in the end will it even work? Just wanted to get input on how everyone faired on installing this contribution on their modified stores. Thanks in advance.

Share this post


Link to post
Share on other sites
Hello,

 

This looks like 1 awesome contribution. I just wanted to ask what you all feel about installing this contribution on a *highly* modified store. I have no problem with going through php code and cutting pasting etc. but in the end will it even work? Just wanted to get input on how everyone faired on installing this contribution on their modified stores. Thanks in advance.

well, i have it installed in my store, i have more then i think 60 constibs/mods and no problem, but i dont have the latest vers. since it caused some problems and things i did not like (stock checkout and stuff) so i moded my self a bit. overall a very nice constrib.

thanks to matti making it possible :king

 

regards john

 

ps. also the mod is easy to understand, i have also the seperate pricing per customer working with it no prob.!

Share this post


Link to post
Share on other sites
Hello,

 

This looks like 1 awesome contribution. I just wanted to ask what you all feel about installing this contribution on a *highly* modified store. I have no problem with going through php code and cutting pasting etc. but in the end will it even work? Just wanted to get input on how everyone faired on installing this contribution on their modified stores. Thanks in advance.

Wait until Monday - I will be uploading some new files, including a much simplified admin/categories.php.

 

Matti


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites
Can someone tell me what to do? I tried both and neither worked.

You probably need the application_top.php from the first release.

 

Matti


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites

Installed Master products which is fine..

 

But I still cannot figure out how to get the items in the drop down list..

 

For exmaple I am trying to do something list this

 

ITEM NO. ABC - MASTER PRODUCT

 

SIZE : M - SLAVE

SIZE : L - SLAVE

SIZE : XL - SLAVE

 

COLOR : BLUE - SLAVE

COLOR : RED - SLAVE

COLOR GREEN - SLAVE

 

 

Size should be in a drop down list as well as the color, so when the user selects size m then he can select the color (if the color, if the color is in stock )

 

hope master products can do this.. i tried qtpro but no luck there.

Share this post


Link to post
Share on other sites
the dropdown menu for selecting the quantity only allows you to select 0 or 1. Where can I change this?
I think that this means the product is set to a quantity of 1 in the database. If you change the products_quantity to 20 or more, it should allow people to select more. If that's not how you want it to work, you could also change the behavior directly in includes/modules/master_listing.php. There is discussion about how it was added earlier in the thread (also, you can compare against the original version of the contribution).

 

Hth,

Matt


Always back up before making changes.

Share this post


Link to post
Share on other sites

Thanks... I realized my main problem was that I thought I had my stock level set at 0 for each item but it had defaulted to 1, so it was displaying my available stock. I took my stock down to 0 and it displayed a dropdown menu to select up to 20 for quantity.

 

For anyone who cares and is as bad at finding these things as I am ... to change maximum quantity in the dropdown menu, look for this line on master_listing.php & product_info.php:

 

for ($i=0; $ns = 20, $i <= $ns; $i++) {

 

and change 20 to whatever you want.

 

Or add the following line to your application_top.php:

 

// Drop down menu for add to cart quantity

define('DROPDOWN_QUANTITY', 20); // The maximum number to disply in the drop down menus for product quantity

 

and changed the code mentioned above to this:

 

for ($i=0; $ns = DROPDOWN_QUANTITY, $i <= $ns; $i++) {

 

Then you can update your maximum quantity in one place. ;)

Share this post


Link to post
Share on other sites
Installed Master products which is fine..

 

But I still cannot figure out how to get the items in the drop down list..

 

For exmaple I am trying to do something list this

 

ITEM NO. ABC - MASTER PRODUCT

 

SIZE : M - SLAVE

SIZE : L - SLAVE

SIZE : XL - SLAVE

 

COLOR : BLUE - SLAVE

COLOR : RED - SLAVE

COLOR GREEN - SLAVE

 

 

Size should be in a drop down list as well as the color, so when the user selects size m then he can select the color (if the color, if the color is in stock )

 

hope master products can do this.. i tried qtpro but no luck there.

No - it does not do this - you would need to have size and colour together - quite a few people have done this and seem quite happy with the result


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites

Hey

 

I'm trying to modify Master product contribution to put all slave products to drop down box and put input text for qnt the rigth. I cannot find how in this case slave product id is passed to shopping cart. It should look something like that

 

My Webpage, and if i look at source there is in form action=add_slave, where that get executed, i'm new in php so any help would be great

 

Thanks

Edited by tomla

Share this post


Link to post
Share on other sites

Its executed in catalog/includes/application_top.php - just search for 'add_slave'

 

Please contribute your mods in the support thread.

 

Matti


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites
Master Product: I'm having problems with product_info.php, when I click "add to cart" it said my cart was empty. Why is my cart empty?

 

Note: running Master Products - 1.1.5

How was this resolved? I have a clean installation of MS2. Only contribution thus far is Master Products 1.1.5. Cart is empty when attempting to add items. If I use the original, unmodified product_info.php I can add to the cart but not if I use the copy with Master Products code added. Am I missing a setting somewhere?

Share this post


Link to post
Share on other sites
Master Product: I'm having problems with product_info.php, when I click "add to cart" it said my cart was empty. Why is my cart empty?

 

Note: running Master Products - 1.1.5

I found the solution posted earlier in this thread. Change application_top.php to:

    //Master Products  ENDLICH ?BERHOLT!! Ren? Reineke 06.12.03                     

    // customer adds multiple products from the master_listing page

    case 'add_slave' :   

                            foreach ($HTTP_POST_VARS as $keyA => $valueA) {

                                if (substr($keyA,0,11) == "Qty_ProdId_") {

                                $prodId = substr($keyA,11);

                                if ($valueA <= 0 ) continue;

                                $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($valueA), $HTTP_POST_VARS['id']);

                              }

                            }

                            tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

                            break;

    //Master Products EOF     

Share this post


Link to post
Share on other sites
Installed Master products which is fine..

 

But I still cannot figure out how to get the items in the drop down list..

 

For exmaple I am trying to do something list this

 

ITEM NO. ABC - MASTER PRODUCT

 

SIZE : M  - SLAVE

SIZE : L - SLAVE

SIZE : XL  - SLAVE

 

COLOR : BLUE - SLAVE

COLOR : RED - SLAVE

COLOR GREEN - SLAVE

 

 

Size should be in a drop down list as well as the color, so when the user selects size m then he can select the color (if the color, if the color is in stock )

 

hope master products can do this.. i tried qtpro but no luck there.

No - it does not do this - you would need to have size and colour together - quite a few people have done this and seem quite happy with the result

Thanks ...

 

Okay then how do i get the size and color in a drop down list with its own price..

 

I.e. Item No. ABC

 

[DROP DOWN LIST]

LARGE, BLUE $25.00

 

It doesn't give me a drop down list..

 

thanks.

 

Does anybody suggest QTPRO, what is the actuall difference..

Share this post


Link to post
Share on other sites

Hi,

 

We just installed OSCommerce and the Master Slave contribution. Can we add a slave to may different masters? Can we specify a different qty for slave in each different masters?

 

Our goals is to be able to enter a product once and then specify in which category or master he should be listed whith a specific qty. Is this possible with this contribution or another one?

 

Thanks,

 

Daniel

Edited by abcpro

Share this post


Link to post
Share on other sites

To make the search results return the master rather than the slave product, I made the following changes to advanced_search_results.php. Add before line 223:

  $from_str .= " left join " . TABLE_PRODUCTS . " pm on pm.products_master = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pdm on pm.products_id = pdm.products_id";

Change line 223 from

  $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

to

  $where_str = " where p.products_status = '1' and p.products_listing_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and pdm.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

and around lines 258-9, change

          $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
         if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";

to

          $where_str .= "(pdm.products_name like '%" . tep_db_input($keyword) . "%' or pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
         if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pdm.products_description like '%" . tep_db_input($keyword) . "%' or pd.products_description like '%" . tep_db_input($keyword) . "%'";

For efficiency, I also added a new index on the products_master column of the products table.

 

Hth,

Matt


Always back up before making changes.

Share this post


Link to post
Share on other sites

Great, great script.. I have implemented some of the things I've seen here..

 

I do have a question, though. When I put a product on sale, I only want to put the Master Product on sale at a percentage discount. When i enter that percentage I get a division by zero (obviously, since the master product's price is 0.00). How can I set the script up so that if I have a 20% discount (or a $20 discount, even) the new price will be shown for each slave on the respective product page?

 

Thanks!

Colin

Share this post


Link to post
Share on other sites

Hey there all! Here's a quick tip if you're selling clothes.

 

My client wanted his customers to pick their size of t-shirt from the category listing on index.php rather than the product_info screen. So, I created a drop-down box with all of the slaves for each master and modified the buy_now button to submit a form. You can check it out here:

http://www.bluenoteweb.com/howiemerch/index.php?cPath=21

That's a temporary URL for development...if it's broke then send me a message and I'll post the new one. I'm still working on a few other things, so if it gives you error messages reload in a few minutes.

 

The necessary code is all within product_listing.php. Any comments or suggestions on how I might do this better are welcome! Here are the necessary parts of product_listing in case someone wants to re-create what I've done.

 

This starts on line 112 of my file. If the product is a master, a form is created with a drop-down that lists the name of each slave and its price. Normal products (not masters or slaves) still show up as normal.

 

 ? ? ? ? ?case 'PRODUCT_LIST_PRICE':
? ? ? ? ? ?$lc_align = 'right';
?	if (tep_not_null($listing['specials_new_products_price'])) {
? ? ? ? ? ? ?$lc_text = ' <s>' . ?$currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
? ? ? ? ? ?} else {
? ? ? ? ? ? ?$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
? ? ? ? ? ?}
?	if ($listing['products_master_status'] == '1'){
? ? $results = array();
? $slaves = array();
?$slave_array = array();
?$slave_query = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where products_master = '" . $listing['products_id'] . "' and p.products_id = pd.products_id");
?while ($get_slaves = tep_db_fetch_array($slave_query)) {
? ?$slaves[] = array('id' => $get_slaves['products_id'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => $get_slaves['products_name'] . " - " . $currencies->display_price($get_slaves['products_price'], $get_slaves['products_tax_class_id']));
? ?$slave_array[$get_slaves['products_id']] = $get_slaves['products_products_name'];
?}
?
? ? $lc_text='<form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product', 'NONSSL') . '">' . tep_draw_pull_down_menu('products_id', $slaves);
?	}
? ? ? ? ? ?break;

 

This is line 149-ish. Instead of the "buy now" button linking to product_info.php, it adds the selected slave to the cart.

 ? ? ? ? ?case 'PRODUCT_LIST_BUY_NOW':
? ? ? ? ? ?$lc_align = 'center';
//Master Products ? ? ? ? ? ?
? ? ? ? ? ?if ($listing['products_master_status'] != '1' && $listing['products_master'] == '0') {
? ? ? ? ? ?$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
? ? ? ?} elseif ($listing['products_master'] != '0') {
? ? ? ? ? ?$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_master']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; ? ? ? 
? ? ? ?} else {
? ? ? ? ? ?$lc_text = ' ' . tep_image_submit('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . ' </form>';
? ? ? ?}	
//Master Products EOF ? ? ? ?	
? ? ? ? ? ?break;
? ? ? ?}

Edited by BlueNoteMKVI

Chris Dunning

osCommerce, Contributions Moderator Team

 

Please do not send me PM! I do not read or answer these often. Use the email button instead!

 

I do NOT support contributions other than my own. Emails asking for support on other people's contributions will be ignored. Ask in the forum or contact the contribution author directly.

Share this post


Link to post
Share on other sites

Great work Chris! :)


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites

yeah, that's awesome.. i think i'll use your Buy Now code for my site.. I've been wanting that for awhile but didn't know how to code it :)

Share this post


Link to post
Share on other sites

Question: In product_info.php, How to display the slave of slave

 

For exmaple I am trying to do like this

 

ITEM 00001 - MASTER PRODUCT

 

Part 1 - SLAVE

---- Part 1.1 - SLAVE?'S SLAVE

---- Part 1.2 - SLAVE?'S SLAVE

---- Part 1.3 - SLAVE?'S SLAVE

Part 2 - SLAVE

---- Part 2.1 - SLAVE?'S SLAVE

---- Part 2.2 - SLAVE?'S SLAVE

---- Part 2.3 - SLAVE?'S SLAVE

 

hope somebody help me.

Share this post


Link to post
Share on other sites

I don't believe that's possible in the current version..

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

×