Jump to content
Sign in to follow this  
websissy

McGrath's Attributes Sorter Copier Install

Recommended Posts

I downloaded Linda McGrath's Attributes Copier & Sorter V5.0 from this site and carefully followed her step by step install instructions until I reached the program compare step.

 

Now, I'm stuck!

 

I'm running source code version 2.2ms2, and the version her patches were written for was an earlier release of the code than I have. So, my programs are later code versions than the ones she made her changes to. In short, I can't tell which changes from the patched older release of these programs she provides should be moved forward (as Her enhancements) and which ones should be left behind as obsolete code. Arggggh! It's impossible for me to distinuish her changes from changes made to the version I received. The four programs with extensive enough changes that even Linda says they should be compared include:

 

/catalog/product_info.php - I have v1.97 ? 2003 - She had v1.87 ? 2002

/admin/categories.php - I have v1.146 ? 2003 - She had v1.138 ? 2002

/admin/products_attributes.php - I have v1.52 ? 2003 - She had v1.48 ? 2002

/admin/includes/header.php - I have v1.42 ? 2003 - She had v1.19 ? 2002

 

Can anyone provide instructions for applying Linda's patches to the 2.2ms2 version of this code? I can't do anything without guidance about how to apply her changes to the current release! :-(

 

I do have backups and can roll back... but I've done everything except this final step!! Can anyone help me? Please...

 

Thanks!

Edited by websissy

Share this post


Link to post
Share on other sites

I just did this, and I am a terrible coder. I can barely get it right if the instructions are perfect!

But- I found that comparing "by hand" so to speak was the way to go. For one thing I had already added several other mods.

Linda's code is clearly marked in the files, and I did a search and find for a snippet of code (in the main code) at or near the beginning of each of her additions. It seemed pretty easy to me, to find the point where it should be added. At the very end of categories.php, where she writes the tables, I just switched the entire text into the new file- I didn't see any difference from that point on.

I haven't done a complete test, so I can only hope it works!

Edited by Dragonmom

psst... wanna buy a wand?

Share this post


Link to post
Share on other sites

websissy,

 

I just installed the Attributes Copier & Sorter V5.0 (based on the July 13) Contribution on my test system this week too, and until you pointed it out, I hadn't even noticed that the changes were based on old files. Good eyes!

 

I'm in the process of going through all the contribution's code and forward fitting it to the 2.2MS2 codebase. I should have this done today or tomorrow (just so you know).

 

At the same time, I am removing the "Coming soon" features that you may have noticed (I actually plan on uploading 2 cleaned versions, 1 with the Coming soon features, and 1 without + a few changes I want to make to the Contribution (which is why I'm doing this in the first place)).

 

I hope you can help me test out my updated Contribution once I get these changes done.

Edited by Zeme

Share this post


Link to post
Share on other sites

As promised, I have just uploaded version 5.1b of the Attributes Sorter and Copier Contribution.

 

I have tested it out a lot, but I doubt I caught every bug. Check it out, and I hope it fits what you were looking for. (Man, I learned a ton from doing this (my first) contribution modification)

 

Features iclude:

- All files are based on the files supplied with a clean install

- All theh "Coming soon" code "features" have been removed since I found that none of them are actually "hooked up" to any sort of logic in the code. They were bothering me.

- Improved sort_order by adding a sort_order to the Order Values table. This sort_order will propogate to the Product Attributes table automatically if no sort_order is given at add/update time.

 

I'm looking forward to some feedback on this attempt of mine. (I'm bookmarking this thread for a while).

 

The link to the Contribution can be found in my above post. Have fun, I know I do.

Share this post


Link to post
Share on other sites

Hello,

 

just a question. Could it be possible to integrate a Tabmenue for the product attributes when inserting a product in the admin/categories.php?

 

Something like this:

 

sreen.gif

 

I tried it with a js Script but that hasn't worked. He showed me the tabs but still among themselves.

 

How culd it be realized? I Think that would be very usefull if you have a lot of attributes and dont want to scoll down hours and hours.

 

Bye

Christian

Share this post


Link to post
Share on other sites

I think that you have a good idea there. This would probably be a nice addition (an option to turn it on or off of course (for small lists it would be overkill)).

 

I'm planning on adding some new features this weekend, (assuming I don't find another contribution with them in it) and I need to ask you a few questions first.

 

Currently, if I change an attribute (turn it on, change the value, etc), I have to click "preview" /"submit" to get the changes updated. I'm planning on adding a simple "update" button.

The questions:

1) if we add tabs, would clicking on a tab be the same as "update"? would you want that to be a separate step? (I'm not sure which way I'm leaning, if it is a separate step, you could decide not to do it. But if it is the same step, that's 1 less step to update some attributes).

 

2) I'd removed the columns from the RH side (one time charge, unit weight, etc) because they didn't appear to be fully-implemented in the contribution I downloaded. Do you have an updated version? (where did you get it) Do you rely on these fields, or can I just keep them deleted?

 

