Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

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

Thanks for the advice, Matti. I downloaded, moded and uploaded the new product_info.php page and I'm now SOOO close to having this thing working EXACTLY how I want it to!

 

I have a demo of the Duplicate Add to Cart feature working in a way that I suspect we can handle at least.

 

If you look at my Smokers Cease Fire Butt Can (a product that uses the Master/Slave relationship) you'll see that 1) The duplicate button is still there, but 2) is at the bottom and non functional.

 

Now, look at (sorry... this was the best "regular item" I could find, lol) Anti-Diarrheal Medication, you'll see that the Add to Cart is also there.

 

In playing around with the code, I discovered that I can remove the duplicate "ATC" button at the bottom of a Master/Slave page, but if I do that, then the regular item doesn't have an Add to Cart button. We have quite a tidy sum of both Master/Slave and Regular products, so I really wouldn't like to have to find out what products are Regular products and make them all Master/Slaves... that'd be kind of a pain in the butt.

 

Now I'd imagine that since the duplicate ATC button is at the bottom of the page and doesn't work, we could probably handle it being there... but it looks a bit redundant. So my PHP pros... any ideas? E-Mail me, PM me, IM me on AOL... I don't care, but if anyone has any suggestions for me, I'd really appreciate it. :)

 

Sorry for talking so long... hope you can help me.

"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 just tried to add a "regular product" to my cart on the new product_info page and it won't add to cart... it says "add_slave" at the end of the URL that comes up in my status bar (IE6) and since there is no slave, it adds nothing to the cart. :( I get three steps forward and five steps back with this, it seems!! Might I just have to make all of our regular products into a master/slave? Can someone help me? It would be a ROYAL pain in the butt, but if I absolutely have to do it, I guess I can. :(

 

Frustratedly Yours,

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

(To Iveo) So I don't have a busted cart then??

 

(To All) FYI, the page I linked to above is on the live site, but not public... it's just a test page until I can know for certain that the page IS working correctly at which point I will push it live.

 

We're getting there, y'all!

 

td

"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

Kvasir and iveo,

 

I think you are missing something. If I remember correctly, the ability to turn off the stock level requirement so that an 'out of stock' item can be ordered is a OSC option you can set in Admin and has nothing to do with MasterProducts. If I am wrong then I apologize.

 

Everyone, please,

 

Remember, this is a freeware contribution and Matti has a business he is setting up an running. One should take care of self first, family second and community third. I personally need in the worst kind of way the version 2 he is working on but respect his need to do for himself first so I don't press him with ANY questions. If I had the time myself I would certainly do so despite my limited php knowledge, but I too have a business and family to support. We all got there by hacking the code to learn and you can too given the right amount of time. No one is required to use any contributions, it is a personal choice, so please be patient. Your clients need to understand that or you should not offer them something that you know is not 100% available and then press Matti for results. He will never get finished if he has to keep troubleshooting everyone else' problems.

 

There is a legend of a old opal miner who had a favorite cat. The cat died, so he wrapped it in his favorite hat, buried it in his opal mine and abandoned the claim. About sixty years later, two young fellows took over the claim and in their exploration they found an opalized cat wrapped in a hat. Be nice to Matti. He is an opal miner with international connections and friends in the Outback who often have an unusal sense of justice. I personally would love to have a black market company rivaling deBeers and specializing in top quality opal rough in shades of 'Soylent Green'! :lol:

 

Best of luck,

Charles

We stand in ignorance only for questions not asked. Plug up the leaks in your knowledge base and open up a flood of understanding.
Link to comment
Share on other sites

Kvasir and iveo,

 

I think you are missing something.  If I remember correctly, the ability to turn off the stock level requirement so that an 'out of stock' item can be ordered is a OSC option you can set in Admin and  has nothing to do with MasterProducts.  If I  am wrong then I apologize.

 

[...]

 

Charles

hi charles, you are right, it is an option of OSC, and it works for "normal products".

