Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

This is a cross post, as I'm not getting a response elsewhere.

I am attempting to install Master Products to osCmax 2.2

 

In catalog/index.php, I was supposed to look for a line, and I found a lot of lines that were similar. I'm not sure if I should just change one, or change them all. I tried changing them all, like so:

// look for //     $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price,                                                   p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL)           as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price)                as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . "               p2c where p.products_status = '1'                                                                                                                                                                                        and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
// replace with // $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status,      p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL)           as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price)                as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . "               p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1'                                                                                                                        and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
//found, altered// $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . "                                                                 p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
           $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status,      p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL)           as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price)                as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . "                                                     p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
                  $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m                                                                                                            where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
                  $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status,      p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL)           as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price)                as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m                                                                                                             where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
                  $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . "                                                                  p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
                  $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status,      p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL)           as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price)                as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . "                                                                   p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
                  $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . "              p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
                  $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status,      p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL)           as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price)                as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";

Should I only be changing one line?

Edited by mraeryceos
Link to comment
Share on other sites

mraeryceos: I have many places where I have placed the code as well, it's not just one line. But, I also have a lot of other contributions like Separate Pricing Per Customer so can't be specific to your situation without seeing the entire index.php to tell you what to do. I believe that what this code does in index is making sure you are only listing master products and not any slaves, thats why it's adding "and p.products_master = '0', its filtering out the slaves and keeping the masters so they are listed and not the slaves. Slaves should be only seen on the product_info.php page, not on the index. My suggestion is just to do some trial and error and backup before you do. That's how I learned and got through everything (and from a lot of help from the great folks on the forums here.) This is my official non-programmer advice! Good luck.

Edited by qxonn
Link to comment
Share on other sites

mraeryceos: I have many places where I have placed the code as well, it's not just one line. But, I also have a lot of other contributions like Separate Pricing Per Customer so can't be specific to your situation without seeing the entire index.php to tell you what to do. I believe that what this code does in index is making sure you are only listing master products and not any slaves, thats why it's adding "and p.products_master = '0', its filtering out the slaves and keeping the masters so they are listed and not the slaves. Slaves should be only seen on the product_info.php page, not on the index. My suggestion is just to do some trial and error and backup before you do. That's how I learned and got through everything (and from a lot of help from the great folks on the forums here.) This is my official non-programmer advice! Good luck.

 

Why would you not want to show Master Products on the index page? This is where you put your big advert efforts for a product selection. The individual products will have only minimal information since no one will ever see it anyway, unless you added the pop-up contribution to this packagae I put up a couple of years ago.

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Sorry, I was referring to Master Products RC2a - V 1.25

http://www.oscommerce.com/community/contributions,1681

 

and osCmax is just osCommerce with added contributions:

http://www.oscmax.com/what_is_oscmax_0

 

not exactly. It is a full fork supported by it's own community and paid-for-support. It has many of its own contributions not available here or only available in outdated or non-supported versions.

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Why would you not want to show Master Products on the index page? This is where you put your big advert efforts for a product selection. The individual products will have only minimal information since no one will ever see it anyway, unless you added the pop-up contribution to this packagae I put up a couple of years ago.

 

George

 

 

You DO want to show Masters. I said that the code doesn't show SLAVES on the index.

Link to comment
Share on other sites

You DO want to show Masters. I said that the code doesn't show SLAVES on the index.

 

You are, of course, correct, I appologize for not reading your post properly. I was looking at the sql that said "p.products_master = '0'" which could be used as a filter to exclude master products in the sql array while looking for products_id that meets certain other criteria.

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

You are, of course, correct, I appologize for not reading your post properly. I was looking at the sql that said "p.products_master = '0'" which could be used as a filter to exclude master products in the sql array while looking for products_id that meets certain other criteria.

 

George

 

Not a problem :-) Thanks for the heads up on the pop-up contribution you added, I missed that earlier and I will check that out for my site.

Link to comment
Share on other sites

It is really pretty straight up, I have tested it on PHP 5.3.6 with register-globals off and register-long-arrays off. But since it was written for an earlier release, let me know if you a)have any problems and B) what release you are using so I can do any needed updates.

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

I'm looking for a better way to list & organize my slave listing to make it easier for the customer to find their product. Has anyone found a way to do custom slave selection instead of a basic list? Let me explain:

 

We sell industrial products on our site and some Masters have over 50+ slaves to them. These slaves usually vary in sizes, say for example a pipe connector will have two ends with two unique sizes. I am trying to figure out a way to sort them easier for the customer, and perhaps even have them enter an initial size to filter the slaves listed.

 