3) Instead of tabs, I may just create a set of links, one for each Product Option. Would that be ok? (I don't see why appearance is a big deal in the admin section)

 

I look forward to your feedback.

Hello,

 

just a question. Could it be possible to integrate a Tabmenue for the product attributes when inserting a product in the admin/categories.php?

 

I tried it with a js Script but that hasn't worked. He showed me the tabs but still among themselves.

 

How culd it be realized? I Think that would be very usefull if you have a lot of attributes and dont want to scoll down hours and hours.

 

Bye

Christian

Share this post


Link to post
Share on other sites

Hi, I've installed v5.1b according to the install notes (easy to follow with those nice yellow comments :-). Now I have a VERY stupid question: How do I use it? I've popped into the admin and I see no difference to what I had before, I see no way to add the already existing attributes to a new product. Of course I don't know what it should look like so perhaps (most likely) I've cocked up the install although I'm getting no errors. Could you just explain what I should expect to see. Thanks. Sarah

Share this post


Link to post
Share on other sites

Assuming that you are referring to this contribution

.

 

You should see some differences on the categories.php page when you're looking at a product. If you scroll down on this page, near the bottom you should see a list of all the existing attributes. (see screenshot below). This makes it easy to change the set attributes for a product.

 

The other major change is on the RH side bar of the categories.php view. When you're looking at a product, but not in the "Edit" screen yet, at the bottom of the RH grey box are the new "copy attributes to" options. (for example, if you get to the DVD->Action page, and select "The Matrix")

 

Oh, and one last thing that you should see different, on the product_attributes.php screen, you should have a new "Sort Order" column in the Option Values and Prouct Attributes tables.

 

screen.JPG

Share this post


Link to post
Share on other sites

I've helped another community member merge those two contributions together. There wasn't much trouble (other than merging a few files together). The contributions don't seem to cause any problems with each other.

 

A few notes:

If you have any Text type inputs, they won't show up properly on the product-edit page (you won't be able to add/remove them as you do other types of attributes).

Otherwise, things work decently together.

 

I too have wanted to merge these two contributions together for quite some time, and I've actually started working on doing just that, but I haven't had time to properly resolve the TEXT type attributes issue. I do have a lot of experience working with the 5.1b code though, so I'd be happy to take a look at any problems you encounter if you decide to merge them together as is.

Share this post


Link to post
Share on other sites

Thank you very much for your offer :rolleyes:

 

I found another Attributes Copier 0.61 which is easy to install and requires only minor addition in the product_attributes.php. and comes with additional php files. So it works good with the Option Type Feature!

 

I think Attributes Copier 0.61 is much more limited as Attributes Sorter and Copier v5.1b. It does not offer sorting of attributes etc., but is good enough for my needs to copy multiple attributes to other products.

 

Details on Attributes Copier 0.61

http://www.oscommerce.com/community/contri...tributes+copier

 

 

If some one needs help, do not hesitate to drop me a mail. I'll try to help also as Zeme offered me :P

 

cu

Share this post


Link to post
Share on other sites

