Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

McGrath's Attributes Sorter Copier Install


websissy

Recommended Posts

Hi

 

I hope I'm in the right place. This contribution seems to have a very low profile which I cant understand as it seems to be one of the few contributions that gets a grip of ordering attributes

 

One of the reasons I missed it is the contribution title is "attribute copier" which is half the function! Its not until you start digging that you find more. Can one of the moderators sort this please?

 

I think I have intergrated it onto my site ok, the only fun I had was sorting out compatibility with "Admin Access Level Accounts 2" & "More_Pics_6 for 2.2 ms2"

 

I only seem to have one quirk and I wonder whether anyone can guide me on this

 

File /catalog/product_info.php contains the following code

 

// BOF: WebMakers.com Added: Show Category and Image
if (SHOW_CATEGORIES=='1') {
?>
	  <tr><td colspan="2"><table align="right">
		<tr>
		  <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . tep_get_categories_image(tep_get_products_catagory_id($product_info_values['products_id']))); ?></td>
		</tr>
		<tr>
		  <td class="main" align="center"><?php echo tep_get_categories_name(tep_get_products_catagory_id($product_info_values['products_id'])); ?></td>
		</tr>
	  </table></td></tr>
<?php
}
// EOF: WebMakers.com Added: Show Category and Image

 

When I came to intergrate it I realised it sat in the middle of the "More Pics.." contribution. I tried a number of different intergrations but all I got was the creation of white space above the product description and images. There didnt seem to be any functionality change

 

I have pro tem taken it out

 

Question 1 what does the code do - is its function vital and has anyone else come across this before?

 

Question 2 I am proposing to install with "New Attribute Manager v.5.0" - has anyone done this and had any problems or quirks?

 

Thank you

 

Nossum

Link to comment
Share on other sites

  • 1 month later...
  • Replies 69
  • Created
  • Last Reply

Top Posters In This Topic

Hi Can you help, I've just followed all the instructions and installed the attributes copier v5.1b.

 

My shop had a lot of products and attributes but I know I have more do do so I thought this contribution would save me time.

 

When I look at a product from the catalog I get the follow error -

 

1054 - Unknown column 'pa.products_options_sort_order' in 'order clause'

 

select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from products_attributes pa, products_options_values pov where pa.products_id = '169' and pa.options_id = '6' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '1' order by pa.products_options_sort_order, pa.options_values_price

 

[TEP STOP]

 

 

I also get a similar error when I look at the attributes screen in admin

 

1054 - Unknown column 'pov2po.products_options_values_sort_order' in 'field list'

 

select pov.products_options_values_id, pov.products_options_values_name, pov2po.products_options_id, pov2po.products_options_values_sort_order from products_options_values pov left join products_options_values_to_products_options pov2po on pov.products_options_values_id = pov2po.products_options_values_id where pov.language_id = '1' order by pov.products_options_values_id

 

[TEP STOP]

 

This is displayed in the right hand column under options values.

 

Can someone please help?

Link to comment
Share on other sites

In the contribution there are instructions and a file for modification of the database tables. These changes add the columns that are now giving you errors. Perahps you forgot that step?

 

You should be able to find a file that has something like "ALTER TABLE..." in it, you'll need to apply that file to your database.

 

Hi Can you help, I've just followed all the instructions and installed the attributes copier v5.1b.

 

My shop had a lot of products and attributes but I know I have more do do so I thought this contribution would save me time.

 

When I look at a product from the catalog I get the follow error -

 

1054 - Unknown column 'pa.products_options_sort_order' in 'order clause'

 

select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from products_attributes pa, products_options_values pov where pa.products_id = '169' and pa.options_id = '6' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '1' order by pa.products_options_sort_order, pa.options_values_price

 

[TEP STOP]

 

 

I also get a similar error when I look at the attributes screen in admin

 

1054 - Unknown column 'pov2po.products_options_values_sort_order' in 'field list'

 

select pov.products_options_values_id, pov.products_options_values_name, pov2po.products_options_id, pov2po.products_options_values_sort_order from products_options_values pov left join products_options_values_to_products_options pov2po on pov.products_options_values_id = pov2po.products_options_values_id where pov.language_id = '1' order by pov.products_options_values_id

 

[TEP STOP]

 

This is displayed in the right hand column under options values.

 

Can someone please help?

Link to comment
Share on other sites

In the contribution there are instructions and a file for modification of the database tables. These changes add the columns that are now giving you errors. Perahps you forgot that step?

 

You should be able to find a file that has something like "ALTER TABLE..." in it, you'll need to apply that file to your database.

 

 

You are a super star thank you very much ! I'd go 2 databases that I'd been working on and applied this to the wrong database.

 

Thanks again.

 

Ian

Link to comment
Share on other sites

After thinking that everything was working file with the Attribute Copier I've just tried to copy an existing product to a new product while taking the existing attributes to the new item.

 

Trouble is I've just had this error message

 

