Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bundled Products Issue


Monk

Recommended Posts

Hello, I am using the Bundled Products contribution. It works fine if you are creating a NEW product contribution made up from one or more other products. This works Great!!

 

My problem is that I have several hundred products that I have entered into the inventory of my store, that are really made up from 2 other products. At the time, I did not know about the bundled products and now I want to go back and turn these items into a bundled product for inventory purposes.

 

The issue is the contribution DOES NOT let you edit an existing product to BECOME a bundled product. Nor does it allow you to edit a bundled product once it has been created.

 

Anyone that has an answer for this....I would love to hear!! It seems that others are having similar problems, and I know that we are only a short time till one of us figures it out.

Link to comment
Share on other sites

  • 2 months later...

There is a little bug in the description of the install. You need to move the "update bundle contents" in categories.php a few lines down. It should look like this:

 

          if ($action == 'insert_product') {
           $insert_sql_data = array('products_date_added' => 'now()');

           $sql_data_array = array_merge($sql_data_array, $insert_sql_data);

           tep_db_perform(TABLE_PRODUCTS, $sql_data_array);
           $products_id = tep_db_insert_id();

           tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')");
         } elseif ($action == 'update_product') {
           $update_sql_data = array('products_last_modified' => 'now()');

           $sql_data_array = array_merge($sql_data_array, $update_sql_data);

           tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'");
         }

           // update bundle contents
           if ($HTTP_POST_VARS['products_bundle'] == 'yes') {
             tep_db_query("DELETE FROM products_bundles WHERE bundle_id = '" . $products_id . "'");
             for ($i=0, $n=6; $i<$n; $i++) {
               if (isset($HTTP_POST_VARS['subproduct_' . $i . '_qty']) && $HTTP_POST_VARS['subproduct_' . $i . '_qty'] > 0) {
                 tep_db_query("INSERT INTO products_bundles (bundle_id, subproduct_id, subproduct_qty) VALUES ('" . $products_id . "', '" . $HTTP_POST_VARS['subproduct_' . $i . '_id'] . "', '" . $HTTP_POST_VARS['subproduct_' . $i . '_qty'] . "')");
               }
             }
           }

         $languages = tep_get_languages();

 

Also noticed a little typo in the if statement. It should read:

 

if ($HTTP_POST_VARS['products_bundle'] == 'yes') {

 

AND NOT

 

if ($HTTP_POST_VARS['products_bundle'] = 'yes') {

 

HTH

 

Gunter

Link to comment
Share on other sites

  • 7 months later...

as for more than 6 subproducts:

 

in categories.php, find

CODE

function fillCodes() {

for (var n=0;n<6;n++) {

 

 

and change the "6".

 

then find all occurences of (there are two) and change the 6

CODE

 

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

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