Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

It is also possible, as an example, in product info.php, to change both instances of:

 

if ($product_master['product_master_status']!= 1)

 

to:

 

if ($product_master['products_price']!= '0')

 

This would make an add to cart button appear for the Master if a price for it is added in admin - I believe I left the product price field intact with this thought in mind........ while the Slaves can be purchased in their respective quantities also. This would make it possible to have the Nurses' Outfit as the Master Product - purchasable, and the separate parts of the outfit also purchasable in whatever quantity is selected - the customer may choose either option.... or, imagine a carburettor, and all its separate parts....  B)

 

This contribution will undergo continued development based to a large degree on feedback from these forums.  I released version 1 as I saw it as usable as it stands - there is much still in the pipeline, and that list grows daily  :D

 

Matti

I've replaced the code shown on my product_info.php exactly as it's shown and it continues to show the top add to cart button. Not only that, but it adds the master instead of the slave... When I first made that edit, it worked exactly as it was to have worked, but then when I logged into my cart to place an order, it crapped out on me.

 

Am I really doing something wrong? Here is my code, as it is supposed to appear:

<!-- Master Products //-->      
<?php if ($product_master['products_price']!= '0') { ?> 
              <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td></form>
<?php
}
?>

 

The code isn't live since the site is live and would not work correctly if I had the edited code live.

 

OSC is great and Master products really does make the cart work how it should, but the two are giving me an ulcer at the moment. I just want to have the cart work how my boss wants to see it so he'll be happy.

 

HELP ME!!! HELP ME!!!