I'm having problems getting this contribution into my categories.php file, everything else is ok. The problem seems to be with the additional images contribution. Heres my code at the section where I'm having trouble.

        $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
       $contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
       $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
       $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
       break;
     case 'new_images': 
       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_IMAGES . '</b>');   
                                                                                                                                                                                                                                                                                                       
       $contents = array('form' => tep_draw_form('new_images', FILENAME_CATEGORIES, 'action=add_images&cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID'], 'post', 'enctype="multipart/form-data"')); 
       $contents[] = array('text' => TEXT_NEW_IMAGES_INTRO);      
       $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_IMAGES_DESC . '<br>' . tep_draw_input_field('images_description')); 
       $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_IMAGES_NEWPOP . $newpop_resol . '<br>' . tep_draw_file_field('popup_images'));
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
       break;                                                                                   
     case 'delete_images': 
       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_IMAGES . '</b>');             
       $contents = array('form' => tep_draw_form('delete_images', FILENAME_CATEGORIES, 'action=del_images&cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID'])); 
       $contents[] = array('text' => TEXT_DEL_IMAGES_INTRO);      
                                                                                                                                                                                                                                                                                                       
       $images_product = tep_db_query("SELECT additional_images_id, images_description FROM " . TABLE_ADDITIONAL_IMAGES . " where products_id = '" . $HTTP_GET_VARS['pID'] . "'"); 
       if (!tep_db_num_rows($images_product)) {                                                                                                                                                                                                                                                        
         $contents[] = array('align' => 'center', 'text' => '<br><font color="red">No Additional Images!</font>');   
         $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');  
       } else {                                                                                                                                                                                                                                                                                        
         while ($new_images = tep_db_fetch_array($images_product)) {                                                                                                                                                                                                                                   
           $contents[] = array('text' => ' ' . tep_draw_checkbox_field('additional_images_id[]', $new_images['additional_images_id'], true) . $new_images['images_description']);    
         }                                                                                                                                                                                                                                                                                             
         $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');  
       }                                                                                                                                                                                                                                                                                               
       break;
     default:
       if ($rows > 0) {
         if (isset($cInfo) && is_object($cInfo)) { // category info box contents
           $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>');

           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');
           $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
           if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
           $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);
           $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_PRODUCTS . ' ' . $cInfo->products_count);
         } elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents
           $heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>');

           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
           $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($pInfo->products_date_added));
           if (tep_not_null($pInfo->products_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($pInfo->products_last_modified));
           if (date('Y-m-d') < $pInfo->products_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available));
           $contents[] = array('text' => '<br>' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image);
           $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
           $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
    $contents[] = array('text' => '<br><b>' . TEXT_INFO_HEADING_NEW_IMAGES . '</b><hr>');
    
    $images_product = tep_db_query("SELECT additional_images_id, popup_images, images_description FROM " . TABLE_ADDITIONAL_IMAGES . " where products_id = '" . $pInfo->products_id . "'");
           if (!tep_db_num_rows($images_product)) {
             $contents[] = array('align' => 'center', 'text' => '<font color="red">No Additional Images!</font><hr>');
           } else {
             while ($new_images = tep_db_fetch_array($images_product)) {
              $contents[] = array('text' => ' ' . tep_image(DIR_WS_CATALOG_IMAGES  . $new_images['popup_images'], $new_images['images_description'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="absmiddle"') . '<br><br> <hr>');
             }
           }
           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_images') . '">' . tep_image_button('button_images_add.gif', IMAGE_ADDITIONAL_NEW) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_images') . '">' . tep_image_button('button_images_del.gif', IMAGE_ADDITIONAL_DEL) . '</a>');
         }
       } else { // create category/product info
         $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');

         $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
       }
       break;

 

 

And heres the code I need to insert into the same section

 

 

        $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
       $contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
       $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
       $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
       break;
     case 'copy_to':
       $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');

       $contents = array('form' => tep_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
       $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
       $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
       $contents[] = array('text' => '<br>' . TEXT_CATEGORIES . '<br>' . tep_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id));
       $contents[] = array('text' => '<br>' . TEXT_HOW_TO_COPY . '<br>' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br>' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
// BOF: Attributes copy
// WebMakers.com Added: Attributes Copy
       $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
       $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_ONLY);
       $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
// EOF: Attributes copy
       break;
// BOF: Attributes copy to existing product:
// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
     case 'copy_product_attributes':
       $copy_attributes_delete_first='1';
       $copy_attributes_duplicates_skipped='1';
       $copy_attributes_duplicates_overwrite='0';

       if (DOWNLOAD_ENABLED == 'true') {
         $copy_attributes_include_downloads='1';
         $copy_attributes_include_filename='1';
       } else {
         $copy_attributes_include_downloads='0';
         $copy_attributes_include_filename='0';
       }

       $heading[] = array('text' => '<b>' . 'Copy Attributes to another product' . '</b>');
       $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes&cPath=' . $cPath . '&pID=' . $pInfo->products_id) . tep_draw_hidden_field('products_id', $pInfo->products_id) . tep_draw_hidden_field('products_name', $pInfo->products_name));
       $contents[] = array('text' => '<br>Copying Attributes from #' . $pInfo->products_id . '<br><b>' . $pInfo->products_name . '</b>');
       $contents[] = array('text' => 'Copying Attributes to # ' . tep_draw_input_field('copy_to_products_id', $copy_to_products_id, 'size="3"'));
       $contents[] = array('text' => '<br>Delete ALL Attributes and Downloads before copying ' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
       $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
       $contents[] = array('text' => '<br>' . 'Otherwise ...');
       $contents[] = array('text' => 'Duplicate Attributes should be skipped ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
       $contents[] = array('text' => '   Duplicate Attributes should be overwritten ' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
       if (DOWNLOAD_ENABLED == 'true') {
         $contents[] = array('text' => '<br>Copy Attributes with Downloads ' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
         // Not used at this time - download name copies if download attribute is copied
         // $contents[] = array('text' => '   Include Download Filenames ' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
       }
       $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
       $contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
       if ($pID) {
         $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER);
       } else {
        $contents[] = array('align' => 'center', 'text' => '<br>Select a product for display');
       }
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', 'Copy Attribtues') . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
       break;
// WebMakers.com Added: Copy Attributes Existing Product to All Products in Category
     case 'copy_product_attributes_categories':
       $copy_attributes_delete_first='1';
       $copy_attributes_duplicates_skipped='1';
       $copy_attributes_duplicates_overwrite='0';

       if (DOWNLOAD_ENABLED == 'true') {
         $copy_attributes_include_downloads='1';
         $copy_attributes_include_filename='1';
       } else {
         $copy_attributes_include_downloads='0';
         $copy_attributes_include_filename='0';
       }
     $heading[] = array('text' => '<b>' . 'Copy Product Attributes to Category ...' . '</b>');
       $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes_categories&cPath=' . $cPath . '&cID=' . $cID . '&make_copy_from_products_id=' . $copy_from_products_id));
       $contents[] = array('text' => 'Copy Product Attributes from Product ID# ' . tep_draw_input_field('make_copy_from_products_id', $make_copy_from_products_id, 'size="3"'));
       $contents[] = array('text' => '<br>Copying to all products in Category ID# ' . $cID . '<br>Category Name: <b>' . tep_get_category_name($cID, $languages_id) . '</b>');
       $contents[] = array('text' => '<br>Delete ALL Attributes and Downloads before copying ' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
       $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
       $contents[] = array('text' => '<br>' . 'Otherwise ...');
       $contents[] = array('text' => 'Duplicate Attributes should be skipped ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
       $contents[] = array('text' => '   Duplicate Attributes should be overwritten ' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
       if (DOWNLOAD_ENABLED == 'true') {
         $contents[] = array('text' => '<br>Copy Attributes with Downloads ' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
        // Not used at this time - download name copies if download attribute is copied
         // $contents[] = array('text' => '   Include Download Filenames ' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
       }
       $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
       $contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
       $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', 'Copy Attribtues') . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
       break;
// EOF: Attributes copy
     default:
       if ($rows > 0) {
         if (isset($cInfo) && is_object($cInfo)) { // category info box contents
           $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>');

           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');
           $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
           if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
           $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);
           $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_PRODUCTS . ' ' . $cInfo->products_count);
//BOF: Attributes copy to all existing products
           if ($cInfo->childs_count==0 and $cInfo->products_count >= 1) {
// WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in Category
             $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
             if ($cID) {
               $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID . '&action=copy_product_attributes_categories') . '">' . 'Copy Product Attributes to <br>ALL products in Category: ' . tep_get_category_name($cID, $languages_id) . '<br>' . tep_image_button('button_copy_to.gif', 'Copy Attributes') . '</a>');
             } else {
               $contents[] = array('align' => 'center', 'text' => '<br>Select a Category to copy attributes to');
             }
           }
//EOF: Attributes copy to all existing products
         } elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents
           $heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>');

           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
           $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($pInfo->products_date_added));
           if (tep_not_null($pInfo->products_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($pInfo->products_last_modified));
           if (date('Y-m-d') < $pInfo->products_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available));
           $contents[] = array('text' => '<br>' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image);
           $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
           $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
// BOF: Attributes copy existing to existing
// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
           $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
           $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_product_attributes') . '">' . 'Products Attributes Copier:<br>' . tep_image_button('button_copy_to.gif', 'Copy Attributes') . '</a>');
           if ($pID) {
             $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
           } else {
             $contents[] = array('align' => 'center', 'text' => '<br>Select a product to display attributes');
           }
//EOF: Attributes copy existing to existing
         }
       } else { // create category/product info
         $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');

         $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
       }
       break;

 

Could anyone kindly work out how I can merge those two sections together.

 

Cheers :)

Share this post


Link to post
Share on other sites

I haven't had the chance to test out this merge, but this is my attempt to merge the two files together. I hope it works for you.

 

 $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=move_product_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
      $contents[] = array('text' => sprintf(TEXT_MOVE_PRODUCTS_INTRO, $pInfo->products_name));
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
      $contents[] = array('text' => '<br>' . sprintf(TEXT_MOVE, $pInfo->products_name) . '<br>' . tep_draw_pull_down_menu('move_to_category_id', tep_get_category_tree(), $current_category_id));
      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_move.gif', IMAGE_MOVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
    case 'new_images':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_IMAGES . '</b>');  
                                                                                                                                                                                                                                                                                                      
      $contents = array('form' => tep_draw_form('new_images', FILENAME_CATEGORIES, 'action=add_images&cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID'], 'post', 'enctype="multipart/form-data"'));
      $contents[] = array('text' => TEXT_NEW_IMAGES_INTRO);      
      $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_IMAGES_DESC . '<br>' . tep_draw_input_field('images_description'));
      $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_IMAGES_NEWPOP . $newpop_resol . '<br>' . tep_draw_file_field('popup_images'));
      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_save.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');    
      break;                                                                                  
    case 'delete_images':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_IMAGES . '</b>');            
      $contents = array('form' => tep_draw_form('delete_images', FILENAME_CATEGORIES, 'action=del_images&cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']));
      $contents[] = array('text' => TEXT_DEL_IMAGES_INTRO);      
                                                                                                                                                                                                                                                                                                      
      $images_product = tep_db_query("SELECT additional_images_id, images_description FROM " . TABLE_ADDITIONAL_IMAGES . " where products_id = '" . $HTTP_GET_VARS['pID'] . "'");
      if (!tep_db_num_rows($images_product)) {                                                                                                                                                                                                                                                        
        $contents[] = array('align' => 'center', 'text' => '<br><font color="red">No Additional Images!</font>');  
        $contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');  
      } else {                                                                                                                                                                                                                                                                                        
        while ($new_images = tep_db_fetch_array($images_product)) {                                                                                                                                                                                                                                  
          $contents[] = array('text' => ' ' . tep_draw_checkbox_field('additional_images_id[]', $new_images['additional_images_id'], true) . $new_images['images_description']);    
        }                                                                                                                                                                                                                                                                                            
        $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_SAVE) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID']) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');  
      }                                                                                                                                                                                                                                                                                              
      break;
    case 'copy_to':
      $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_COPY_TO . '</b>');

      $contents = array('form' => tep_draw_form('copy_to', FILENAME_CATEGORIES, 'action=copy_to_confirm&cPath=' . $cPath) . tep_draw_hidden_field('products_id', $pInfo->products_id));
      $contents[] = array('text' => TEXT_INFO_COPY_TO_INTRO);
      $contents[] = array('text' => '<br>' . TEXT_INFO_CURRENT_CATEGORIES . '<br><b>' . tep_output_generated_category_path($pInfo->products_id, 'product') . '</b>');
      $contents[] = array('text' => '<br>' . TEXT_CATEGORIES . '<br>' . tep_draw_pull_down_menu('categories_id', tep_get_category_tree(), $current_category_id));
      $contents[] = array('text' => '<br>' . TEXT_HOW_TO_COPY . '<br>' . tep_draw_radio_field('copy_as', 'link', true) . ' ' . TEXT_COPY_AS_LINK . '<br>' . tep_draw_radio_field('copy_as', 'duplicate') . ' ' . TEXT_COPY_AS_DUPLICATE);
