Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

move, copy and delete multiple products in one step


Guest

Recommended Posts

  • Replies 197
  • Created
  • Last Reply
  • 2 weeks later...

OK, I hope someone can help me with this...

 

Before I got this contrib, I used Easy Populate to duplicate items in the selected categories that I wanted the product copied because I have almost 2000 products and needed products in third level categories to also list in the second level category for website functionality reasons. However, this was a problem because then in my new products page I had duplicate products.

 

So I installed the contrib and used it to delete all the duplicated products in the second level categories, and everything seemed fine, until I checked the new products page. In the new products page, the duplicated products were still there in the listing. And then, when I clicked on the duplicated product to see product description, it showed the Product Name and model number and then the following mySQL error:

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

select p.products_id from products p, products_to_categories ptc where p.products_status = '1' and p.products_id = ptc.products_id and ptc.categories_id =

 

[TEP STOP]

However, this error does not appear for the product that is actually there. It's like a ghost of the product that I deleted is still there!

 

So now, I don't know what the problem is and really need someone to please please help me out here. I'm about to go live and can't!

 

Thanks.

Link to comment
Share on other sites

products_multi.php / version 2.0

 

installed fine but get the following fatal error:

 

Fatal error: Call to undefined function: tep_array_merge() in c:\appserv\www\catalog\admin\products_multi.php on line 177

 

 

and this is what I see when I click on the "Multi Products Move/Copy" link:

 

HEADING_TITLE

HEADING_TITLE_SEARCH

HEADING_TITLE_GOTO

 

Fatal error: Call to undefined function: tep_array_merge() in c:\appserv\www\catalog\admin\products_multi.php on line 177

choose TABLE_HEADING_CATEGORIES_PRODUCTS (Prod.-No.) / TABLE_HEADING_STATUS TABLE_HEADING_ACTION

 

 

everything from line 177 to 182 in catalog\admin\products_multi.php:

 

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified, c.categories_status from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' and cd.categories_name like '%" . $HTTP_GET_VARS['search'] . "%' order by c.sort_order, cd.categories_name");

} else {

 

------------------------------------------------------------------

 

When selecting a subcategory I get the following fatal error:

 

Fatal error: Call to undefined function: tep_array_merge() in c:\appserv\www\catalog\admin\products_multi.php on line 223

 

everything from line 223 to 230 in catalog\admin\products_multi.php:

 

tep_get_path($categories['categories_id'])) . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_PRODUCTS_MULTI, 'cPath=' . $cPath . '&cID=' . $categories['categories_id']) . '\'">' . "\n";

}

 

 

Any help would be appreciated!

 

Michael

Michael

Link to comment
Share on other sites

  • 3 weeks later...

I just installed this and initially got a similar error.. (maybe not the exact error you have) then I noticed at the bottom of the text file that came with the contrib it reads

// the function tep_array_merge seems to be missing in some newer versions of
//  the osc-shop, esp. oscommerce-2.2ms2
//
// well - here it is, please add it to the /admin/includes/functions/general.php :


 function tep_array_merge($array1, $array2, $array3 = '') {
   if ($array3 == '') $array3 = array();
   if (function_exists('array_merge')) {
     $array_merged = array_merge($array1, $array2, $array3);
   } else {
     while (list($key, $val) = each($array1)) $array_merged[$key] = $val;
     while (list($key, $val) = each($array2)) $array_merged[$key] = $val;
     if (sizeof($array3) > 0) while (list($key, $val) = each($array3)) $array_merged[$key] = $val;
   }

   return (array) $array_merged;
 }

 

Once I pasted the function into general.php it worked like a charm, and saved me about 2 hours worth of work

 

Without a doubt the most useful contrib I've found so far. Awesome job! :)

Link to comment
Share on other sites

  • 2 weeks later...
2. - link it to catalog.php with a line like:

'<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, '', 'NONSSL') . '" class="menuBoxContentLink">multi prods move/copy</a><br>' .

 

Would someone please explain how to do this to a non-PHPer/coder.

 

Thanks

Link to comment
Share on other sites

QUOTE 

2. - link it to catalog.php with a line like:

'<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, '', 'NONSSL') . '" class="menuBoxContentLink">multi prods move/copy</a><br>' .

 

I'm confused too. Can someone please give instructions?

Link to comment
Share on other sites

  • 2 weeks later...

I hope this is the answers that you all are looking for.....

admin - copy, move and delete multiple products v2.1

 

I have just uploaded v2.1 which has Very Detailed Instructions, "Very Minor" cosmetic changes, and proper organization of files.

 

If you download this new version it will have all the instructions you will need and should answer your questions.

 

All Credit goes to the Original Author Stefan Rueter.

 

Great Mod Stefan, Thanks Again!

 

~Steel

 

:thumbsup:

Link to comment
Share on other sites

I hope this is the answers that you all are looking for.....

admin - copy, move and delete multiple products v2.1

 

I have just uploaded v2.1 which has Very Detailed Instructions, "Very Minor" cosmetic changes, and proper organization of files.

 