Tim :(

"Success has nothing to do with what you gain in life or accomplish for yourself. It's what you do for others."

 

- Danny Thomas, founder of St Jude Children's Research Hospital

Link to comment
Share on other sites

BTW, I eventually got this working on my own

 

screenie.jpg

 

Basically, because of the layout of the database, you can't do it through 1 SQL query. What I ended up doing instead was just selecting the masters out first, then for each master do a sub-query for all it's children and then print those out.

 

I realise it's not terribly efficient but I still get page load times of less than 1s and my customer is very happy :)

Link to comment
Share on other sites

It is also possible, as an example, in product info.php, to change both instances of:

 

if ($product_master['product_master_status']!= 1)

 

to:

 

if ($product_master['products_price']!= '0')

 

This would make an add to cart button appear for the Master if a price for it is added in admin - I believe I left the product price field intact with this thought in mind........ while the Slaves can be purchased in their respective quantities also. This would make it possible to have the Nurses' Outfit as the Master Product - purchasable, and the separate parts of the outfit also purchasable in whatever quantity is selected - the customer may choose either option.... or, imagine a carburettor, and all its separate parts....?  B)

 

This contribution will undergo continued development based to a large degree on feedback from these forums.? I released version 1 as I saw it as usable as it stands - there is much still in the pipeline, and that list grows daily?  :D

 

Matti

I've replaced the code shown on my product_info.php exactly as it's shown and it continues to show the top add to cart button. Not only that, but it adds the master instead of the slave... When I first made that edit, it worked exactly as it was to have worked, but then when I logged into my cart to place an order, it crapped out on me.

 

Am I really doing something wrong? Here is my code, as it is supposed to appear:

<!-- Master Products //--> ? ? ?
<?php if ($product_master['products_price']!= '0') { ?> 
? ? ? ? ? ? ? <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td></form>
<?php
}
?>

 

The code isn't live since the site is live and would not work correctly if I had the edited code live.

 

OSC is great and Master products really does make the cart work how it should, but the two are giving me an ulcer at the moment. I just want to have the cart work how my boss wants to see it so he'll be happy.

 

HELP ME!!! HELP ME!!!

Tim :(

To be safe, you shouldn't edit new code on a live site. Best way is to have a secondary osC for testing =D

Link to comment
Share on other sites

Trying to set up an OSC with the same contributions as the live one (with the standard database) on my Win2K server at home, but I can't get IIS to cooperate (or my router, more than likely). That leaves my live version... backup - backup - backup. Trust me, I'm getting really good at backing up. I asked my boss about making a mirrored version to put on our local network for me to test with & the idea was shot down.

"Success has nothing to do with what you gain in life or accomplish for yourself. It's what you do for others."

 

- Danny Thomas, founder of St Jude Children's Research Hospital

Link to comment
Share on other sites

I have everything working on this except for my all_products.php. It shows all my slave items and I dont want it too... Is there a way to not have the slave products shown on the all_products.php, just the masters? I have searched but haven't found nothing any help plz?

 

Thanks

-Dennis

Link to comment
Share on other sites

Apparently I can't edit my own message to add to it. But the slave products show up in search as well so if there is a way to disable the slave products showing up on that page I would greatly appreciate.

 

Thanks,

-Dennis

Link to comment
Share on other sites

Apparently I can't edit my own message to add to it. But the slave products show up in search as well so if there is a way to disable the slave products showing up on that page I would greatly appreciate.

 

Thanks,

-Dennis

There sure is, a lot of people are currently asking questions that have been resolved in the past 38 pages, as for I also asked these many questions and have been testing master products. Please reread the past 38 questions to find these simple answers.

 

Hopefully be reducing the amount of redudant questions, johnson will be able to work on and complete Master Products v2.0 which we all anticipately wait.

 

For your search, with the help of johnson and others theres a post about this issue i believe somewhere from page 10-20 just look for talon177 post.

Link to comment
Share on other sites

I missed a couple of files in my upload last night :blink:

 

Please use the package just uploaded.

 

Tim, you should use this as it by default will accomodate the Master Product when it is given a price above $0

 

Matti

Link to comment
Share on other sites

Hi - first of all - thanks to Matt!

 

The new version is very good an has good new features - I implemented it and it is like this now:

 

asis.gif

 

I was wondering if it was a big problem to change it around that it works like this:

 

asshouldbe.gif

 

I do I only have to change around in the products_info.php ?

 

 

 

I think it's a little bit more to do - isn't it? - thanks in advance, you do a great job Matt! :huh: :blink:

Link to comment
Share on other sites

You need to download the package I uploaded this morning (I uploaded one last night also - this had omissions) - you should not have two add to cart buttons (replace your master_listing.php with the new one :P )

 

If you use the *new* product_info.php the extra drop menu will appear if the Master has a price.

 

Matti

Link to comment
Share on other sites

i already did it my self - just 5 minutes ago - works great - as i wanted it at the picture above - just had to change a few things in product_info.php

 

thanks - it's so great to have that working!

 

 

now it looks and works like this for me:

 

asshouldbe.gif

 

:D

 

 

And I also did it that it works with the Customer Groups Contrib!

 

(@orangejuice - i'll send you the modified files)

Edited by iveo
Link to comment
Share on other sites

yes - it does - but i still have a problem i am working on:

 

 

if i try to put a normal product or only a slave product from its product_info.php into my basket it doesn't work - it says its empty - im looking for the error but it's heavy for me to find - here is the relevant code:

(i commented out the review function because i dont use it in my shop)

 

<?php if ($product_master != 0) { ?>
<!-- If Master Product != 0 then: -->
     <tr>
   <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<!-- <?php  if ($reviews['count'] > 0) { ?>               
               <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
<?php
}
?> -->
<!--            <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>     Vor?bergehend entfernt!-->
<?php
   if ($product_info['products_price']>0) {
  
   $qty_array = array();
  
   for ($i=0; $n2 = (($product_info['products_quantity'] < 20) ? $product_info['products_quantity'] : 20), $i <= $n2; $i++) {
   
   $qty_array[] = array('id' => $i, 'text' => $i); 
}
?>
<td align="right" class="main"><?php if ($product_info['products_quantity'] > 0) {
     echo TEXT_AMOUNT . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); 
     } else {
     echo TEXT_STOCK;
}
echo tep_draw_separator('pixel_trans.gif', '30', '10');
?>
         </td>
<?php } ?>
<!--            <td class="main" align="right"><?php echo TEXT_AMOUNT; ?><input type="text" name="quantity" value="1" maxlength="3" size="2"></td> -->
<!--            <td class="main" align="right" width="130"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> -->
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
  </tr>
<!-- End Master Products Then -->
<?php } else { ?>
<!-- If Master Products != 0 else: -->
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<!--            <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>     Vor?bergehend entfernt!-->
<?php
for ($i=0; $i<20; $i++) {
$qty_array[] = array('id' => $i+1, 'text' => $i+1);
}
?>                
         <td class="main" align="right"><?php echo TEXT_AMOUNT . tep_draw_pull_down_menu('quantity', $qty_array, 1); ?></td>
               <td class="main" align="right" width="130"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></form></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<!-- End Master Products Else -->
<?php } ?>

 

it basically works - the if master product != 0 ...

 

...but in my else there must be a problem with the selection of a quantity to my basket...

 

the quantity should usually work bec. i changed some value in application_top.php from this

 

$HTTP_POST_VARS['id']))+1

 

to this

 

$HTTP_POST_VARS['id']))+ (int)$HTTP_POST_VARS['quantity']

 

 

 

 

any idea matt? or anyone else? :huh:

 

 

 

//EDIT

 

do i have to enter a <form method=post blablabla ... tag in the elses form???

Edited by iveo
Link to comment
Share on other sites

In your file you should have:

 

    <td width="100%" valign="top"><?php  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') . '">'; ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

and

 

tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array);

 

also, compare your application_top.php with the one in the latest download.

 

Matti

Link to comment
Share on other sites

