Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Master Products - MS2


2394 replies to this topic

#21 steve***

  • Community Member
  • 110 posts
  • Real Name:Steve Sherry
  • Gender:Male
  • Location:UK

Posted 28 November 2003, 02:03

delphian, on Nov 26 2003, 05:13 AM, said:

burt, on Nov 25 2003, 06:33 PM, said:

I'm not sure I understand what this does - woudl the following be a workable example:

Master:  Sexy Nurses Outfit
Slaves:  Wig, Stockings, Thermometer

In effect the Slaves are not real products that are buyable unless you purchase the "Master" ??

Or are the Slaves also real products as well ?

This could work for a new site I'm working on..  Appreciate any pointers, thanks.
Moreover, it would work as such:

Master: Nurses Outfit
Slave 1: Nurses Outfit in XXL Black Spandex
Slave 2: Nurses Outfit in L White Spandex
Slave 3: Nurses Outfit in XL White Spandex

You might ask "Why not just use attributes?". My answer would be that in this case, it is possible that they don't carry an XXL White version, only XXL black...

But a better thing to look at would be to check out my post here:

http://forums.oscommerce.com/index.php?showtopic=67277

You can see a live example, both nonOSC and OSC (using this mod) that really show how this is best used.

-Zac
the only question I have is why on earth would you want a XXL nurses uniform?

I know I'd rather have a nice size S!! :D

#22 Johnson

  • Banned
  • 5,205 posts
  • Real Name:Matti Ressler
  • Location:Sydney, Australia

Posted 28 November 2003, 06:17

steve***, on Nov 27 2003, 10:03 PM, said:

the only question I have is why on earth would you want a XXL nurses uniform?

I know I'd rather have a nice size S!! :D
I am sure you would look very nice :lol:

Matti
Matti Ressler

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

#23 socrates

  • Community Member
  • 18 posts
  • Real Name:Christian

Posted 30 November 2003, 14:32

hi,
i have installed it and it works verry nice.
but i have a little problem with the index page (i think it's the new_products.php).
on this page the "nonschown" slaves are visible.
how can i get them off?
thx soc.

i don't have a link because it's my testsys.

#24 Johnson

  • Banned
  • 5,205 posts
  • Real Name:Matti Ressler
  • Location:Sydney, Australia

Posted 30 November 2003, 15:26

In catalog/includes/new_products.php change the db queries to:

  if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
    $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and products_master = '0' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  } else {
    $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and products_master= '0' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }

I have simply added:

and products_master = '0'

You could also use:

and products_listing_status = '1'

This latter will allow you to control which slaves show and which do not via the product edit page 'listing status' - perhaps the better option.

You can do the same in catalog/includes/boxes/whats_new.php and elsewhere :D

Take a look at the catalog/products_new.php included with the package for more ideas on how to control display.

Admin control of these and other parameters will feature in later versions of Master Products. The next release will display product attributes in the slave listing. I also intend to include an option whether or not individual slave products will link to their own product_info page (more info).


HTH

Matti

Edited by Johnson, 30 November 2003, 15:33.

Matti Ressler

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

#25 socrates

  • Community Member
  • 18 posts
  • Real Name:Christian

Posted 30 November 2003, 20:27

hi Johnson,
this was the right hind!!
it works - you've done a verry good job!. :P :D
thx soc.

#26 blueguy777

  • Community Member
  • 23 posts
  • Real Name:ravi

Posted 01 December 2003, 12:51

Hi Johnson

Will it be possible that we can assign the slaves to multiple master products?

E.g--> Master:1
Slave:1
Slave:2
Slave:3

Master:2
Slave:1 (Also with Master:1)
Slave:3 (Also With Master:1)

And aso the Ability in the Admin to enable/disable description or not in the slave listing

I hope you get what I mean

#27 MickiCheers

  • Community Member
  • 44 posts
  • Real Name:Micki Cheers

Posted 01 December 2003, 20:31

I installed and my products listing went a bit goofy. In the category where I defined a master product (with slaves) only the first item in the category shows up. The bottom of the box says something like "4 of 4" but only 1 item is appearing in the box. I checked the other categories and this wasn't a problem. Will have to take more time and compare my index.php with the one in the contrib.

#28 Johnson

  • Banned
  • 5,205 posts
  • Real Name:Matti Ressler
  • Location:Sydney, Australia

Posted 02 December 2003, 06:43

blueguy777, on Dec 1 2003, 08:51 AM, said:

Hi Johnson

