Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Master Products - MS2


Guest

Recommended Posts

That didn't work either, I took a look at my shopping_cart.php and know why it wont work, but don't know how to fix it. My shopping_cart.php was modified from installing the option_type_feature to allow me to use text boxes for attributes. Here is the new add_cart function:

    function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
     global $new_products_id_in_cart, $customer_id;

     $products_id = tep_get_uprid($products_id, $attributes);
     if ($notify == true) {
       $new_products_id_in_cart = $products_id;
       tep_session_register('new_products_id_in_cart');
     }

     if ($this->in_cart($products_id)) {
       $this->update_quantity($products_id, $qty, $attributes);
     } else {
       $this->contents[] = array($products_id);
       $this->contents[$products_id] = array('qty' => $qty);
// insert into database
       if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')");

       if (is_array($attributes)) {
         reset($attributes);
         while (list($option, $value) = each($attributes)) {
           //CLR 020606 check if input was from text box.  If so, store additional attribute information
           //CLR 020708 check if text input is blank, if so do not add to attribute lists
           //CLR 030228 add htmlspecialchars processing.  This handles quotes and other special chars in the user input.
           $attr_value = NULL;
           $blank_value = FALSE;
           if (strstr($option, TEXT_PREFIX)) {
             if (trim($value) == NULL)
             {
               $blank_value = TRUE;
             } else {
               $option = substr($option, strlen(TEXT_PREFIX));
               $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES);
               $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID;
               $this->contents[$products_id]['attributes_values'][$option] = $attr_value;
             }
           }

           if (!$blank_value)
           {
             $this->contents[$products_id]['attributes'][$option] = $value;
// insert into database
           //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes.
           //CLR 030228 add tep_db_input() processing
             if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
           }
         }
       }
     }
     $this->cleanup();

// assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure
     $this->cartID = $this->generate_cart_id();
   }

And here is the master_listing part for the text box:

case 'MASTER_LIST_SIZE':
	 $lc_align = 'center';
	 $lc_text = '';	
	 $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_length from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and popt.products_options_name = 'Ring Size' and patrib.options_id = popt.products_options_id and popt.language_id = 1");
	 $products_options_name_values = tep_db_fetch_array($products_options_name); 
	 $lc_text = '<input type="text" name="id_'  . TEXT_PREFIX . $listing['products_id'] . '[' . $products_options_name_values['products_options_id'] . ']" size="' . $products_options_name_values['products_options_length'] .'" maxlength="' . $products_options_name_values['products_options_length'] . '" value="' . $cart->contents[$listing['products_id']]['attributes'][$products_options_name['products_options_id']] .'">';
	 break;

 

Thanks for the help,

Ryan

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Brian, I didn't have to modify application_top to install option_type_feature. If I use your application top and I have products without slaves but with attributes, none of them are added to the cart. But when I use the original one, they are. Now that I am thinking of it, I will have to chage the way they are set up to get them to work also.

Ryan

Edited by ryanf

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Ryan, I don't have any masters without slaves. They are either normal products or masters with slaves. To fix this in product_info.php (only when viewing a master product) where you are displaying the masters options change