If you download this new version it will have all the instructions you will need and should answer your questions.

 

All Credit goes to the Original Author Stefan Rueter.

 

Great Mod Stefan, Thanks Again!

 

~Steel

 

:thumbsup:

 

The thing with this contribution is that it will LINK a product in another category using the same product id. It will NOT COPY or DUPLICATE a product with a new product id into another category, or the same category, for that matter.

 

:o :huh: :blink: :-" >_< :'( <_<

Michael

Link to comment
Share on other sites

Getting the following error after install

Fatal error: Call to undefined function: tep_get_category_tree() in /home2/wendy/simplyfancydress-www/catalog/admin/products_multi.php on line 133

 

Any ideas?

 

Also found that I am getting numerous errors elsewhere in admin.

 

If I delete the function_tep_array addition in general.php. these errors go but i then get the following

Fatal error: Call to undefined function: tep_array_merge() in /home2/wendy/simplyfancydress-www/catalog/admin/products_multi.php on line 177

Link to comment
Share on other sites

Also found that I am getting numerous errors elsewhere in admin.

 

If I delete the function_tep_array addition in general.php. these errors go but i then get the following

Fatal error: Call to undefined function: tep_array_merge() in /home2/wendy/simplyfancydress-www/catalog/admin/products_multi.php on line 177

 

As is always the way as soon as I post i find the problem

 

changed all the tep_array_merge to array_merge in products_multi.php and errors have gone.

Link to comment
Share on other sites

Hello,

 

This is a wonderful tool that I have needed. I got the contribution to work perfectly in my test osCommerce store. When I saw it was ok, I then did all the mods in my osC MAX version that is live. I Know everything is correct as I mostly copy and pasted the code needed and Triple checked that all files and mods are in the correct plae. BUT, when I go to the admin, it is not there. I am totally stumped as it works perfectly in my osCommerce site.

 

Does this contribution not work in the MAX version of osCommerce?????

 

Thanks to any that reply. I really want to use this, but right now can't figure out why it works in one and not the other.

 

Kriss

Link to comment
Share on other sites

Hello,

 

This is a wonderful tool that I have needed. I got the contribution to work perfectly in my test osCommerce store. When I saw it was ok, I then did all the mods in my osC MAX version that is live. I Know everything is correct as I mostly copy and pasted the code needed and Triple checked that all files and mods are in the correct plae. BUT, when I go to the admin, it is not there. I am totally stumped as it works perfectly in my osCommerce site.

 

Does this contribution not work in the MAX version of osCommerce?????

 

Thanks to any that reply. I really want to use this, but right now can't figure out why it works in one and not the other.

 

Kriss

 

Kriss

When u say its not there, do you mean the link is missing?

Or you get an error message re the file?

Link to comment
Share on other sites

Very great contribution, one that easily could be included in the next relaese of OS.

Very easy to install - 2 min, and easy to use.

 

I have the same product i different categories and in the past i used the standard copy funktion - now I copy them all in no time.

 

Note:

Care should be taken not to (by mistake) to delete products.

 

Future suggestions to this great mod.

Move and copy category with all products

Funktion - Warning - du you realy want to delete

 

But a lot of thanks from me for this mod.

 

Christian

Link to comment
Share on other sites

hi

thanx for this good work

 

but i got a little warning in the admin area:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/www/web1/html/shop/catalog/admin/includes/functions/general.php:2760) in /home/www/web1/html/shop/catalog/admin/includes/functions/sessions.php on line 67

 

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/web1/html/shop/catalog/admin/includes/functions/general.php:2760) in /home/www/web1/html/shop/catalog/admin/includes/functions/sessions.php on line 67

 

can somebody help me?

 

t.

Link to comment
Share on other sites

tiamat,

check your php files that are listed in the error, I think that is caused by white space at the end of the file. but i cant remeber so im not saying im 100% sure.

 

PHP is very picking if you have any space after the last line in a php file it will cause errors, that, i am 100% sure of.

 

I hope this helps let me know if it does or doesnt

 

Steel

Link to comment
Share on other sites

tiamat,

check your php files that are listed in the error, I think that is caused by white space at the end of the file. but i cant remeber so im not saying im 100% sure.

 

:)

now everything is okay :)

 

thanx alot

 

t.

Link to comment
Share on other sites

Very great contribution, one that easily could be included in the next relaese of OS.

Very easy to install - 2 min, and easy to use.

 

I have the same product i different categories and in the past i used the standard copy funktion - now I copy them all in no time.

 

Note:

Care should be taken not to (by mistake) to delete products.

 

Future suggestions to this great mod.

Move and copy category with all products

Funktion - Warning - du you realy want to delete

 

But a lot of thanks from me for this mod.

 

Christian

 

I wrote a mod "copy category" that copies a category with all its products to a new place. Check it out if needed...

 

http://www.oscommerce.com/community/contributions,2215

 

Didier.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

There seems to be a major problem with this: whenever you copy products and change the name/price it also changes them for the original product. Is there a way to prevent this? So if I copy some products to another category and want to make some adjustments in the name and price, the original product stays as it was?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...