Will it be possible that we can assign the slaves to multiple master products?

  E.g--> Master:1
            Slave:1
            Slave:2
            Slave:3

    Master:2
    Slave:1 (Also with Master:1)
    Slave:3 (Also With Master:1)

  And aso the Ability in the Admin to enable/disable description or not in the slave listing

   I hope you get what I mean


Yes - you must use the 'copy to' button on the admin>category/product listing page and select the 'duplicate' option - you may duplicate to the same category or another, then 'edit' to assign a different Master Product to the duplicate.

You can toggle the description on/off in admin>configuration>Slave Products>Display Slave Product Description - set this to '0' to hide the description.

You can control the length of the description using the 'Length of Truncated Product Description' option.

Matti

Edited by Johnson, 02 December 2003, 06:44.

Matti Ressler

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

#29 media1

  • Community Member
  • 3 posts
  • Real Name:Ryan

Posted 02 December 2003, 16:36

I have installed the package and have been trying to solve this problem (any help would be greatly appreciated):

I can not add the item to the cart only the slaves are added to the cart, when I change in product_info.php
if ($product_master['products_price']!= '0')

it switches and only the product adds to the cart and not the slaves???? :blink:

Thanks again.

#30 cannuck1964

  • Corporate Sponsor
  • 1,108 posts
  • Real Name:Peter McGrath
  • Gender:Male
  • Location:Ontario, Canada

Posted 02 December 2003, 18:45

I am looking at this contribution, and am not quite sure what it does. I thought that you can create a master product, and then create a slave product which has all of the master info already added in...

but it seems like the master is it's own product and the slaves are just another product...

what is the association??

I was looking to create a master product, and then the slaves would have the exact same info....

but it seems that each slave has to be totally added in via the admin....just like a regular product.....

if this is the case, why have the association? Just for the quantity changes??
Peter McGrath
-----------------------------
See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation



#31 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 02 December 2003, 20:08

One use: attributes with stock handling. Make the Master a T-shirt w/ whatever on it. Make the slaves sizes. Now people can order multiple sizes on the same page and stock will be updated as needed. Good for someone who sells to school sports teams or other club like activities (i.e. in bulk with multiple sizes).

Second use: bundling. Make the Master a Gift Basket. Make the slaves into different gift items to go with the basket. Future versions may allow you to charge for the basket (the current version of the code would give away the basket for free) or you could change the code yourself.

Hth,
Matt

P.S. Couldn't you do what you were suggesting with the existing product copy mechanism? I.e. pick a product as a template and copy it to a new product with the same info then change as necessary?

#32 marcus76

  • Community Member
  • 160 posts
  • Real Name:Marc

Posted 02 December 2003, 23:13

Hi,

I've installed this contrib. Wondering if someone could tell me how best to change the background of the box that lists the slave products? My background is black throughout the site with white text, i have been through the stylesheets and nothing there!

As this is a contrib that puts a new box on the product page would it be controlled within the new code? - had a look there too but couldnt see anything obvious. Pls i'm about to go live and enter all the products in but not much good if i cant see the slave products. Current master/slave box colour is white, text is white so appears that nothing is listed!!

Many thanks.

#33 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 03 December 2003, 04:22

It should get its color from the same place as the product listings, unless it's changed since the version that I installed. The CSS classes would be TD.productListing-data and the TR.productListing-odd and TR.productListing-even.

Hth,
Matt

#34 marcus76

  • Community Member
  • 160 posts
  • Real Name:Marc

Posted 03 December 2003, 09:20

thanks Matt, i'll take a look tonight.

#35 ringman57

  • Community Member
  • 10 posts
  • Real Name:Anthony DeSalvatore

Posted 03 December 2003, 21:12

media1, on Dec 2 2003, 12:36 PM, said:

I have installed the package and have been trying to solve this problem (any help would be greatly appreciated):

I can not add the item to the cart only the slaves are added to the cart, when I change in product_info.php
if ($product_master['products_price']!= '0')

it switches and only the product adds to the cart and not the slaves???? :blink:

Thanks again.
Did you ever get an answer for this? I am having the same problem....

#36 Jeremy

  • Community Member
  • 22 posts
  • Real Name:Jeremy

Posted 03 December 2003, 21:49

First of all, this contribution is great. There is just one more thing I wish I code for it, and I was wondering if anyone could help.

Ok...I will be selling t-shirts, so I will use the sizes as an example for my slave products here. I would like it if when a slave products quantity reached 0, it would still be listed, but you just would not be able to add it to your cart. This is what my slave set up looks like in the product info page to begin with:

Model-------------------------Buy now

Small-----------------------------[0]
Medium --------------------------[0]
Large-----------------------------[0]

----------------------------Add to Cart


Ok, now say I ran out of medium shirts, I'd like something like this to show up (I use the model type for the size, so when I say medium within the example, it's just the model.

Model-------------------------Buy now

Small-----------------------------[0]
Sorry, we're all out of Medium!
Large-----------------------------[0]

----------------------------Add to Cart


If anyone could help me with that, I would be so grateful.

#37 marcus76

  • Community Member
  • 160 posts
  • Real Name:Marc

Posted 03 December 2003, 23:35

think i saw some post somewhere related to changing the quantity select drop down box to a box which accepts a typed quantity - anyone know the code i could change to display this box?

#38 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 04 December 2003, 00:15

marcus76, on Dec 3 2003, 06:35 PM, said:

think i saw some post somewhere related to changing the quantity select drop down box to a box which accepts a typed quantity - anyone know the code i could change to display this box?
Change (around line 165 of product_info.php):
tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute);
to
tep_draw_input_field('id[' . $products_options_name['products_options_id'] . ']', $selected_attribute);
If that doesn't work, try removing , $selected_attribute.

Hth,
Matt

#39 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 04 December 2003, 00:53

Jeremy, on Dec 3 2003, 04:49 PM, said:

I would like it if when a slave products quantity reached 0, it would still be listed, but you just would not be able to add it to your cart.
Around lines 57-9 of includes/modules/master_products.php, comment out
        /*case 'MASTER_LIST_QUANTITY':
          $select_column_list .= 'p.products_quantity, ';
          break;*/
Around line 69, add p.products_quantity, just before p.products_id in the $master_sql definition, so it looks like this:
      $master_sql = "select  " . $select_column_list . " p.products_quantity, p.products_id,  p.manufacturers_id, p.products_model, p.products_image, p.products_tax_class_id, pd.products_name, s.specials_new_products_price, s.status, p.products_price, p.products_master, m.manufacturers_name from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id !=" . (int)$HTTP_GET_VARS['products_id'] . " and p.products_id = pd.products_id and p.products_master = '" . $thisquery['products_master'] . "' and p.manufacturers_id = m.manufacturers_id and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";
Around lines 159-186 of includes/modules/master_listing.php, change the buy_now case to (by adding if and new code in else):
          case 'MASTER_LIST_BUY_NOW': 
        if ($listing['products_quantity'] > 0) {
        echo '<form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_slave', 'NONSSL') . '">';
            $lc_align = 'center'; 
            $lc_valign = 'top'; 
            $lc_text = '<select name="Qty_ProdId_' . $listing['products_id'] . '" value="0" class="main" style="width: 40px">
                                                     <option value="0">0</option>
                                                     <option value="1">1</option>
                                                     <option value="2">2</option>
                                                     <option value="3">3</option>
                                                     <option value="4">4</option>
                                                     <option value="5">5</option>
                                                     <option value="6">6</option>                                                                       
                                                     <option value="7">7</option>
                                                     <option value="8">8</option>                                                                       
                                                     <option value="9">9</option>
                                                     <option value="10">10</option>                                                                     
                                                     <option value="11">11</option>
                                                     <option value="12">12</option>                                                                   
                                                     <option value="13">13</option>
                                                     <option value="14">14</option>                                                                             
                                                     <option value="15">15</option>
                                                     <option value="16">16</option>                                                                     
                                                     <option value="17">17</option>
                                                     <option value="18">18</option>                                                                     
                                                     <option value="19">19</option>
                                                     <option value="20">20</option>                                                                     
                         </select>'; 
        } else {
            $lc_align = 'center'; 
            $lc_valign = 'top'; 
            $lc_text = TEXT_OUT_OF_STOCK;
        }
break;
To includes/languages/english/product_info.php (or whatever language) add
  define('TEXT_OUT_OF_STOCK', 'Out of stock');
Edit wording as desired.

Hth,
Matt

#40 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 04 December 2003, 01:07

iiinetworks, on Dec 3 2003, 07:15 PM, said:

marcus76, on Dec 3 2003, 06:35 PM, said:

think i saw some post somewhere related to changing the quantity select drop down box to a box which accepts a typed quantity - anyone know the code i could change to display this box?
My previous post was incorrect. the place where you would make the change would be in includes/modules/master_listing.php, replace lines 163-185 with a new definition for $lc_text:
$lc_text = tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0');
Hth,
Matt