// BOF: Attributes copy
// WebMakers.com Added: Attributes Copy
      $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
      $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES_ONLY);
      $contents[] = array('text' => '<br>' . TEXT_COPY_ATTRIBUTES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_yes', true) . ' ' . TEXT_COPY_ATTRIBUTES_YES . '<br>' . tep_draw_radio_field('copy_attributes', 'copy_attributes_no') . ' ' . TEXT_COPY_ATTRIBUTES_NO);
      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
// EOF: Attributes copy
      break;
// BOF: Attributes copy to existing product:
// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
    case 'copy_product_attributes':
      $copy_attributes_delete_first='1';
      $copy_attributes_duplicates_skipped='1';
      $copy_attributes_duplicates_overwrite='0';

      if (DOWNLOAD_ENABLED == 'true') {
        $copy_attributes_include_downloads='1';
        $copy_attributes_include_filename='1';
      } else {
        $copy_attributes_include_downloads='0';
        $copy_attributes_include_filename='0';
      }

      $heading[] = array('text' => '<b>' . 'Copy Attributes to another product' . '</b>');
      $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes&cPath=' . $cPath . '&pID=' . $pInfo->products_id) . tep_draw_hidden_field('products_id', $pInfo->products_id) . tep_draw_hidden_field('products_name', $pInfo->products_name));
      $contents[] = array('text' => '<br>Copying Attributes from #' . $pInfo->products_id . '<br><b>' . $pInfo->products_name . '</b>');
      $contents[] = array('text' => 'Copying Attributes to # ' . tep_draw_input_field('copy_to_products_id', $copy_to_products_id, 'size="3"'));
      $contents[] = array('text' => '<br>Delete ALL Attributes and Downloads before copying ' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
      $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
      $contents[] = array('text' => '<br>' . 'Otherwise ...');
      $contents[] = array('text' => 'Duplicate Attributes should be skipped ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
      $contents[] = array('text' => '   Duplicate Attributes should be overwritten ' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
      if (DOWNLOAD_ENABLED == 'true') {
        $contents[] = array('text' => '<br>Copy Attributes with Downloads ' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
        // Not used at this time - download name copies if download attribute is copied
        // $contents[] = array('text' => '   Include Download Filenames ' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
      }
      $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
      $contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
      if ($pID) {
        $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER);
      } else {
       $contents[] = array('align' => 'center', 'text' => '<br>Select a product for display');
      }
      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', 'Copy Attribtues') . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
// WebMakers.com Added: Copy Attributes Existing Product to All Products in Category
    case 'copy_product_attributes_categories':
      $copy_attributes_delete_first='1';
      $copy_attributes_duplicates_skipped='1';
      $copy_attributes_duplicates_overwrite='0';

      if (DOWNLOAD_ENABLED == 'true') {
        $copy_attributes_include_downloads='1';
        $copy_attributes_include_filename='1';
      } else {
        $copy_attributes_include_downloads='0';
        $copy_attributes_include_filename='0';
      }
    $heading[] = array('text' => '<b>' . 'Copy Product Attributes to Category ...' . '</b>');
      $contents = array('form' => tep_draw_form('products', FILENAME_CATEGORIES, 'action=create_copy_product_attributes_categories&cPath=' . $cPath . '&cID=' . $cID . '&make_copy_from_products_id=' . $copy_from_products_id));
      $contents[] = array('text' => 'Copy Product Attributes from Product ID# ' . tep_draw_input_field('make_copy_from_products_id', $make_copy_from_products_id, 'size="3"'));
      $contents[] = array('text' => '<br>Copying to all products in Category ID# ' . $cID . '<br>Category Name: <b>' . tep_get_category_name($cID, $languages_id) . '</b>');
      $contents[] = array('text' => '<br>Delete ALL Attributes and Downloads before copying ' . tep_draw_checkbox_field('copy_attributes_delete_first',$copy_attributes_delete_first, 'size="2"'));
      $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
      $contents[] = array('text' => '<br>' . 'Otherwise ...');
      $contents[] = array('text' => 'Duplicate Attributes should be skipped ' . tep_draw_checkbox_field('copy_attributes_duplicates_skipped',$copy_attributes_duplicates_skipped, 'size="2"'));
      $contents[] = array('text' => '   Duplicate Attributes should be overwritten ' . tep_draw_checkbox_field('copy_attributes_duplicates_overwrite',$copy_attributes_duplicates_overwrite, 'size="2"'));
      if (DOWNLOAD_ENABLED == 'true') {
        $contents[] = array('text' => '<br>Copy Attributes with Downloads ' . tep_draw_checkbox_field('copy_attributes_include_downloads',$copy_attributes_include_downloads, 'size="2"'));
       // Not used at this time - download name copies if download attribute is copied
        // $contents[] = array('text' => '   Include Download Filenames ' . tep_draw_checkbox_field('copy_attributes_include_filename',$copy_attributes_include_filename, 'size="2"'));
      }
      $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
      $contents[] = array('align' => 'center', 'text' => '<br>' . PRODUCT_NAMES_HELPER);
      $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_copy.gif', 'Copy Attribtues') . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
      break;
// EOF: Attributes copy
    default:
      if ($rows > 0) {
        if (isset($cInfo) && is_object($cInfo)) { // category info box contents
          $heading[] = array('text' => '<b>' . $cInfo->categories_name . '</b>');

          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=edit_category') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=delete_category') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cInfo->categories_id . '&action=move_category') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a>');
          $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added));
          if (tep_not_null($cInfo->last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($cInfo->last_modified));
          $contents[] = array('text' => '<br>' . tep_info_image($cInfo->categories_image, $cInfo->categories_name, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) . '<br>' . $cInfo->categories_image);
          $contents[] = array('text' => '<br>' . TEXT_SUBCATEGORIES . ' ' . $cInfo->childs_count . '<br>' . TEXT_PRODUCTS . ' ' . $cInfo->products_count);
//BOF: Attributes copy to all existing products
          if ($cInfo->childs_count==0 and $cInfo->products_count >= 1) {
// WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in Category
            $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
            if ($cID) {
              $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $cID . '&action=copy_product_attributes_categories') . '">' . 'Copy Product Attributes to <br>ALL products in Category: ' . tep_get_category_name($cID, $languages_id) . '<br>' . tep_image_button('button_copy_to.gif', 'Copy Attributes') . '</a>');
            } else {
              $contents[] = array('align' => 'center', 'text' => '<br>Select a Category to copy attributes to');
            }
          }
//EOF: Attributes copy to all existing products
        } elseif (isset($pInfo) && is_object($pInfo)) { // product info box contents
          $heading[] = array('text' => '<b>' . tep_get_products_name($pInfo->products_id, $languages_id) . '</b>');

          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_product') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_product') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=move_product') . '">' . tep_image_button('button_move.gif', IMAGE_MOVE) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_to') . '">' . tep_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
          $contents[] = array('text' => '<br>' . TEXT_DATE_ADDED . ' ' . tep_date_short($pInfo->products_date_added));
          if (tep_not_null($pInfo->products_last_modified)) $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . tep_date_short($pInfo->products_last_modified));
          if (date('Y-m-d') < $pInfo->products_date_available) $contents[] = array('text' => TEXT_DATE_AVAILABLE . ' ' . tep_date_short($pInfo->products_date_available));
          $contents[] = array('text' => '<br>' . tep_info_image($pInfo->products_image, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>' . $pInfo->products_image);
          $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_PRICE_INFO . ' ' . $currencies->format($pInfo->products_price) . '<br>' . TEXT_PRODUCTS_QUANTITY_INFO . ' ' . $pInfo->products_quantity);
          $contents[] = array('text' => '<br>' . TEXT_PRODUCTS_AVERAGE_RATING . ' ' . number_format($pInfo->average_rating, 2) . '%');
// BOF: Attributes copy existing to existing
// WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
          $contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'pixel_black.gif','','100%','3'));
          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=copy_product_attributes') . '">' . 'Products Attributes Copier:<br>' . tep_image_button('button_copy_to.gif', 'Copy Attributes') . '</a>');
          if ($pID) {
            $contents[] = array('align' => 'center', 'text' => '<br>' . ATTRIBUTES_NAMES_HELPER . '<br>' . tep_draw_separator('pixel_trans.gif', '1', '10'));
          } else {
            $contents[] = array('align' => 'center', 'text' => '<br>Select a product to display attributes');
          }
