Jump to content
Sign in to follow this  
Monk

Bundled Products Issue

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Can you help with this: some of my bundles contain up to 40 products. How can I add more than the default 6 allowed?

Share this post


Link to post
Share on other sites

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++) {

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×