But if you use Master/Slave-Products "out of stock products" can not bei ordered.

 

The way to order slave-products bases upon the stock-level.

This is a great feature if you use your shop that way.

 

I dont want to have a new feature, i want to turn off one ;)

 

 

I hope it will be a small modification to turn off the stock level requirement.

 

 

P.S.: i know that it is a great contribution, and i can imagine how many hours of work are required.

But my question was sent to the community, not to the author himself.

I dont want to press anyone with questions, but i think this is the right place to ask!?! :huh:

 

If there is any chance to modify this contribution? Thank you for all ideas.

 

---dictionary closed ;)

 

Kvasir

Link to comment
Share on other sites

In regard to the stock option - it is already posted here how to have a quantity box rather than a drop menu :blink:

 

I just tested again on a fresh install - I dropped the Master Products directory into my *fresh* installation, ran the SQL - it functions as expected.

 

Tim, your extra button is in master_listing.php - please replace it with the new one... 'add_slave' is correct and will add the master if you have the correct <form> specs - check your product_info.php with the new and also your application_top.php under 'add_slave'.

 

At present, the Master product can have attributes - as I posted earlier, I have set my Easter break to work on this..... as much as I need a real break altogether :blink:

 

Thankyou,

 

Matti

Link to comment
Share on other sites

40 pages later ;)

 

ok, i have a quantity box.

 

But the basic problem:

 

I want to be able to order products whit stock = 0 , or: i want to order products whitout checking the stock.

 

I tried to comment out the following lines in master_listing.php

 

 

if (tep_get_products_stock($listing['products_id']) < 1) { 
           $lc_text = TEXT_STOCK;
          break;
           } else

 

after that my slaves whit stock = 0 were available, but my "normal" products - which are usualy configured in OSC-admin to order whit stock = 0 - could not be added to cart.

 