//EOF: Attributes copy existing to existing
  $contents[] = array('text' => '<br><b>' . TEXT_INFO_HEADING_NEW_IMAGES . '</b><hr>');
  
   $images_product = tep_db_query("SELECT additional_images_id, popup_images, images_description FROM " . TABLE_ADDITIONAL_IMAGES . " where products_id = '" . $pInfo->products_id . "'");
          if (!tep_db_num_rows($images_product)) {
            $contents[] = array('align' => 'center', 'text' => '<font color="red">No Additional Images!</font><hr>');
          } else {
            while ($new_images = tep_db_fetch_array($images_product)) {
             $contents[] = array('text' => ' ' . tep_image(DIR_WS_CATALOG_IMAGES  . $new_images['popup_images'], $new_images['images_description'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'align="absmiddle"') . '<br><br> <hr>');
            }
          }
          $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=new_images') . '">' . tep_image_button('button_images_add.gif', IMAGE_ADDITIONAL_NEW) . '</a> <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_images') . '">' . tep_image_button('button_images_del.gif', IMAGE_ADDITIONAL_DEL) . '</a>');
        }
      } else { // create category/product info
        $heading[] = array('text' => '<b>' . EMPTY_CATEGORY . '</b>');

        $contents[] = array('text' => TEXT_NO_CHILD_CATEGORIES_OR_PRODUCTS);
      }
      break;

