Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"copy, move and delete multiple products" addon doesn't work


midpen

Recommended Posts

I was installing the "copy, move and delete multiple products" addon. It does not work. When I click catolog/multiple products manager, nothing happened. Could anybody please help for checking what I did wrong:

 

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

 

*****

Step 1

*****

I copied the two files into their corresponding directories:

/admin/products_multi.php

/admin/includes/languages/english/products_multi.php

 

*****

Step 2 - In /admin/includes/boxes/catalog.php

*****

'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .

 

add this:

 

'<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI . '</a><br>' .

 

'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .

 

*****

Step 3 - In /admin/includes/filenames.php

*****

('FILENAME_STATS_PRODUCTS_PURCHASED', 'stats_products_purchased.php');

define('FILENAME_STATS_PRODUCTS_VIEWED', 'stats_products_viewed.php');

define('FILENAME_TAX_CLASSES', 'tax_classes.php');

define('FILENAME_TAX_RATES', 'tax_rates.php');

define('FILENAME_WHOS_ONLINE', 'whos_online.php');

define('FILENAME_ZONES', 'zones.php');

 

Add this at the very end:

 

define('FILENAME_PRODUCTS_MULTI', 'products_multi.php');

?>

*****

Step 4 - In /admin/includes/languages/english.php

*****

define('SUCCESS_FILE_SAVED_SUCCESSFULLY', 'Success: File upload saved successfully.');

define('WARNING_NO_FILE_UPLOADED', 'Warning: No file uploaded.');

define('WARNING_FILE_UPLOADS_DISABLED', 'Warning: File uploads are disabled in the php.ini configuration file.');

 

Add this at the very end:

 

define('BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI', 'Multiple Products Manager');

?>

 

*****

Step 5 - In /admin/includes/stylesheet.css

*****

 

.dataTableContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; }

 

Add :

 