name ="id['    to    name ="id_' . $HTTP_GET_VARS['products_id'] . '['

I've also noticed something wrong with this code you posted

case 'MASTER_LIST_SIZE':
 $lc_align = 'center';
 $lc_text = ''; 
 $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_length from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and popt.products_options_name = 'Ring Size' and patrib.options_id = popt.products_options_id and popt.language_id = 1");
 $products_options_name_values = tep_db_fetch_array($products_options_name); 
 $lc_text = '<input type="text" name="id_'  . TEXT_PREFIX . $listing['products_id'] . '[' . $products_options_name_values['products_options_id'] . ']" size="' . $products_options_name_values['products_options_length'] .'" maxlength="' . $products_options_name_values['products_options_length'] . '" value="' . $cart->contents[$listing['products_id']]['attributes'][$products_options_name['products_options_id']] .'">';
 break;

Last two lines should be

  $lc_text = '<input type="text" name="id_'  . $listing['products_id'] . '[' . TEXT_PREFIX . $products_options_name_values['products_options_id'] . ']" size="' . $products_options_name_values['products_options_length'] .'" maxlength="' . $products_options_name_values['products_options_length'] . '" value="' . $cart->contents[$listing['products_id']]['attributes'][$products_options_name['products_options_id']] .'">';
 break;

You had TEXT_PREFIX in the wrong place which may have been your original problem. Also change

['attributes']    back to    ['attributes_values']

 

I also changed product_info.php to use the old (pre master_prods) form action if the product wasn't a master.

 

Hope that sheds some light.

 

Brian.

Link to comment
Share on other sites

Brian,

 

I have made the changes you suggested but my slaves do not diispay.

$slave_list = array('MASTER_LIST_MODEL' => MASTER_LIST_MODEL, 

                        'MASTER_LIST_NAME' => MASTER_LIST_NAME, 

                        'MASTER_LIST_MANUFACTURER' => MASTER_LIST_MANUFACTURER, 

                        'MASTER_LIST_PRICE' => MASTER_LIST_PRICE, 

                        'MASTER_LIST_QUANTITY' => MASTER_LIST_QUANTITY, 

                        'MASTER_LIST_WEIGHT' => MASTER_LIST_WEIGHT, 

                        'MASTER_LIST_IMAGE' => MASTER_LIST_IMAGE, 

                        'MASTER_LIST_BUY_NOW' => MASTER_LIST_BUY_NOW, 

                          'MASTER_LIST_OPTIONS' => 8,

                        'MASTER_LIST_DESCRIPTION' => MASTER_LIST_DESCRIPTION);

I am not a coder so please bear with me. If I put the original file master_products.php back in my slaves show up. When the code above is in it does not. I do have attibute_sort as an empty field in products_attributes. (is necassary???)

So what should I try for 'MASTER_LIST_OPTIONS' => 8,

And do you have other suggestions?

 

Thank You

Link to comment
Share on other sites

Sweet! Ok, after a few hours of messing around with it, I finally got it working right! I also made it so it shows the table header and based on what attributes the slave has, what shows up. One thing that I assume is that all slave products have the same attributes so if slave 1 has attributes a|b|c|e slave two can't have any attributes that are different such as d, they all must be the same. I guess you could do it your way and have any attributes that you want but I like the layout of my products a little better and know that none of my slaves will have different attributes. Check it out by visiting my page below and clicking on a product. Some products don't have slaves, but you should be able to find some that do easily. Thanks for the help guys.

Edited by ryanf

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

:ph34r: Hi all I hope some can advice on what to do ?????? Please

 

Just a quick question regarding this master products contribution, well ive got bundles of products and i would like to also add this contribution to the bundles offering differnet manufacturers of that one bundle which consists of several products, i would like to have a drop down of different manufacturers of the bundle but im sure how to go about doing this as i was told that this is not possible.....

 

eg:

 

I have product name Haicom GPS reciever which consists GPS Receiver

 

Unique PDA connecting lead with carcharger

Mini - 1394 USB cable

Serial Cable

Case

Driver Cd

 

basically these come in the bundle, this is where it gets tricky i now want to add a drop down which shows different manufacturers of this bundle like DELL, HP, IPAc.........and so on which i want to deduct from the inventory, it deducts the items which are in the bundle but does not deduct the attributes of this product ie DELL, HP, IPAC ............ ive added the bundles as different ones to the inventory ie....

 

Haicom GPS reciever bundle consisting of theproducts within that bundle (dell)

Haicom GPS reciever(ipac)

Haicom GPS reciever(HP)

 

and so on, but these are hidden as i do not want 50 different types of the same product on one page just a simple drop down displaying which manufacturer you would like to purchase.

 

Is there something im doing wrong regarding this contribution.....

 

 

 

could someone please help me with the solution..............

 

 

A BIG THANKYOU IN ADVANCE

 

:(

Link to comment
Share on other sites

Sweet! Ok, after a few hours of messing around with it, I finally got it working right! I also made it so it shows the table header and based on what attributes the slave has, what shows up. One thing that I assume is that all slave products have the same attributes so if slave 1 has attributes a|b|c|e slave two can't have any attributes that are different such as d, they all must be the same. I guess you could do it your way and have any attributes that you want but I like the layout of my products a little better and know that none of my slaves will have different attributes. Check it out by visiting my page below and clicking on a product. Some products don't have slaves, but you should be able to find some that do easily. Thanks for the help guys.

That's great Ryan! How much "tweeking" did you have to do?

 

Brain.

Link to comment
Share on other sites

Joe

 

That field name is wrong, I suggest you remove it and replace the attribute processing in master_liisting.php with the code I posted here.

 

Brian.

Link to comment
Share on other sites

I have installed oscommerce twice and Master Products 3 times and still getting the same problem.

 

I am not sure what I am doing wrong.

 

It was working and then it stopped so I installed everything again.

 

It says I can create a Master Product in the admin but when I click to create a product it does not have the check box at the bottom of the New Product Listing to let me select it as a "Master".

 

grrrrrrrrrrrrrrrrrr

 

can someone please help?

Link to comment
Share on other sites

Hey, I will try to post all the changes that I had to do in order to get it working tonight, I can't now since I am at work and the boss don't pay me for that :) I will say that it took me about 5 hours of messing around with it inbetween doing other stuff, and it is highly customized to my code, making it generalized would take a lot of work.

 

proimpulse: you have to click add master product for the checkbox to appear. If you don't have that button, your not installing it right.

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Thanks Ryan!...Silly me was not looking at the right thing.

 

I'm getting this funky TEXT_QUANTITY line beside my select box now.

 

It seems like I get one thing to work and 3 more things mess up :(

Link to comment
Share on other sites

Brian

I removed

'MASTER_LIST_OPTIONS' => 8,

from master_products.php which means there is no additonal code in that file.

 

I have as you suggested to me in master_listing.php I have:

  case 'MASTER_LIST_OPTIONS':

 

          $lc_align = 'align="center"';

$lc_text = '';

          ///////////////////////////////////////////////////////////////////////////

          // BOF: attribute options

          $opt_count=0;

          $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'" . " order by popt.products_options_sort_order"catalog/brian_attribute/);

          while ($products_options_name_values = tep_db_fetch_array($products_options_name)) {

            $opt_count++;

            $products_options_array = array();

            $lc_text .= '<b>' . $products_options_name_values['products_options_name'] . '</b><br />' . "\n";

              $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"catalog/brian_attribute/);

 

            while ($products_options_values = tep_db_fetch_array($products_options)) {

              $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'], 'style' => '');

              if ($products_options_values['options_values_price'] != '0') {

                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') ';

              }

            }

            $lc_text .= tep_draw_attrib_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array);

            $lc_text .= '<br />';

          }

          if($opt_count==0) {

            $lc_text = 'None';

          }

          // EOF: attribute options

          ///////////////////////////////////////////////////////////////////////////

and

  case 'MASTER_LIST_OPTIONS':

      $lc_text = 'Options';

      $lc_align = 'align="center"';

      break;

in master_listing.php

 

and in applcation_top.php I have

//Master Products

    // customer adds multiple products from the master_listing page

    case 'add_slave' :

                            while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {

                              if (substr($key,0,11) == "Qty_ProdId_") {

                                $prodId = substr($key,11);

                                $qty = $val;

                                if(isset($_POST["id_$prodId"]) && is_array($_POST["id_$prodId"])) {

                                  // We have attributes

                                  $cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId,$_POST["id_$prodId"]))+$qty, $_POST["id_$prodId"]);

                                } else {

                                  // No attributes

                                  $cart->add_cart($prodId, $cart->get_quantity($prodId)+$qty);

                                }

                              }

                            }

                            tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

                            break;

    //Master Products EOF

 