yes i have all of that and i also already compared application_top.php with mine and added some lines there....

 

 

still have the problem that on a normal products page (so every product which is not set as master) you don't have an amount dropdown list and you dont have an "add to cart" button...

 

...hm

 

by the way - changed back the relevant part to original - looks like this:

(reviews still commented out):

 

      <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<!-- <?php  if ($reviews['count'] > 0) { ?>               
               <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
<?php
}
?> -->
<!--            <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>     Vor?bergehend entfernt!-->
<?php
   if ($product_info['products_price']>0) {
  
   $qty_array = array();
  
   for ($i=0; $n2 = (($product_info['products_quantity'] < 20) ? $product_info['products_quantity'] : 20), $i <= $n2; $i++) {
   
   $qty_array[] = array('id' => $i, 'text' => $i); 
}
?>
   <td align="right" class="main"><?php if ($product_info['products_quantity'] > 0) {
     echo TEXT_AMOUNT . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); 
     } else {
     echo TEXT_STOCK;
}
echo tep_draw_separator('pixel_trans.gif', '30', '10');
?>
         </td>
<?php } ?>
<!--            <td class="main" align="right"><?php echo TEXT_AMOUNT; ?><input type="text" name="quantity" value="1" maxlength="3" size="2"></td> -->
<!--            <td class="main" align="right" width="130"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> -->
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>

 

 

so the add to cart button comes from master_listing.php which is not included if product isnt set to a master status and thats why i dont get any add to cart button with a normal product - am i right? :huh:

Edited by iveo
Link to comment
Share on other sites

No, you don't "have all of that" - look again.

 

The quantity drop menu will appear on a normal product page also.

 

I would suggest that you begin by installing the product_info.php included in the package, then move over your own changes one by one.

 

Matti

Link to comment
Share on other sites

ok - now - i made a backup and then i changed my whole files (the ones affected by masterproducts) with the ones in package master products 1.1.4 that you uploaded.

 

 

 

still no quantity for normal product...

 

... what did i do wrong? - you know the code of your product_info.php - does it work for you?

Link to comment
Share on other sites

i loaded my backup from before again...

 

 

... i have a quantity box on every product page (nicely done btw - shows only what is really in stock - but i think that should be an option bec. many stores also sell things that are out of stock)

 

 

but i dont have an add to card button except for master products

Edited by iveo
Link to comment
Share on other sites

sorry - don't want to get on your nerves matt...

 

...just trying to find out what is wrong - and it seems to be in your script as soon as i tried it out on a clean version of osc2.2ms2 with your original files...

 

...don't be mad with me for asking so much and posting a lot. :o

Link to comment
Share on other sites

Hi all.

 

This is exactly what im searching for, many thanks!

 

After reading the last 40 sites (hard in english) there is only one problem:

 

I tried searching in forum and edit by myself... :

 

 

I wanna be able to check out slaves whit a stock of 0.

If my stock is 0 there is no way to order.

 

 

 

Any ideas?

 

Thx,

Kvasir

Link to comment
Share on other sites

Problems I see with Master Products:

  • You can't have 1 Slave be added to more than one master - if you want that, you have to duplicate the Slave product so if you want the Slave Product to work with 10 different Masters you will have it 10 times in your Products Database.
     
  • If you have one Slave Product more than one time in your database and have turned on the option to view it in product listing - because you also want to sell it alone (without its master(s)) - you will have one same product about 5 times in your listing.
     
  • It is too complicated to manage - I should be able to select a Master Product and then select all of its slaves - and also the other way around - be able to select a Slave Product and then select all of its masters.

And there is still the minor bug that it doesn't show the "Add to Cart" button for normal products and also for slave products.

 

And the "Out of Stock" function should be optional, because some shops work on order with some products - so they don't have them in Stock - e.g. with Master Products they wouldn't be able to sell them.

 

 

 

I think Master Products is one of the greatest and most helpful contributions for many shops out there, but there are still a few things to do. - I'd try to help where I can.

 

 

 

@Matt or other developers of Master Products:

 

Is it possible to make this "whishlist" from above work - where are the problems of doing so? - Would you do it for a donation? :huh:

Edited by iveo
Link to comment
Share on other sites

if stock is null it says out of stock and you cant order - that's already implemented

 

 

;)

sorry, i try to explain again:

 

I want to order slave-products whit a stock = 0

 

in german ;):

 

Produkte die nicht auf Lager sind sollen auch bestellt werden k?nnen.

 

 

We build furniture as a unique, this is the master-product...and customers can order them as uniques in different kinds of wood ( these are the slaves)

So the stock is = 0 , and an order will set them to -1, so we know we have to build this unique.

 

I dont need any feature like the pull-down-menu to order ( I think this takes the quantity from the stock...and its 0 )

 

 

Still bad english, :rolleyes:

 

Kvasir

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