Fatal error: Call to undefined function: tep_copy_products_attributes() in /home/grandpri/public_html/catalog/admin/categories.php on line 390

 

Any help would be appreciated. Again ! :-"

Link to comment
Share on other sites

I don't have the code in front of me, but I'm guessing that perhaps you haven't patched that function into the necessary file. I would suggest that you:

- Search the contribution's patches for "tep_copy_product_attributes", find out which file it's supposed to be applied to. (You'll have to find the patch that includes the function's definition (ie: body of the function)).

- Find the target file on your system, and inspect it to see if the function has been patched in.

Link to comment
Share on other sites

  • 11 months later...

I just installed the latest Sorter Copier.

Everything appears where it should but I am a little confused as to whether it's actually doing what it's supposed to on the storefront side.

 

The copy feature appears to work.

BUT

 

I have a product with options ABCD.

I ordered their sort order 1234 which corresponds to their alpha order.

The options are displaying 4312... not in any order.

 

I numbered the order on the product options entry page.

The correct numbers display in the (cool new) product editing module.

 

What did I do wrong?

Thanks!

Amy

Link to comment
Share on other sites

More information...

 

The option values are being displayed in the order of their Product IDs.

Apparently, the sort is not working.

 

I double checked the files I uploaded. I'm pretty sure I did everything right. I had a pretty fresh install of the latest STS.

 

Any help at all will be greatly appreciated.

-Amy

Link to comment
Share on other sites

  • 1 month later...

I've installed three times. Everything works, no errors, but the sort order does not function. Any ideas?

 

David Ross

 

More information...

 

The option values are being displayed in the order of their Product IDs.

Apparently, the sort is not working.

 

I double checked the files I uploaded. I'm pretty sure I did everything right. I had a pretty fresh install of the latest STS.

 

Any help at all will be greatly appreciated.

-Amy

Link to comment
Share on other sites

Found the answer. The problem was created because STS was also installed on my site. Here's how to get McGrath's Attributes Sorter Copier to work with STS:

 

OPEN:

catalog/includes/modules/sts_inc/product_info.php

 

FIND:

 

// Select the list of attribute (option) names

$products_options_name_query = 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='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

 

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

$products_options_array = array();

$products_options_query = 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 . "'");

 

// For each option name, get the individual attribute (option) choices

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

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

 

// If the attribute (option) has a price modifier, include it

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

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

}

 

}

 

// If we should select a default attribute (option), do it here

if (isset($cart->contents[$_GET['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

 

REPLACE WITH:

 

// Select the list of attribute (option) names// BOF: WebMakers.com: Attributes Copy and Sort

$products_options_name_query = 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='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_id");

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array();

 

// BOF: WebMakers.com Added: Attributes Copy and Sort

if ( PRODUCTS_OPTIONS_SORT_BY_PRICE !='1' ) { $products_options_query = 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 . "'" . " order by pa.products_options_sort_order, pov.products_options_values_name"); } else { $products_options_query = 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 . "'" . " order by pa.products_options_sort_order, pa.options_values_price"); }

 

// EOF: WebMakers.com Added: Attributes Copy and Sort

while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } }

 

// EOF: WebMakers.com and AMY Added: Attributes Copy and Sort

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

 

 

I've installed three times. Everything works, no errors, but the sort order does not function. Any ideas?

 

David Ross

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...

Hey All,

 

I'm building a new store based on my old MS2, and just installed the contribution. (version 5.1b - As it seemed the best fit date wise)

 

I have an error, I know what it's from, but can't find the code to repair. I have a field in the database, that this contribution doesn't look for, so I need to add it to a query, or function. Here's the error:

 

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

insert into products (products_quantity, products_model,products_image, products_mediumimage,
products_largeimage, products_msrp, products_price, products_date_added,
products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id)
values('0', '', 'retangular_sm.jpg', 'retangular_md.jpg', 'retangular_lg.jpg', '92.5200',
now(), null, '0.00', '0', '1', '0')

[TEP STOP]

 

It is on the admin/catagories.php file, when you try to copy a product. The field causing the problem is 'products_msrp' which I can see is missing from the values it tried to paste.

 

Anyone take a look at this? I can post the entire catagories.php if needed. I've gone over it, and can't find where I need to add the 'products_msrp' field in.

 

Thanks! :)

 

PS... not a lot of action in this thread anymore! There must be a newer contribution huh?

Edited by knipper

Steve K AKA - Knipper -

Link to comment
Share on other sites

The error is saying that the number of these (13)

(products_quantity, products_model,products_image, products_mediumimage,products_largeimage, products_msrp, products_price, products_date_added,products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id)

don't match these (12)

values('0', '', 'retangular_sm.jpg', 'retangular_md.jpg', 'retangular_lg.jpg', '92.5200',now(), null, '0.00', '0', '1', '0')

It looks like it is the products_msrp but you will need to figure that out and add it.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks JackMCS,

 