Share this post


Link to post
Share on other sites

Hey there.. I installed your contribution, and it seems like it would be great for my needs, but I am having trouble getting to actually work.

It appears to, ie. no errors, but the attributes basically show up how they want. I finally got one product the way I want it, but when I use the Attributes copier, the order in which some of the attributes shows up in the wrong order.

 

Obviously this contribution works, so where do you think I'm going wrong.

 

Here is my URL

I only have products in the baby category.

 

http://www.noteworthyinkonline.com/shop/catalog

 

THanks..and I hope you are still monitoring this Thread.

Julie

Edited by julia

Share this post


Link to post
Share on other sites
Hey there.. I installed your contribution, and it seems like it would be great for my needs, but I am having trouble getting to actually work. 

It appears to, ie. no errors, but the attributes basically show up how they want.  I finally got one product the way I want it, but when I use the Attributes copier, the order in which some of the attributes shows up in the wrong order. 

 

Obviously this contribution works, so where do you think I'm going wrong.

 

Here is my URL

I only have products in the baby category.

 

http://www.noteworthyinkonline.com/shop/catalog

 

THanks..and I hope you are still monitoring this Thread.

Julie

 

My theory is that you have not specified the sort-order for the existing attributes. When you install this contribution, it adds the ability to specify sort-order for your product-values and product-attributes. If you have specified the sort-order for the product-values, when you _next_ add a product-attribute for that value, the sort-order will be inherited (copied) automatically. But, if, when you installed the contirbution, you already had some product-attributes created, they will all have a sort-order of 0 specified (thus defaulting to order-by-name....I think). So, you should go through the existing attributes, and set their sort-order values. And, also, set the sort-order values for your product-values table. Then, once that is all done, every new product-attribute you make will have the product sort-order.

 