:( i only want to switch off all stock-checking

 

Thanks and Greets,

Kvasir

Link to comment
Share on other sites

Kvasir, look at admin > Configuration > Stock. For more help, I would recommend looking the General Support forum or Installation & Configuration forum. There would be more discussion about stock handling for regular products there (there is also a section in the Collaborative Documentation Effort).

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

I wanted to use Master Products with attributes such that attributes associated with the Master Product would apply to the slaves. First, I updated to the newest version of the contribution (1.1.4); this allows for the recognition of attribute choices on pages with slave listings. I also made seven changes across four files. In catalog/shopping_cart.php, around line 88, change

where pa.products_id = '" . $products[$i]['id'] . "'

to

where (pa.products_id = '" . $products[$i]['id'] . "' or pa.products_id = '" . $products[$i]['master'] . "')

In catalog/includes/classes/shopping_cart.php, around line 273, change

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

to

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_tax_class_id, p.products_master from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$products_id . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_master");

and around line 293, add

                                     'master' => $products['products_master'],

In catalog/includes/classes/order.php, around line 224, add

                                        'master' => $products[$i]['master'],

Around line 230, change

            $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");

to

            $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where (pa.products_id = '" . (int)$products[$i]['id'] . "' or pa.products_id = '" . (int)$products[$i]['master'] . "') and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'");

In checkout_process.php, around line 182, change

where pa.products_id = '" . $order->products[$i]['id'] . "'

to

where (pa.products_id = '" . $order->products[$i]['id'] . "' or pa.products_id = '" . $order->products[$i]['master'] . "')

Around line 191, change

$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");

to

$attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where (pa.products_id = '" . $order->products[$i]['id'] . "' or pa.products_id = '" . $order->products[$i]['id'] . "') and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

Kvasir and iveo,

 

I think you are missing something.? If I remember correctly, the ability to turn off the stock level requirement so that an 'out of stock' item can be ordered is a OSC option you can set in Admin and? has nothing to do with MasterProducts.? If I? am wrong then I apologize.

 

[...]

 

Charles

hi charles, you are right, it is an option of OSC, and it works for "normal products".

But if you use Master/Slave-Products "out of stock products" can not bei ordered.

[...]

 

Kvasir

hi ecartz,

 

I have checked the configuration of stock in OSC-admin several times - and they are working whit "normal" products - but not for master/slaves.

 

I think the masterproducts-code grabs the stock-level somewhere else thats is not based on the admin-configuration.

 

I will try a new fresh installation to minimize source of errors.

 

Kvasir

Link to comment
Share on other sites

ecartz

 

I wanted to use Master Products with attributes such that attributes associated with the Master Product would apply to the slaves. First, I updated to the newest version of the contribution (1.1.4); this allows for the recognition of attribute choices on pages with slave listings

 

Does this mean that with v1.1.4 slaves can now have attributes of their own or at present do they only have the attributes of the master?

 

Thanks,

Charles

We stand in ignorance only for questions not asked. Plug up the leaks in your knowledge base and open up a flood of understanding.
Link to comment
Share on other sites

For those who wish to sell out of stock items..... in admin->configuration->stock you must set 'check stock level' to 'false'..... and....

 

In catalog/includes/master_listing.php:

 

 ? ? ? ? ?case 'MASTER_LIST_BUY_NOW': 

? ? ? ? ? ?$lc_align = 'center'; 
? ? ? ? ? ?$lc_valign = 'top';
? ? ? ? ? ?if ((STOCK_CHECK == 'true')&&(tep_get_products_stock($listing['products_id']) < 1)) { 
? ? ? ? ? ?$lc_text = TEXT_STOCK;
? ? ? ? ?} elseif ((STOCK_CHECK == 'false')&&(tep_get_products_stock($listing['products_id']) < 1)) {
? ? ? ? ? ?$qty_array = array();
? ? ? ? ? ?for ($i=0; $ns = 20, $i <= $ns; $i++) {
? ? ? ? ? ?$qty_array[] = array('id' => $i, 'text' => $i); 
? ? ? ? ? ? 
? ? ? ? ? ?$lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $qty_array);
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?}
? ? ? ? ?} else {
? ? ? ? ? ?$quantity = tep_get_products_stock($listing['products_id']); ?
? ? ? ? ? ?$qty_array = array();
? ? ? ? ? ?for ($i=0; $ns = (($quantity < 20) ? $quantity : 20), $i <= $ns; $i++) {
? ? ? ? ? ?$qty_array[] = array('id' => $i, 'text' => $i); 
? ? ? ? ? ? 
? ? ? ? ? ?$lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $qty_array);
? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?} 
? ? ? ?}
? ? ? ? ? break;
? ? ? ?}

 

Please do not post back here saying it does not work - it does :P

 

Matti

Edited by Johnson
Link to comment
Share on other sites

Does this mean that with v1.1.4 slaves can now have attributes of their own or at present do they only have the attributes of the master?

No - it means that the master can have attributes - you shall be the first to know when slaves can : )

 

Matti

Link to comment
Share on other sites

Here is the code for product_info.php for those who wish to checkout out of stock items:

 

<?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); 
}
?>
     <tr>
       <td align="right" class="main"><?php if ($product_info['products_quantity'] > 0) {
     echo TEXT_QUANTITY . '  ' . tep_draw_pull_down_menu('Qty_ProdId_' . $product_info['products_id'], $qty_array); 
     } elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) {
    	 $qty_array = array();
           for ($i=0; $ns = 20, $i <= $ns; $i++) {
           $qty_array[] = array('id' => $i, 'text' => $i); 
       }     
     echo TEXT_QUANTITY . '  ' . 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>
     </tr>
<?php
}
?>

 

Matti

Link to comment
Share on other sites

After running easy populate with master products, my category links do not work. for example, if i click on the category on the left, it brings up the category, but says there are no products in the category....is this related to easy populate or master products? does anyone know how to correct the links or database?

 

thanks,

Tim

