Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Master Products - MS2


2398 replies to this topic

#381 iveo

  • Community Member
  • 77 posts
  • Real Name:Gerhard Wernigg

Posted 31 March 2004, 15:48

Johnson, on Dec 2 2003, 06:43 AM, said:

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.
which "copy to" button - cant see it?! :huh:

#382 Tim_Doyle

  • Community Member
  • 24 posts
  • Real Name:Tim Doyle
  • Location:Peoria, IL USA

Posted 31 March 2004, 16:03

Johnson, on Nov 26 2003, 06:17 AM, said:

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

#383 spib

  • Community Member
  • 45 posts
  • Real Name:James Spibey
  • Location:Nottingham, UK

Posted 31 March 2004, 16:39

BTW, I eventually got this working on my own

[img]http://www.GMPerformance.org/screenie.jpg[/img]

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 :)

#384 talon177

  • Community Member
  • 409 posts
  • Real Name:Talon

Posted 31 March 2004, 17:01

Tim_Doyle, on Mar 31 2004, 12:03 PM, said:

Johnson, on Nov 26 2003, 06:17 AM, said:

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

#385 Tim_Doyle

  • Community Member
  • 24 posts
  • Real Name:Tim Doyle
  • Location:Peoria, IL USA

Posted 31 March 2004, 17:09

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

#386 dblake

  • Community Member
  • 875 posts
  • Real Name:Dennis

Posted 31 March 2004, 18:32

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

#387 rustin

  • Community Member
  • 32 posts
  • Real Name:rustin

Posted 31 March 2004, 18:56

I hate to bring this up again, but I'm on pins and needles. Any word on MP 2.0?

#388 dblake

  • Community Member
  • 875 posts
  • Real Name:Dennis

Posted 31 March 2004, 19:02

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

#389 talon177

  • Community Member
  • 409 posts
  • Real Name:Talon

Posted 31 March 2004, 19:12

2.0 Should be coming soon, johnson's a pretty busy guy.

#390 talon177

  • Community Member
  • 409 posts
  • Real Name:Talon

Posted 31 March 2004, 19:15

dblake, on Mar 31 2004, 03:02 PM, said:

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.

#391 Johnson

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

Posted 31 March 2004, 21:17

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
Matti Ressler

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

#392 iveo

  • Community Member
  • 77 posts
  • Real Name:Gerhard Wernigg

Posted 01 April 2004, 08:54

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:

[img]http://download.tech4sports.net/osc/asis.gif[/img]

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

[img]http://download.tech4sports.net/osc/asshouldbe.gif[/img]

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:

#393 Johnson

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

Posted 01 April 2004, 09:42

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
Matti Ressler

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

#394 iveo

  • Community Member
  • 77 posts
  • Real Name:Gerhard Wernigg

Posted 01 April 2004, 09:50

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:

[img]http://download.tech4sports.net/osc/asshouldbe.gif[/img]

: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, 01 April 2004, 09:52.


#395 Johnson

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

Posted 01 April 2004, 09:55

Better! :D That looks as it should.

Matti
Matti Ressler

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

#396 iveo

  • Community Member
  • 77 posts
  • Real Name:Gerhard Wernigg

Posted 01 April 2004, 11:11

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 . '&nbsp;&nbsp;' . 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, 01 April 2004, 11:14.


#397 Johnson

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

Posted 01 April 2004, 11:34

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
Matti Ressler

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

#398 iveo

  • Community Member
  • 77 posts
  • Real Name:Gerhard Wernigg

Posted 01 April 2004, 11:39

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 . '&nbsp;&nbsp;' . 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, 01 April 2004, 11:42.


#399 Johnson

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

Posted 01 April 2004, 11:44

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
Matti Ressler

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

#400 iveo

  • Community Member
  • 77 posts
  • Real Name:Gerhard Wernigg

Posted 01 April 2004, 11:58

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?