And I removed the sort field from products_attributes.

 

When I go to the /catalog/product_info.php page the master shows up and the line

*Please select the quantity for each item you wish to order and click the 'Add To Cart' button below.
shows up but no slave table..

 

Where should I tweak?

 

 

Thank You, Brian.

 

joe

Link to comment
Share on other sites

anthony, check to make sure you made the changes to the language file. Usually, if just TEXT_QUANTITY is showing up, its not finding what that value stands for so it just puts the variable name.

Edited by ryanf

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Great contribution, but the length of this thread is daunting! Have read a total of 32 pages so far!! Before I go any further can someone please answer a question?

 

I have a gift hamper site.

 

My gift hampers may have many items. Each item can be in many hampers. The hampers are for sale and display, the individual items are not (yet). I would like to track the inventory of the items.

 

If I have hampers as masters and items as slaves - will this contribution allow for the many-to-many relationship? (I read it was probably coming but my reading hasn't yet got to the point where it has been incorporated without doing a copy slave which is problematic for inventory recording).

Link to comment
Share on other sites

anthony, check to make sure you made the changes to the language file. Usually, if just TEXT_QUANTITY is showing up, its not finding what that value stands for so it just puts the variable name.

Ryan,

You Da Man!

 

It's working good now!

 

Thanks a bunch :D

Link to comment
Share on other sites

Joe

 

You aren't getting anything because your master_listing.php has syntax errors. I also noticed the code I gave you had an error in it. :rolleyes:

 

Put this line back into master_products.php

'MASTER_LIST_OPTIONS' => 8,

 

This adds a column with sort order 8, the rest of the code is useless without it.

 

Check that none of your other columns are set to sort order 8 in admin.

 

In master_listing.php, replace this:

          $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'" . " order by popt.products_options_sort_order"catalog/brian_attribute/);

with this:

          $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'");

and this:

              $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"catalog/brian_attribute/);

with this:

              $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$listing['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

Brian.

Link to comment
Share on other sites

Hey, ok, I know I told you I would post the changes I made last night, but I never made it. So, for now I just put all the files I had to change in an easy-to-read html file so you guys could look over the changes I had to make to get it to work for ME. Remember its very customized to my site. Also you should note that I have the Option type feature contrib installed that will let me have checkboxs, radio boxes, and text boxes. Some code might be repetitive but it works for me and if it aint broke dont fix it.

 

Here is the html page:

My Files

 

Hopefully you can get an idea of what needs to be done and if you have any questions post em.

 

If you want to see an example of how it looks:

Go Here

 

Good Luck!

Ryan

Edited by ryanf

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Brian,

 

Got the code in place. The problem is I do not have the drop down select field appearing in the slaves.

Form buy_now shows it as id[6]. What do I change/add to make it appear in the slave portion of the form?

 

I appreciate your helping with this most wonderful contribution of yours.

 

joe

Link to comment
Share on other sites

Ryan,

 

Attributes are assigned.

 

Let me clarify: On the master section two drop downs appear and function; qty and grind.

In the slave segment only the qty dropdown appears. I also need the grind to be there.

 

The code is just not putting the option in the table.

 

What am I missing? ( please, don't say "a brain")

 

Thanks for helping. I need to get this one to bed.

 

you can see this at

test site oscommerce

 

 

joe

Link to comment
Share on other sites

first unassign the attribute grind from the master product, you dont want that. The attribute grind must be assigned to each slave.

 

Second post some code, I have no idea what is missing with out seeing it. Dont post the whole master_listing, only the important parts.

If I was crafty, this would be a funny signature.

Link to comment
Share on other sites

Ryan, hope this is the code you are looking for...

 

 

  //brian 

            ////////////////////////////////////////////////////////////// 

    case 'MASTER_LIST_OPTIONS': 

 

          $lc_align = 'align="center"'; 

$lc_text = ''; 

          /////////////////////////////////////////////////////////////////////////// 

          // BOF: attribute options 

          $opt_count=0; 

          $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'" . " order by popt.products_options_sort_order"); 

          while ($products_options_name_values = tep_db_fetch_array($products_options_name)) { 

            $opt_count++; 

            $products_options_array = array(); 

            $lc_text .= '<b>' . $products_options_name_values['products_options_name'] . '</b><br />' . "\n"; 

              $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); 

 

            while ($products_options_values = tep_db_fetch_array($products_options)) { 

              $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'], 'style' => ''); 

              if ($products_options_values['options_values_price'] != '0') { 

                $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') '; 

              } 

            } 

            $lc_text .= tep_draw_attrib_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array); 

            $lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $qty_array) ; 

            $lc_text .= '<br />'; 

          } 

          if($opt_count==0) { 

            $lc_text = 'None'; 

          } 

          // EOF: attribute options 

 

 

          /////////////////////////////////////////////////////////////////////////// 

 

          break; 

    //  brian and ryan this is ryan's version 

            ////////////////////////////////////////////////////////////// 

    case 'MASTER_LIST_OPTIONS': $lc_align = 'center'; $lc_text = ''; $products_options_name = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . $listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . $languages_id . "'"); while ($products_options_name_values = tep_db_fetch_array($products_options_name)) { $products_options_array = array(); $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $listing['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.options_values_price ASC"); while ($products_options_values = tep_db_fetch_array($products_options)) { $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'], 'style' => ''); if ($products_options_values['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') '; } } $lc_text .= tep_draw_pull_down_menu('id_'.$listing['products_id'].'[' . $products_options_name_values['products_options_id'] . ']', $products_options_array); } break;

          // EOF: attribute options 

          /////////////////////////////////////////////////////////////////////////// 

 

          break; 

        }   

       

              $list_box_contents[$cur_row][] = array('align' => $lc_align,   

                                              'valign' => $lc_valign,   

                                              'params' => 'class="productListing-data-master"',   

                                              'text'  => $lc_text);   

      }   

    }   

   

    new productListingBox($list_box_contents);   

  } else {   

    $list_box_contents = array();   

   

    $list_box_contents[0] = array('params' => 'class="productListing-odd"');   

    $list_box_contents[0][] = array('params' => 'class="productListing-data"',   

                                  'text' => TEXT_NO_PRODUCTS);   

   

    new productListingBox($list_box_contents);   

  }   