Now here comes the tricky part: We don't just sell products that fit this particular situation. Meaning that some Master & Slaves would require a unique set of circumstances to filter out slaves (size is not an attribute that applies to all of our products). I'm not sure how to go about this.

 

I'm not sure if anything like this exists out there already or if this is remotely possible with how Master Products works. We plan on hiring someone to get this done but would appreciate any input from the "Master Products Guru's" first in regards to feasibility.

 

Much appreciated,

 

Matt

Link to comment
Share on other sites

Friday afternoon, almost finished with the week when I saw this post.

 

After 5 years or so of working with this contribution, I can almost guarantee there is a better way to solve your problem. I have done furniture selections, flavors, colors and a whole host of other things this contribution can do well.

 

Multiple options that require good product filters are not one of them.

 

Look through some of the auto parts suppliers, like o'reilly or autozone for some ideas. (Caution: they use rather common lool-alike designs due to ASP and .NET stock libraries and are amlost impossible to do in .net without a substantial investment in software and/or programmers) Since you are going to contract out the job, find someone that not only knows PHP but is familiar with osCommerce and reasonably familiar with database design and management since that is your choice and you probably already have a substantial investment in time developing a site theme.

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Friday afternoon, almost finished with the week when I saw this post.

 

 

Hi George,

 

Thanks for the quick reply. Aside from product filtering, do you have any input on giving the user a greater ease of use to find their product with Master Products? You mentioned you've done multiple furniture selections, etc and I'd be curious to hear more and how you did that and if you did any customizations or found a way to display the data in a more efficient manner. Any links to examples would be incredible as well.

 

Best,

 

Matt

Link to comment
Share on other sites

Hi George,

 

Thanks for the quick reply. Aside from product filtering, do you have any input on giving the user a greater ease of use to find their product with Master Products? You mentioned you've done multiple furniture selections, etc and I'd be curious to hear more and how you did that and if you did any customizations or found a way to display the data in a more efficient manner. Any links to examples would be incredible as well.

 

Best,

 

Matt

 

Sorry, but I think that would be off-topic here. This forum is primarily for installation problems and user problems associated with the installation and proper operation of the basic Master Slave contribution.

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

  • 2 weeks later...

Hi everyone :)

 

I am trying to add slave prices and model number underneath the Master products on the product_listing page.

After following lot of forums I was able to put this code in

} elseif ($listing['products_master_status'] == '1') {

$results = array();

$slaves = array();

$slave_array = array();

$slave_query = tep_db_query("select p.products_id, products_model, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where products_master = '" . $listing['products_id'] . "' and pd.language_id = '" . (int)$languages_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_model'] . " - " . $currencies->display_price($get_slaves['products_price'], $get_slaves['products_tax_class_id']));

 

$lc_text='<br>Available sizes: <form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_product', 'NONSSL') . '" size="3">' . tep_draw_pull_down_menu('products_id', $slaves);

 

$slave_array[$get_slaves['products_id']] = $get_slaves['products_products_model'];

}

 

However I am trying to get a list instead of the dropdown...I have tried various combinations but failed...please if someone could help me out a bit.

 

Thanks in advance

Simple Add-ons Please add simple plain tips here for others.
Link to comment
Share on other sites

Hi everyone :)

 

I am trying to add slave prices and model number underneath the Master products on the product_listing page.

After following lot of forums I was able to put this code in

 

 

However I am trying to get a list instead of the dropdown...I have tried various combinations but failed...please if someone could help me out a bit.

 

Thanks in advance

 

Let me clarify a little what you are doing. If the master and slave products are in the same category, they would display in a product listing for that category. It is a simple matter to number the display sequence of the products regardless of the product_id. You could, for example, set a master to display sequence 100, then each product assigned to that master a display sequence code like 101, 102, etc.

 

Then the next master would be sequence 200, with its slaves being 201, 202, etc.

 

Depending on your db skills, this could be fairly easily automated by setting a product display to be a combmination of Master prod_id + prod_id or something.

 

This would list the products in the sequence you want, but would not differentiate by a reduced description, with the customer knowing not about a master description until they click on one of the products.

 

If you want the products listed showing only a product_id, size, color, or some other attibute and price, you could use the same method and apply a filter when building your product array, like if prd.. is slave, only do prod_code, prod_price, prod_color and so on.

 

The filter would display only desired information about a product and display all if a Master or non-slave item.

 

None of this, including your code above, will work if you decide to display products in a more efficient 3 or 4 column display as opposed to one-per-line of a default cart.

 

Hope this helps, if I missed completely what you are doing, please post back and of course, hope you will post your progress and success here to add to our knowledge base on using this contribution.

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Looks like a great contribution. I use oscommerce v2.2 RC2. Will I be able to use this contribution and which version?

 