If I am incorrect (and the sort-order is specified, but it is still not working), then perhaps you need to check that product_info.php was updated with the newest version.

 

Good luck

 

, Robin

Share this post


Link to post
Share on other sites

I have installed this contribution, and things seem to be working fine, except that I can't copy attributes from one product to another. I keep getting this error:

 

1136 - Column count doesn't match value count at row 1

 

insert into products_attributes values ('', '931', '6', '72', '0.00', '+', '0')

 

[TEP STOP]

 

I just can't figure it out!

Share this post


Link to post
Share on other sites
I have installed this contribution, and things seem to be working fine, except that I can't copy attributes from one product to another. I keep getting this error:

I just can't figure it out!

 

Did you successfully apply the change.sql table modifications to the database? (this contribution added a sort_order column to the products_attributes table:

ALTER TABLE products_attributes ADD products_options_sort_order int(6) NOT NULL default '0' AFTER price_prefix;
ALTER TABLE products_options_values_to_products_options ADD products_options_values_sort_order int(6) NOT NULL default '0' AFTER products_options_values_id;

 

If this is not the case, have you added other contributions to your installation? if so, then likely you have more columns in the products_attributes table than this contribution expects, find out what they are, and we can deal with that. (post the results of the SQL "describe products_attributes" and we'll find a solution for you)

Share this post


Link to post
Share on other sites

I did check the database, and the columns are there. I also added a contribution that added radio buttons and check boxes and text area's etc..

So..maybe that is screwing things up.

Robin suggested that some of my products had attributes already, but I deleted everyting before I added these and specified a sort order for eatch of the options, so that is not it...at least ...I'm pretty sure that it is not.

So..not sure what you mean by

"(post the results of the SQL "describe products_attributes" and we'll find a solution for you) "

 

Here are the colums in th products-attributes table

products_attributes_id

products_id

attributes_id

options_values_id

options_values_price

price_prefix

products_options_sort_order

 

Any other information I can supply...let me know.

Julie..Thanks!

Share this post


Link to post
Share on other sites

Any other information I can supply...let me know.

Julie..Thanks!

It is the options type feature that I merged with the sorter. I will take a close look at zeme's merge..and see if i have any errors there. I seem to remember one...questionable section!

Thanks

Julie

Share this post


Link to post
Share on other sites

Julia,

let me explain what I meant when I said I wanted the results to "describe products_attributes"..... You probably recognize SQL like "create table stuff..." or "insert into prodcts_attributes values (...", well, "describe products_attributes" is more-or-less the same type of thing. If you're using adminMySQL, or some other web-based admin tool, you can specify SQL yourself to run right? (the same way you applied change.sql)

 

Here's the thing, when you "describe" something, it reports back on the layout of that table, which is the same as what you told me. (you essentially "described" it to me:

Here are the colums in the products-attributes table

products_attributes_id

products_id

attributes_id

options_values_id

options_values_price

price_prefix

products_options_sort_order

 

Which is fine.....as long as that is EVERY column in the table.

 

Julia, you'll have to excuse me if I'm confused, but I'm assuming that your current error was posted under the name Milly Ramsey (posted about 2 hours before you, to which I replied). Here's the weird analysis of the error so far:

1) It is complaining about inserting 7 columns into products_attributes

2) There used to be 6 columns (before you apply this contribution), so showing 7 trying to be inserted means that you've got the right .php file