.dataTableContentRedAlert { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #FF0000; font-weight: bold; }

 

/* info box */

.infoBoxHeading { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #ffffff; background-color: #B3BAC5; }

.infoBoxContent { font-family: Verdana, Arial, sans-serif; font-size: 10px; color: #000000; background-color: #DEE4E8; }

 

******

Step 6 - In /admin/includes/functions/general.php

******

 

function tep_parse_category_path($cPath) {

// make sure the category IDs are integers

$cPath_array = array_map('tep_string_to_int', explode('_', $cPath));

 

// make sure no duplicate category IDs exist which could lock the server in a loop

$tmp_array = array();

$n = sizeof($cPath_array);

for ($i=0; $i<$n; $i++) {

if (!in_array($cPath_array[$i], $tmp_array)) {

$tmp_array[] = $cPath_array[$i];

}

}

 

return $tmp_array;

}

 

Add this at the very end:

function tep_merge_array($array1, $array2, $array3 = '') {

if ($array3 == '') $array3 = array();

if (function_exists('merge_array')) {

$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;

}

?>

Edited by midpen
Link to comment
Share on other sites

There also was a recent update:

http://www.oscommerc...y/contributions,1401

 

A small fix 3 Nov 2009

 

When I use it, an error popup:

Fatal error: Call to undefined function:tep_array_merge() in C:AppServ/www/oscomm_2/catalog/admin/products_multi.php, after I Google it, the function 'tep_array_merge()' should be 'merge_array()', so is the same thing on line 278.

 

I do not quite sure how to modify according to the "A small fix" addon.

Link to comment
Share on other sites

There also was a recent update:

http://www.oscommerc...y/contributions,1401

 

A small fix 3 Nov 2009

 

When I use it, an error popup:

Fatal error: Call to undefined function:tep_array_merge() in C:AppServ/www/oscomm_2/catalog/admin/products_multi.php, after I Google it, the function 'tep_array_merge()' should be 'merge_array()', so is the same thing on line 278.

 

I do not quite sure how to modify according to the "A small fix" addon.

hi

 

admin/includes/functions/general.php

find

function tep_merge_array($array1, $array2, $array3 = '') {

 

replace it with

function tep_array_merge($array1, $array2, $array3 = '') {

 

steve

Link to comment
Share on other sites

I added this in the last part, still no luck! What it should be though? It is such confused: should be function tep_array_merge or function tep_merge_array or just merge_array, Where is the other place should be changed? I did not get the "Call to undefined....." error message, just when I click catolog/multiple products manager, goes to "The website cannot display the page" in my browser. Thanks for your help!

 

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;

}

Edited by midpen
Link to comment
Share on other sites

I added this in the last part, still no luck! What it should be though?

 

 

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;

}

Hi

this is what i have on my site and it works fine, its same as yours, you did add it to admin/includes/functions/general.php and not catalog/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;
 }

 

what error are you getting after you changed the function name?

Steve

Edited by steve_s
Link to comment
Share on other sites

Hi

this is what i have on my site and it works fine, its same as yours, you did add it to admin/includes/functions/general.php and not catalog/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;
 }

 

what error are you getting after you changed the function name?

Steve

 

 

Thank you so much!

Actually I did not get any error message, when I click catolog/multiple products manager in admin panel, it goes to "The website cannot display the page" in my browser.

 

Could you please check my each steps which posted on the top to see what was wrong including those pasted positions. I don't know php, I did copy and paste only. I really need this to work out and I am waiting for you, thanks a lot!

 

Yes I did pasted it to admin/includes/functions/general.php

Edited by midpen
Link to comment
Share on other sites

Thank you so much!

Actually I did not get any error message, when I click catolog/multiple products manager in admin panel, it goes to "The website cannot display the page" in my browser.

 

Could you please check my each steps which posted on the top to see what was wrong including those pasted positions. I don't know php, I did copy and paste only. I really need this to work out and I am waiting for you, thanks a lot!

 

Yes I did pasted it to admin/includes/functions/general.php

Hi

 

If your getting page not found it has to do with admin/includes/filenames.php or the file in admin is not there paste the url when you get page not found

 

Steve

Link to comment
Share on other sites

I did all over again, still the same. I am so frustrated!

try this

 

in /admin/includes/boxes/catalog.php

*****

 

find

'<a href="' . tep_href_link(FILENAME_PRODUCTS_MULTI, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI . '</a><br>' .

 

replace with

 

'<a href="' . tep_href_link('products_multi.php', '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_MULTI . '</a><br>' .

Link to comment
Share on other sites

Thank you so much Steve, It worked!

 

 

Since you are an expert, I have another question:

 

 

I was login on my site and after I click "Top" on the header, it ticks me out, I have to re-login.

 

How can I remain login wherever I click unless I close the browser or logoff?

 

I am new in OSC and don't know php, could you please tell me what and where to write like above? Thank you!

Edited by midpen
Link to comment
Share on other sites

Thank you so much Steve, It worked!

 

 

Since you are an expert, I have another question:

 

 

I was login on my site and after I click "Top" on the header, it ticks me out, I have to re-login.

 

How can I remain login wherever I click unless I close the browser or logoff?

 

I am new in OSC and don't know php, could you please tell me what and where to write like above? Thank you!

Hi

 

It shouldn't log you out unless your store is in a folder, then the session id will be lost if you click back to store

 

to change Top find in catalog/includes/languages/english/english.php

define('HEADER_TITLE_TOP', 'Top');

 

simply amend Top to what you want

 

Steve

Link to comment
Share on other sites

Hi

 

It shouldn't log you out unless your store is in a folder, then the session id will be lost if you click back to store

 

to change Top find in catalog/includes/languages/english/english.php

define('HEADER_TITLE_TOP', 'Top');

 

simply amend Top to what you want

 

Steve

 

My store is not in a folder, this is the only store in my hosting, and it is directly under public_html

 

I already changed the "Top" to "Home" which makes more sense.

 

When I click home, it still ticks me out. Anywhere else seemed ok including click store logo on the top, it brings me back to the homepage without logout.

Link to comment
Share on other sites

My store is not in a folder, this is the only store in my hosting, and it is directly under public_html

 

I already changed the "Top" to "Home" which makes more sense.

 

When I click home, it still ticks me out. Anywhere else seemed ok including click store logo on the top, it brings me back to the homepage without logout.

in includes/apllication_top.php

find

$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);

replace it with

$breadcrumb->add(HEADER_TITLE_TOP, tep_href_link(FILENAME_DEFAULT));

 

Steve

Link to comment
Share on other sites

in includes/apllication_top.php

find

$breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER);

replace it with

$breadcrumb->add(HEADER_TITLE_TOP, tep_href_link(FILENAME_DEFAULT));

 

Steve

 

Thanks Steve, clicking "Home" is working now by replacing your code.

 

Unfortunately, the "copy, move and delete multiple products" still does not work properly.

when I click "Multiple Products Manager" in the admin panel, it seemed showing properly, but it only shows all product folders, what inside the folders are all empty.

 

when I click "go" button on screen, these were the error message I got:

when select "Move To":

Warning: Invalid argument supplied for foreach() in /home1/database/public_html/admin/products_multi.php on line 39

 

Warning: Cannot modify header information - headers already sent by (output started at /home1/ database /public_html/admin/products_multi.php:39) in /home1/ database /public_html/admin/includes/functions/general.php on line 22

 

when click "Copy to": the first error changed to

Warning: Invalid argument supplied for foreach() in /home1/ database /public_html/admin/products_multi.php on line 66

 

when select"Link To": the first error changed to

Warning: Invalid argument supplied for foreach() in /home1/database/public_html/admin/products_multi.php on line 52

 

Could you please help me? Thank you so much! Hope I did not drive you crazy.

Link to comment
Share on other sites

Thanks Steve, clicking "Home" is working now by replacing your code.

 

Unfortunately, the "copy, move and delete multiple products" still does not work properly.

when I click "Multiple Products Manager" in the admin panel, it seemed showing properly, but it only shows all product folders, what inside the folders are all empty.

 

when I click "go" button on screen, these were the error message I got:

when select "Move To":

Warning: Invalid argument supplied for foreach() in /home1/database/public_html/admin/products_multi.php on line 39

 

Warning: Cannot modify header information - headers already sent by (output started at /home1/ database /public_html/admin/products_multi.php:39) in /home1/ database /public_html/admin/includes/functions/general.php on line 22

 

when click "Copy to": the first error changed to

Warning: Invalid argument supplied for foreach() in /home1/ database /public_html/admin/products_multi.php on line 66

 

when select"Link To": the first error changed to

Warning: Invalid argument supplied for foreach() in /home1/database/public_html/admin/products_multi.php on line 52

 

Could you please help me? Thank you so much! Hope I did not drive you crazy.

Hi

 

headers already sent by (output started at /home1/ database /public_html/admin/products_multi.php:39) in /home1/ database /public_html/admin/includes/functions/general.php on line 22

this is due probably due to white spaces on products_multi.php or /admin/includes/functions/general.php or you have duplicated code

 

rest is due to mysql5 send me an pm with a list of files that contribution uses i will send you mine see if that helps

 

Steve

Link to comment
Share on other sites

  • 3 weeks later...

Hello all,

 

I have installed this module and it seems to work fine except the only place I can see individual files is at the TOP location. Files anywhere else in the tree do not display. Can anyone assist me troubleshooting this?

 

Best regards,

Mark

 

UPDATE: Resolved. Found out that that small patch CAUSED my problem. Reverted back to original code and all is well.

 

//$pInfo_array = merge_array($products, $reviews);

$pInfo_array = tep_array_merge($products, $reviews);

 

Anyone have any idea why?

Edited by cbhank
Link to comment
Share on other sites

  • 2 weeks later...

Hello;

 

I have an odd problem since installing this contrib yesterday.

When in admin, I pull up one of my main product categories, and many

of my products are now not showing in the list. However, when I go to

my site, they are listed there.

Also, I seem to have "lost" several products that I'd loaded in a few

weeks back.

 

Any ideas?

 

Thanks,

Karen

Link to comment
Share on other sites

  • 3 weeks later...

The products_multi.php , tried the addon and everything else on forums - does not work - someone needs to update the addon so it does.

2 hours gone to waste.

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I've had another kind of problem with my installation. I can get the whole thing working as far as seeing the folders is concerned, but they're are no actual products in any of them to see. I'm thinking that perhaps it's a clash of 2 seperate modules/add on's that may be the problem.

 

I've experimented to see if the module actually works, even though it's not showing any products at all. In other words I've tried to move folders into other folders, but it came up with the error:

 

Warning: Invalid argument supplied for foreach() in ******/catalog/admin/products_multi.php on line 39

 

Warning: Cannot modify header information - headers already sent by (output started at ******/catalog/admin/products_multi.php:39) in ******catalog/admin/includes/functions/general.php on line 22

 

Can list all the modules I'm using or the places it specifies above if this aids in a solution.

 

Thank you if you're able to help.

 

Nefandous

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

As I seen on another post someone having the same problem:

 

another post, same problem

 

I found out with this addon that the reason if you have both products and categories showing inside a category and some products aren't not showing it is because you have no manufacturer_id set for those products.

 

In that case create a generic manufacturer, take note of the id by looking at the manufacturers_id table in the manufacturer table in PHPmyadmin.

 

I then fixed it this by entering phpmyadmin,

 

Then run an SQL query to update all products manufacturers_id set as 0 (no manufacturer assigned) to 8 (where 8 is YOUR manufacturer ID):

 

UPDATE products SET manufacturers_id = '8' WHERE manufacturers_id  = '0';

Edited by chrish123
Link to comment
Share on other sites

  • 6 months later...

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