?> 

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

///// master_products.php

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MASTER_PRODUCTS);

 

$master_query = tep_db_query("select products_master from " . TABLE_PRODUCTS . " where products_master = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

$thisquery = tep_db_fetch_array($master_query);

if ($thisquery['products_master'] != '0') {

 

          $slave_list = array('MASTER_LIST_MODEL' => MASTER_LIST_MODEL,

                        'MASTER_LIST_NAME' => MASTER_LIST_NAME,

                        'MASTER_LIST_MANUFACTURER' => MASTER_LIST_MANUFACTURER, 

                        'MASTER_LIST_PRICE' => MASTER_LIST_PRICE, 

                        'MASTER_LIST_QUANTITY' => MASTER_LIST_QUANTITY, 

                        'MASTER_LIST_WEIGHT' => MASTER_LIST_WEIGHT, 

                        'MASTER_LIST_IMAGE' => MASTER_LIST_IMAGE,

                        'MASTER_LIST_BUY_NOW' => MASTER_LIST_BUY_NOW,

                        'MASTER_LIST_OPTIONS' => 8,

                        'MASTER_LIST_DESCRIPTION' => MASTER_LIST_DESCRIPTION); 

                                                   

    asort($slave_list);

 

    $column_list = array();

    reset($slave_list);

    while (list($key, $value) = each($slave_list)) {

      if ($value > 0) $column_list[] = $key;

    }

   

   

   

 

thanks

 

joe

Link to comment
Share on other sites

I dont recall changing anything of the 'MASTER_LIST_OPTIONS' since I dont even use it for mine. Try this first though, when you show a master product, add one to the product id in the url to see the slave product display, do the attributes show up?

If I was crafty, this would be a funny signature.

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