Link to comment
Share on other sites

you shall be the first to know when slaves can : )

 

Ooooh, I'm all goosebumpy! My subterranean water canon idea must have been a good one. :lol:

 

Plane got cancelled for weather so I got a free day to get ahead. Let me know if you need someone 'opalized'. B)

 

charles

We stand in ignorance only for questions not asked. Plug up the leaks in your knowledge base and open up a flood of understanding.
Link to comment
Share on other sites

I am still unclear on one thing that is stopping me from celebrating.

 

If I have a Slave A, can Slave A be a Slave of both Master A and Master B?

 

Does the dup function mentioned earlier on the thread dup the product, or create multiple instances of it's slave status.

 

If it duplicates the product, I cannot see how to properly maintain inventory control, as Slave A will have multiple part numbers which need to be managed.

Link to comment
Share on other sites

Hi, We would like to see an example of the master / Slave contribution on an active store before we install it. Can someone give us the name of a store and how to get there?

 

Thanks,

 

Christophe

Link to comment
Share on other sites

I am still unclear on one thing that is stopping me from celebrating.

 

If I have a Slave A, can Slave A be a Slave of both Master A and Master B?

 

Does the dup function mentioned earlier on the thread dup the product, or create multiple instances of it's slave status.

 

If it duplicates the product, I cannot see how to properly maintain inventory control, as Slave A will have multiple part numbers which need to be managed.

This is on the to-do list along with attributes.

 

Matti

Link to comment
Share on other sites

Hi, We would like to see an example of the master / Slave contribution on an active store before we install it. Can someone give us the name of a store and how to get there?

 

Please don't double post. Answer is in your forum thread.

 

Your Thread

 

Charles

We stand in ignorance only for questions not asked. Plug up the leaks in your knowledge base and open up a flood of understanding.
Link to comment
Share on other sites

Johnson, thank you very much for your excellent contribution! :)

 

I am curios to know if it is possible to revise the contribution to handle situations like this:

 

If I have a product (master product) like 1,000 blank CDs that I want to sell in 2 options (attributes):

- Full pack - 100 pcs. ($25)

- Half pack - 50 pcs. ($12.50)

 

And I need that whenever a customer choose the pack type, the correct amount of pcs. will be deducted from the master product stock of course.

 

Is it possible to revise the contribution or maybe add this option?

 

Thanks in advance, and keep up the great job! ;)

Link to comment
Share on other sites

I'm such a rookie.... :huh:

 

 

I follwed the instructions carefully, however when I attempt to go to my admin page via the browser, I get this error message:

 

*************************

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/tes/www/covert/catalog/admin/includes/application_top.php on line 126

 

Fatal error: main(): Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/local/share/pear:/usr/local/lib/php') in /home/tes/www/covert/catalog/admin/includes/application_top.php on line 126

*************************

 

I've spent the lat few hours trying to fix it and can't seem to get it. Help anyone? :(

Edited by Tes
Link to comment
Share on other sites

Johnson, earlier you had code up to allow the checkout of items that were not in stock (if it was set to false in admin). Are both codes snippets needed: '.../includes/modules/master_listing.php' AND '...product_info.php'? If so, where do they go in the code, or does it not matter?

Link to comment
Share on other sites

I'm such a rookie.... :huh:

 

 

I follwed the instructions carefully, however when I attempt to go to my admin page via the browser, I get this error message:

 

*************************

Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /home/tes/www/covert/catalog/admin/includes/application_top.php on line 126

 

Fatal error: main(): Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/local/share/pear:/usr/local/lib/php') in /home/tes/www/covert/catalog/admin/includes/application_top.php on line 126

*************************

 

I've spent the lat few hours trying to fix it and can't seem to get it. Help anyone? :(

I looks as though you have used a catalog side application_top.php in your admin side - they are two different files with the same name :blink: The contribution only makes changes here on the catalog side - simply replace your admin/includes/application_top.php with a fresh file :)

 

Matti

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