You have helped me numerous time in the past as far back as a couple years ago. I always appreciate it! :)

 

I already new what field was causing the problem... I just can't figure out where in the contibution I need to add the missing code for that field. I assume it is somewhere on the catagories.php page (Where the error occurs) but I've gone up & down the code, and can't find it. (Then again it was almost 2am... and I'd been working all day!)

 

Would you take a look at code on the page and see what you think... or could it be in her function file or javascript? I can paste my categories.php if you'd like. I looked for an area where the fields are listed, but just don't see it!

 

Thanks again!

 

The error is saying that the number of these (13)
(products_quantity, products_model,products_image, products_mediumimage,products_largeimage, products_msrp, products_price, products_date_added,products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id)

don't match these (12)

values('0', '', 'retangular_sm.jpg', 'retangular_md.jpg', 'retangular_lg.jpg', '92.5200',now(), null, '0.00', '0', '1', '0')

It looks like it is the products_msrp but you will need to figure that out and add it.

 

Jack

Steve K AKA - Knipper -

Link to comment
Share on other sites

The of the first part is products_largeimage, products_msrp so it would go after 'retangular_lg.jpg',. The value would comefrom an earler line where the database was read in. Or, if that section of doesn't need to update that value, products_msrp can be deleted from the first part.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi again... I still can't see where I need to add the products_msrp field into her code. I can see an earlier query, that includes it, but here queries for copying don't call all the fields that are being copied individually. I'll show you a couple examples:

 
$sql_data_array = array
('products_quantity' => 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_msrp' => tep_db_prepare_input($HTTP_POST_VARS['products_msrp']),
'products_date_available' => $products_date_available,
'products_weight' => 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' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']), 
'disable_addtobasket' => tep_db_prepare_input($HTTP_POST_VARS  'disable_addtobasket']));

 

The products_msrp is referenced several times in the file.

 

However... the code used for the contribution looks like this:

///////////////////////////////////////////////////////////////////////////////////////
// BOF: WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
     case 'create_copy_product_attributes':
 // $products_id_to= $copy_to_products_id;
 // $products_id_from = $pID;
       tep_copy_products_attributes($pID,$copy_to_products_id);
       break;
// EOF: WebMakers.com Added: Copy Attributes Existing Product to another Existing Product
///////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////
// WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in a Category
     case 'create_copy_product_attributes_categories':
 // $products_id_to= $categories_products_copying['products_id'];
 // $products_id_from = $make_copy_from_products_id;
 //  echo 'Copy from products_id# ' . $make_copy_from_products_id . ' Copy to all products in category: ' . $cID . '<br>';
       $categories_products_copying_query= tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . $cID . "'");
       while ( $categories_products_copying=tep_db_fetch_array($categories_products_copying_query) ) {
         // process all products in category
         tep_copy_products_attributes($make_copy_from_products_id,$categories_products_copying['products_id']);
       }
       break;
// EOF: WebMakers.com Added: Copy Attributes Existing Product to All Existing Products in a Category
///////////////////////////////////////////////////////////////////////////////////////

 

There is a lot of new code for her contibution, for different copy functions that are added... but as I said... I just can't find an array, or spot in the new code to add that products_msrp field.

 

I really didn't think it wouldn't be that tough to find. :blink:

 

 

 

The of the first part is products_largeimage, products_msrp so it would go after 'retangular_lg.jpg',. The value would comefrom an earler line where the database was read in. Or, if that section of doesn't need to update that value, products_msrp can be deleted from the first part.

 

Jack

Edited by knipper

Steve K AKA - Knipper -

Link to comment
Share on other sites

Attributes Sorter is a nice contribution but the author chose to use non-oscommerce-standard coding techniques so it makes fixing problems like this a little more difficult. Perhaps asking in the support thread for the other contribuiton will find someone that has that change already installed?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks again Jack... I'm buzzing around the forum to see if I can find anything. I am posting the entire admin/categories.php file below in case yo anyone can cruise through and see if you see anything sticking out that may be the change I need.

 

Ooopppssss..... The whole page is too long to post. I'll copy most of her code for the copy functions....

 

 

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

Steve K AKA - Knipper -

Link to comment
Share on other sites

Hey JackMCS,

 

If you're still around... it wasn't this contribution causing my error after all. I was out of town for a week, and when I came back started to work on a site that didn't have this contribution installed. Sure enough the problem was on this site! Bummer.

 

Anyway, I started a new thread here:

http://www.oscommerce.com/forums/index.php?showtopic=329891

and was hoping you could take another look to see if you could help.

 

Thanks!

Steve K AKA - Knipper -

Link to comment
Share on other sites

Found the answer! In the lines:

 tep_db_query("insert into " . TABLE_PRODUCTS . (SNIP)

although the products_msrp line was in the values portion, it was missing this entry:

'" . tep_db_input($product['products_msrp']) . "',

therefore it was a column short when trying to insert the data.

Edited by knipper

Steve K AKA - Knipper -

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