3) the description of the products_attributes table also shows 7 columns, so why is there a "column count" mismatch?

 

 

On a side note, other than Option Type Feature (ver 1.71 right? (Link)) and this 5.2b contribution, do you have any other contributions installed on the system?

Share this post


Link to post
Share on other sites

Zeme, Thanks.

Yes, I did do the SQL that was in the installation instructions.

 

My problem was that I had two too many fields at the end of my products_attributes table.

 

products_attributes_weight int(11) 0

products_attributes_weight_prefix int(11) 0

 

This was from another contribution. I don't use weights for my attributes, so I dropped the fields, but I need to take that part out of the other contribution now.

 

Thanks for the suggestion!

 

Also, I am Milly Ramsey, and I think that Julia just didn't notice the quote of my problem that you included in your post and thought you were talking to her, that'll happen sometimes.

Share this post


Link to post
Share on other sites

Thanks Zeme.

 

I am actually not getting an error. It appears to work fine, but just doesn't sort the attributes. The good thing is that when I add products the attributes are in the same order as the product before.

I am going to go over your merge of the options type and the attributes sorter, and make sure I did that correctly. Just waiting till Mon...

Will post my results!

Julie

Share this post


Link to post
Share on other sites

Hi,

I need some help.

 

I am getting this message

1136 - Column count doesn't match value count at row 1

insert into products_attributes values ('', '144', '28', '92', '0.0000', '+', '1')

[TEP STOP]

 

When I try to copy a product and it's attributes.

 

Here are the rows for the products_attributes database.

 

products_attributes_id

products_id

options_id

options_values_id

options_values_price

price_prefix

products_options_sort_order

options_values_weight

 

I do not know allot about php - so some directions (like replace this with this) would be great!

 

I installed the 5.1b and the last fix.

 

Thanks,

Philip

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  

×