Thank you very much.

 

Gergely needs to jump in on this one, as he knows more about the newer versions than I.

 

The answer depends more on you and your server than what version of osCommerce you are using. Lets look at a couple of conditions:

1.If your server is running php 5.1.x or higher, mySQL is 4.x 5.x;

2. You have been doing decurity updates and generally updating your cart to run on PHP 5.3 or run with register-globals off;

You will probably want to start with the rc2a versions. Gergly can advise on the version for 2.3.

 

I am using a blend of ver. 1.2 and many other fixes from SPPC, Easy Populate and others. Just stay away from the very early version, anything before June 2006, as the early stuff was really buggy and you will spend hours in hudreds of posts on this contribution.

Edited by Geotex

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Need some help getting this to work

 

Once I selected a product in admin and made it a master, then selected second product to be slave to this master product, my catalog doesn't show either of them.

Even if only a master product is created, the master product is not showing up in catalog.

 

Any help appreciated - using 2.2RCa

Edited by Peper

Getting the Phoenix off the ground

Link to comment
Share on other sites

Need some help getting this to work

 

Once I selected a product in admin and made it a master, then selected second product to be slave to this master product, my catalog doesn't show either of them.

Even if only a master product is created, the master product is not showing up in catalog.

 

Any help appreciated - using 2.2RCa

 

 

A couple of places to start looking: 1.(most likely) using phpMyAdmin or another program, look in the products table to be sure the products are entered in the database properly. If not, your problem probably is in code in catalog/admin/categories.php.

 

2. (not likely, as would just show as normal products) If they appear to be entered properly in the database, check your database calls (4 main ones) in catalog/index.php.

 

HTH

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Thanks for reply

 

I found in my table products => products_master that for the master product I added there was no value - all others =0( setting to 1 shows out of stock in catal) so I changed that and product now showing with slave

but now the big question - where to start looking for error why this is caused?

 

I my admin catalog.php file is too long to insert here, but found no errors as what I can make out

 

So guessing the error lies with this file in admin to add the product as master?

 

Any advice please

 

my catalog is looking for that 1 or 0 in products_master field

The piece of code for products_master in index.php

// We show them all
// BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility
       if ($status_product_prices_table == true) {
// original, no need to change for mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
       } else { // either retail or no need to get correct special prices -- changed for mysql 5
       $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_master = '0' and p.products_listing_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; 
     } // end else { // either retail...
// EOF Separate Pricing per Customer 
	}

   }

   if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {

     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {

       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
// BOF Product Sort	
	  $HTTP_GET_VARS['sort'] = 'products_sort_order';
         $listing_sql .= " order by p.products_sort_order asc";
// EOF Product Sort
         break;
       }
     }
   } else {

     $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
     $sort_order = substr($HTTP_GET_VARS['sort'], 1);

     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':

Edited by Peper

Getting the Phoenix off the ground

Link to comment
Share on other sites

Your assumption is correct, the problem is in adding or updating a product as a master and maybe a slave. The area of concern is where the product is marked as in stock or out of stock. ocCommerce uses the following code to mark in or out of stock (taken from RC2a stock install)

 

         <tr>
           <td class="main"><?php echo TEXT_PRODUCTS_STATUS; ?></td>
           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_status', '1', $in_status) . ' ' . TEXT_PRODUCT_AVAILABLE . ' ' . tep_draw_radio_field('products_status', '0', $out_status) . ' ' . TEXT_PRODUCT_NOT_AVAILABLE; ?></td>
         </tr>

 

Odds are pretty good that where ever you put the code for Master products, it is missing the code that defines $in_status. You will find it somewhere under the database calls for new products, around line 406 or higher, depending on changes you made.

 

if (!isset($pInfo->products_status)) $pInfo->products_status = '1';
   switch ($pInfo->products_status) {
     case '0': $in_status = false; $out_status = true; break;
     case '1':
     default: $in_status = true; $out_status = false;
   }

 

This has to be called before displaying the new or edit page for master products to set products_staus to zero. As you found out, the code looks for 0 or 1, and will not treat a null as 0.

 

So, 2 places that could generate the error. I cannot be more specific as I started out with separate code to define regular products and master/slave products, then combined all the code when I added tabs and html text editors to my admin sections.

 

I guess if you can't get this working, you can pm me your categories.php and I will take a look at it as time permits.

 

George

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

I am sure I read somewhere that when you have your master set at no price/no quantity that it should not show 'products out of stock'. If that is true, how come it still shows up? Doesn't look very good to have the master say that products are out of stock, while the slaves still have products.

What do I need to fix?

 

Thanks,

 

Marianne

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