Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Multiple Categories per product quick entry


Guest

Recommended Posts

Great contribution. I'm using it and it works well.

Just one quick note on an issue I found. The counts for the number of products in a category is wrong. If you add a product and give it multiple categories, the system will actually count all those categories as individual products. I'm sure this is a quick query fix.

Edited by Salx
Link to comment
Share on other sites

  • 7 months later...

Hi, excuse my english..

 

for my 2.2 rc2a work, i just have changer box view.

 

but have dificulties to add with that contributions :

 

more_pics_6 + Dynamic_Image_Resizer + images_rename_SEO + Ultimate_SEO_URL + Header_Tags_SEO + watermark_thumb

 

in my original code of categories.php i have

 

case 'update_product':
     // code 1
     // copy image only if modified multicat
       $products_image = new upload('products_image');
       $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
       if ($products_image->parse() && $products_image->save()) {
         $products_image_name = $products_image->filename;
       } else {
         $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
       }
     // copy image only if modified multicat

               if (isset($HTTP_POST_VARS['edit_x']) || isset($HTTP_POST_VARS['edit_y'])) {
         $action = 'new_product';
       } else {
         if (isset($HTTP_GET_VARS['pID'])) $products_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
         $products_date_available = tep_db_prepare_input($HTTP_POST_VARS['products_date_available']);          $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null';          $sql_data_array = array('products_quantity' => (int)tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),
                                 'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),
                                 'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
                                 'products_date_available' => $products_date_available,
                                 'products_weight' => (float)tep_db_prepare_input($HTTP_POST_VARS['products_weight']),
                                 'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
                                 'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
                                 'manufacturers_id' => (int)tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));        // BOF: More Pics 6
         if(($HTTP_POST_VARS['unlink_image'] == 'yes') || ($HTTP_POST_VARS['delete_image'] == 'yes')){
           $sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['none']);         
         // code 2 multicat
         }else if (isset($products_image_name) && tep_not_null($products_image_name) && ($products_image_name != 'none')) {
           $sql_data_array['products_image'] = tep_db_prepare_input($products_image_name);
         }
         // code initial si pas multicat
         /*}else if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
           $sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);
         } */

 

I have down in this file the same code :

// BOF SEO images
        $products_image = new upload('products_image');
        $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
        if ($products_image->parse($fabricante, $nombreProducto) && $products_image->save()) {
          $products_image_name = $products_image->filename;
          // watermark     
         AddWatermark($products_image_name);
         //watermark end
        } else {
          $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
        }

 

if i replace code 1 with this code, it change nothing but adding watermark

 

my brobleme with this contribution, i not have the name of my images like : name-of-the-product-22....jpg

 

i think it's due to code 2

 

can you help me to find why please, thanks

Edited by repare31

oscommerce-2.2rc2a - HeaderTags_SEO_V_3.1.8 - Ultimate_SEO_URLSv22d_9 - SEO-images-rename-1.0 - Dynamic Image Resizer_1 - fancybox - dynamic_sitemap_v4_21 - csv_import_v2_1_3 - colissimo_v1.9 - export_csv_xml - thumb_watermark - short_descriptionV1.2 - more_pics_6_v1.4.3 - Ask a question_1_2 - Stats_Products_Stocklevel 1_5_1 - category_box_+_no_qty_category - large_search - ip_on_mail - Tinymce - loging_box - new_prod_list_likebestseller_+_featured_product - cgv_acceptation - Product_Truncated_Description_v_1.5 - discount-or-payment-surcharge-v1.1 - trackingcolissimo+ups102 - reclamaposte_10 - InvoicePDF1.5

Link to comment
Share on other sites

  • 9 months later...
  • 3 weeks later...

This is a good addon, but i have 2 problems, bugs with it in 2.3.1.

If i use tep_draw_mselect_menu i cant select any categories. Neither 1. And it says to me: You didnt choose any category. So it dont work.

If i use tep_draw_chbox_cat_menu it is very bad because i have about 400 categories and cant see which one is the good.

Someone can help me to fix this?

Link to comment
Share on other sites

I fixed a view bugs and made this add-on work with osCommerce 2.3.1. It can be found here: http://addons.oscommerce.com/info/8187

I have some problem with this addon in 2.3.1. Maybe can you help me? With mselect_menu i cant choose any category, and with chbox all categories are random, i cant choose the right one.

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