Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Populate & Products Attributes


VJ

Recommended Posts

Hi Surfalot thanks for the reply please see below

 

Windows 2k (SAMBAR)

oscommerce-2.2ms2-051113

PHP Version 5.2.3

MySQL 5.0.27

$curver = '2.76d-MS2';

I have tried the two links you highlight and had applied these changes (and read ALL these pages) but to no avail,

It has been a buggy bumpy ride but one keeps going! ...i've modified the rest of the shop with the register globals patches ok and all is settled and running fine so far, just this fact I can't upload... I can download no problem and followed it going through the GET (IF's)

but I cant suss out where it's bailing out... I dont get an error as such just page cannot be displayed, I even tried moving the $split to POST as a hidden form element LOL (digging deep!)

I think it's a FILES upload problem but i'm new to php and just stabbing in the dark now!

 

any idea's??? (sit's down scratching one's head)

 

 

 

 

so sorry I forgot to post some example data... it's as given to me from the export:

 

"300","300 Base Unit.gif","300mm Base Unit","<p>300mm Base Unit</p>","","38.7","0.00","","2007-04-07 23:55:19","99","1","Color","2","Size","1","115 x 596","","2","175 x 596","","3","140 x 496","","4","140 x 596","","5","283 x 496","","6","283 x 596","","7","140 x 996","","8","283 x 996","","9","355 x 596","","10","335 x 496","","11","450 x 596","","12","495 x 596","","13","570 x 596","","14","895 x 596","","15","(2) 715 x 296 ICB Door Set","","16","715 x 296","","17","715 x 396","","18","715 x 446","","19","715 x 496","","20","715 x 596","","21","1245 x 296","","22","1245 x 496","","23","1245 x 596","","24","(3) 140 x 496 with (1) 283 x 496","","25","(1) 140 x 596 with (2) 283 x 596","","26","(1) 140 x 996 with (2) 283 x 996","","27","715 x 396 Glazed","","28","715 x 496 Glazed","","29","1200 x 496 Glazed Dresser Door","","30","(1) 715 x 296 with (1) 1245 x 296","","31","(1) 715 x 496 with (1) 1245 x 496","","32","(1) 715 x 596 with (1) 1245 x 596","","33","300 larder door - 715 x 296 & 1245 x 296","","34","500 larder door - 715 x 496 & 1245 x 496","","35","600 larder door - 715 x 596 & 1245 x 596","","36","Worktop (40mm) 1500 x 600","","37","Worktop (40mm) 3000 x 600","","38","Worktop (40mm) 3000 x 640","","39","Worktop (40mm) 3650 x 900","","3","Left/Right","40","L/H","","41","R/H","","4","Slide Type","42","Standard","","43","Blum Tandem ~ Soft Close","","Athens","CONTEMPORARY","ATHENS","BASE UNITS (18mm)","","Taxable Goods","Active",EOREOR

Link to comment
Share on other sites

Import EP file from Temp Dir - dropdown box MOD

 

I havn't even got it to work 100% yet and this was annoying me LOL... having to go and see what the filename was called each time and cut n paste the name in the box... so I knocked up the code to populate a drop down box of all the .txt files within the temp folder... if there are no files in there then it shows the original input field.

I hope you find it of some use

 

 

find:

<INPUT TYPE="text" name="localfile" size="50">

 

replace with:

<?PHP
//				  <INPUT TYPE="text" name="localfile" size="50">
$the_array = Array();
$handle = opendir($tempdir);
while (false!== ($file = readdir($handle))) { 
if ($file!= "." && $file!= ".." &&!is_dir($file)) { 
 $namearr = split('\.',$file); 
 if ($namearr[count($namearr)-1] == 'txt') $the_array[] = $file; 
}
}
closedir($handle);
$array_size = count($the_array);
if($array_size == 0){
echo ('			<INPUT TYPE="text" name="localfile" size="50">' . "\n");
} else {
echo ('			<select name="localfile" size="1">' . "\n");
foreach ($the_array as $list){
 echo ('				<option value="' . $list . '">' . $list . '</option>' . "\n");
}
echo ('			</select>' . "\n");
}
?>

Link to comment
Share on other sites

so sorry I forgot to post some example data... it's as given to me from the export:

 

"300","300 Base Unit.gif","300mm Base Unit","<p>300mm Base Unit</p>","","38.7","0.00","","2007-04-07 23:55:19","99","1","Color","2","Size","1","115 x 596","","2","175 x 596","","3","140 x 496","","4","140 x 596","","5","283 x 496","","6","283 x 596","","7","140 x 996","","8","283 x 996","","9","355 x 596","","10","335 x 496","","11","450 x 596","","12","495 x 596","","13","570 x 596","","14","895 x 596","","15","(2) 715 x 296 ICB Door Set","","16","715 x 296","","17","715 x 396","","18","715 x 446","","19","715 x 496","","20","715 x 596","","21","1245 x 296","","22","1245 x 496","","23","1245 x 596","","24","(3) 140 x 496 with (1) 283 x 496","","25","(1) 140 x 596 with (2) 283 x 596","","26","(1) 140 x 996 with (2) 283 x 996","","27","715 x 396 Glazed","","28","715 x 496 Glazed","","29","1200 x 496 Glazed Dresser Door","","30","(1) 715 x 296 with (1) 1245 x 296","","31","(1) 715 x 496 with (1) 1245 x 496","","32","(1) 715 x 596 with (1) 1245 x 596","","33","300 larder door - 715 x 296 & 1245 x 296","","34","500 larder door - 715 x 496 & 1245 x 496","","35","600 larder door - 715 x 596 & 1245 x 596","","36","Worktop (40mm) 1500 x 600","","37","Worktop (40mm) 3000 x 600","","38","Worktop (40mm) 3000 x 640","","39","Worktop (40mm) 3650 x 900","","3","Left/Right","40","L/H","","41","R/H","","4","Slide Type","42","Standard","","43","Blum Tandem ~ Soft Close","","Athens","CONTEMPORARY","ATHENS","BASE UNITS (18mm)","","Taxable Goods","Active",EOREOR

is that a CVS export? where is the header row?

Link to comment
Share on other sites

Import EP file from Temp Dir - dropdown box MOD

 

I havn't even got it to work 100% yet and this was annoying me LOL... having to go and see what the filename was called each time and cut n paste the name in the box... so I knocked up the code to populate a drop down box of all the .txt files within the temp folder... if there are no files in there then it shows the original input field.

I hope you find it of some use

 

 

find:

<INPUT TYPE="text" name="localfile" size="50">

 

replace with:

<?PHP
//				  <INPUT TYPE="text" name="localfile" size="50">
$the_array = Array();
$handle = opendir($tempdir);
while (false!== ($file = readdir($handle))) { 
 if ($file!= "." && $file!= ".." &&!is_dir($file)) { 
  $namearr = split('\.',$file); 
  if ($namearr[count($namearr)-1] == 'txt') $the_array[] = $file; 
 }
}
closedir($handle);
$array_size = count($the_array);
if($array_size == 0){
 echo ('			<INPUT TYPE="text" name="localfile" size="50">' . "\n");
} else {
 echo ('			<select name="localfile" size="1">' . "\n");
 foreach ($the_array as $list){
  echo ('				<option value="' . $list . '">' . $list . '</option>' . "\n");
 }
 echo ('			</select>' . "\n");
}
?>

was thinking about something like this. thanks for the effort.

Link to comment
Share on other sites

Hey everyone!

 

This is just the mod (i think) i need!!

 

Here's my problem. I have a fresh install of the latest MS. I now have a CSV from a client with the following columns:

 

SKU, name, price, image_path, category

 

Is there a way to take this simple excel file and get it to import all (2500+) products into a blank install of OSC, and create the categories and all?

 

Let me know if this makes sense or if you have any suggestions. I'm *this* close to getting the shop running!

 

Cheers!

Andrew

Link to comment
Share on other sites

is that a CVS export? where is the header row?

 

 

 

 

Sorry, didn't think you would need the header row...I have followed the code all the way through and found the problem to be with enctype="multipart/form-data"...

At first I thought it was all POST data is not working but it just seems to be this multipart/form-data!

 

there are many threads out ther on this subject but no cure found yet :( I have tried the latest PHP being 5.2.3, I have yet to try downgrading not that I want to but if that works!!! eitherway I will post my findings here for all.

 

 

I'll post the header line if I run into problems once I pass the enctype problem :)

 

thanks again for the replies.

Link to comment
Share on other sites

Sorry, didn't think you would need the header row...I have followed the code all the way through and found the problem to be with enctype="multipart/form-data"...

At first I thought it was all POST data is not working but it just seems to be this multipart/form-data!

 

there are many threads out ther on this subject but no cure found yet :( I have tried the latest PHP being 5.2.3, I have yet to try downgrading not that I want to but if that works!!! eitherway I will post my findings here for all.

 

 

I'll post the header line if I run into problems once I pass the enctype problem :)

 

thanks again for the replies.

so if that is the problem, you are able to import with a local file, instead of uploading the file?

Link to comment
Share on other sites

I have worked out the solution to my problem... (HURRAY!) ... Maximum Content-Length in the server's config.ini

 

Maximum Content-Length = 2-MB

Maximum User Content-Length = 10-MB

 

...and while i'm at it i'll fix that timing out issue you all talked about back about a billion pages ;)

 

php.ini:

max_execution_time = 120 ; Maximum execution time of each script, in seconds

max_input_time = 120 ; Maximum amount of time each script may spend parsing request data

 

Now I can import a file and all is very happy :) now I can go try it all out, oh and make that dropdown box i knocked up work! :blush: :-"

 

 

Just to collate some keywords in one post to (help) make this site's search function work

 

can't upload files php5 empty $_POST $_FILES POST problem sambar server config.ini

 

:thumbsup:

Link to comment
Share on other sites

Hey everyone!

 

This is just the mod (i think) i need!!

 

Here's my problem. I have a fresh install of the latest MS. I now have a CSV from a client with the following columns:

 

SKU, name, price, image_path, category

 

Is there a way to take this simple excel file and get it to import all (2500+) products into a blank install of OSC, and create the categories and all?

 

Let me know if this makes sense or if you have any suggestions. I'm *this* close to getting the shop running!

 

Cheers!

Andrew

 

 

Does anyone think they may be able to help me with this?

 

Cheers!

Link to comment
Share on other sites

Hey Guys, Im a newbie to OSCommerce and Easy Populate, but try and read everything at least three times and follow instructions to the dot.

 

I managed to install EasyPopulate 2.76d-MS2 okay with no problems - also made the required changes (temp directory, $ROOT_Directory, excel mod etc...

 

To start of gently I downloaded the complete.csv file to edit the existing 5 products without any column changes - all i did was delete the last row in the file. The major problems come when I attempt to upload the file back again.

 

When I select the 'Upload and import the EP file' option I get the following error:

 

406 Not Acceptable

An appropriate representation of the requested resource /osc/admin/easypopulate.php could not be found on this server.

I also tried the 'Upload and Split EP file' option (even though I only had 4 rows and get a whole load off errors as below:

 

Warning: move_uploaded_file(/home/mensgif/public_html/catalog/temp/EP2007Jul08-1402.csv) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/mensgif/public_html/osc/admin/easypopulate_functions.php on line 43

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpAxQwp9' to '/home/mensgif/public_html/catalog/temp/EP2007Jul08-1402.csv' in /home/mensgif/public_html/osc/admin/easypopulate_functions.php on line 43

 

Warning: fopen(/home/mensgif/public_html/catalog/temp/EP2007Jul08-1402.csv) [function.fopen]: failed to open stream: No such file or directory in /home/mensgif/public_html/osc/admin/easypopulate.php on line 884

 

Warning: fgets(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 887

Creating file EP_Split1.txt ...

Warning: fopen(/home/mensgif/public_html/catalog/temp/EP_Split1.txt) [function.fopen]: failed to open stream: No such file or directory in /home/mensgif/public_html/osc/admin/easypopulate.php on line 893

 

Warning: fgets(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 897

Added 0 records and closing file...

 

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 923

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 924

You can download your split files in the Tools/Files under /home/mensgif/public_html/catalog/temp/

 

I have double checked everything, but cant find out where I went wrong? If anybody can help it will be really approceiated...

 

TIA

Sig.

Link to comment
Share on other sites

Hey everyone!

 

This is just the mod (i think) i need!!

 

Here's my problem. I have a fresh install of the latest MS. I now have a CSV from a client with the following columns:

 

SKU, name, price, image_path, category

 

Is there a way to take this simple excel file and get it to import all (2500+) products into a blank install of OSC, and create the categories and all?

 

Let me know if this makes sense or if you have any suggestions. I'm *this* close to getting the shop running!

 

Cheers!

Andrew

that is one of the reasons to use EP. look through the docs, you find a section describing the column names.

Link to comment
Share on other sites

Hey Guys, Im a newbie to OSCommerce and Easy Populate, but try and read everything at least three times and follow instructions to the dot.

 

I managed to install EasyPopulate 2.76d-MS2 okay with no problems - also made the required changes (temp directory, $ROOT_Directory, excel mod etc...

 

To start of gently I downloaded the complete.csv file to edit the existing 5 products without any column changes - all i did was delete the last row in the file. The major problems come when I attempt to upload the file back again.

 

When I select the 'Upload and import the EP file' option I get the following error:

 

406 Not Acceptable

An appropriate representation of the requested resource /osc/admin/easypopulate.php could not be found on this server.

I also tried the 'Upload and Split EP file' option (even though I only had 4 rows and get a whole load off errors as below:

 

Warning: move_uploaded_file(/home/mensgif/public_html/catalog/temp/EP2007Jul08-1402.csv) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/mensgif/public_html/osc/admin/easypopulate_functions.php on line 43

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpAxQwp9' to '/home/mensgif/public_html/catalog/temp/EP2007Jul08-1402.csv' in /home/mensgif/public_html/osc/admin/easypopulate_functions.php on line 43

 

Warning: fopen(/home/mensgif/public_html/catalog/temp/EP2007Jul08-1402.csv) [function.fopen]: failed to open stream: No such file or directory in /home/mensgif/public_html/osc/admin/easypopulate.php on line 884

 

Warning: fgets(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 887

Creating file EP_Split1.txt ...

Warning: fopen(/home/mensgif/public_html/catalog/temp/EP_Split1.txt) [function.fopen]: failed to open stream: No such file or directory in /home/mensgif/public_html/osc/admin/easypopulate.php on line 893

 

Warning: fgets(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 897

Added 0 records and closing file...

 

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 923

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/mensgif/public_html/osc/admin/easypopulate.php on line 924

You can download your split files in the Tools/Files under /home/mensgif/public_html/catalog/temp/

 

I have double checked everything, but cant find out where I went wrong? If anybody can help it will be really approceiated...

 

TIA

Sig.

I thinking directory permissions or wrong path. Make sure "/home/mensgif/public_html/catalog/temp/" is valid and permissions are chmod 777 (look in your ftp proggie or as your host).

Link to comment
Share on other sites

I keep changing things as I read and read and read but I cant seem to beat this error. I am in trouble here ready to launch my new site but cant get the products to upload. I continue to get this error below. Can any one help?? PLEASE :( Please find my server info below the error.

This is a fresh install with no other CONTRIBs installed yet

 

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 't believe your car's new agressive sound fueled by the greater density of the ai' at line 11

INSERT INTO products_description (products_id, language_id, products_name, products_description, products_url) VALUES ( '124', 1, 'Chevrolet Cavalier | 2.2L | Chrome Cold Air Intake 98-00', 'Specific: 
General: Arctic Wind Cold Air Intake System - Colder Air Means Better Performance

 

Easy Populate 3.00-MS2 - Default Language : English(1)

 

Server Information

 

Server OS: Linux 2.4.21-27.ELsmp Database: MySQL 4.1.22-max-log

HTTP Server: Apache

PHP Version: 4.3.11 (Zend: 1.3.0)

Easy Populate 3.00-MS2 - Default Language : English(1)

osCommerce 2.2-MS2

 

Configure Command './configure' '--with-cgi' '--enable-fastcgi' '--with-config-file-path=/web/conf' '--with-gd' '--with-xml' '--with-gettext' '--with-zlib-dir=/usr/src/zlib' '--disable-posix' '--with-jpeg-dir=../jpeg-6b' '--enable-gd-native-ttf' '--enable-ftp' '--with-freetype-dir=/usr' '--with-freetype' '--with-sybase=/usr/src/freetds' '--with-curl=/usr/bin/curl' '--with-dom' '--enable-calendar' '--enable-soap' '--enable-bcmath' '--with-zip' '--with-openssl' '--with-mcrypt' '--with-mysql=/usr/local/mysql-5.0'

Server API CGI/FastCGI

Virtual Directory Support disabled

PHP API 20020918

PHP Extension 20020429

Zend Extension 20021010

Debug Build no

Thread Safety disabled

Registered PHP Streams php, http, ftp, https, ftps, compress.zlib

 

Thank you in advance, any ideas welcomed. I really need to get this going ASAP.

Link to comment
Share on other sites

I keep changing things as I read and read and read but I cant seem to beat this error. I am in trouble here ready to launch my new site but cant get the products to upload. I continue to get this error below. Can any one help?? PLEASE :( Please find my server info below the error.

This is a fresh install with no other CONTRIBs installed yet

 

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 't believe your car's new agressive sound fueled by the greater density of the ai' at line 11

INSERT INTO products_description (products_id, language_id, products_name, products_description, products_url) VALUES ( '124', 1, 'Chevrolet Cavalier | 2.2L | Chrome Cold Air Intake 98-00', 'Specific: 
General: Arctic Wind Cold Air Intake System - Colder Air Means Better Performance

 

Easy Populate 3.00-MS2 - Default Language : English(1)

 

 

 

Thank you in advance, any ideas welcomed. I really need to get this going ASAP.

 

you have a single quote in your data. options are:

1. remove all single quotes in your data.

2. escape all single quotes in your data by adding a backslash in front of each.

3. use EP v2.76d and enable the Excel Safe Output option which should handle all special chars (except a double quote in the beginning of a line on some versions of PHP (bug)).

Link to comment
Share on other sites

Hi surfalot, would you know how I can add 'categories_description' and 'categories_heading_title' to this amazing feature?

 

 

...when I say amazing I really do meen it, the amount of work this MOD has saved me is beyond words, Many thanks for your hard work, efforts and commitment. :thumbsup:

Link to comment
Share on other sites

you have a single quote in your data. options are:

1. remove all single quotes in your data.

2. escape all single quotes in your data by adding a backslash in front of each.

3. use EP v2.76d and enable the Excel Safe Output option which should handle all special chars (except a double quote in the beginning of a line on some versions of PHP (bug)).

 

Surfalot!!

 

YOUR GREAT! Thanks, my import went without error that was such an easy fix too lol. Thank You again :)

Link to comment
Share on other sites

Hi surfalot, would you know how I can add 'categories_description' and 'categories_heading_title' to this amazing feature?

 

 

...when I say amazing I really do meen it, the amount of work this MOD has saved me is beyond words, Many thanks for your hard work, efforts and commitment. :thumbsup:

its going to take a little php knowledge. for importing, find the function walk() in the code. if you are using a version of EP similar to v2.76d, you find a block of code starting with "// start with v_categories_id". I think all you need modify will be in the following block.

 

the categories_description would be similar to the categories_name since it is most likely going in the same table as categories_name. The best advice I can give you would be to duplicate lines where you find categories_name in the code.

Link to comment
Share on other sites

its going to take a little php knowledge. for importing, find the function walk() in the code. if you are using a version of EP similar to v2.76d, you find a block of code starting with "// start with v_categories_id". I think all you need modify will be in the following block.

 

the categories_description would be similar to the categories_name since it is most likely going in the same table as categories_name. The best advice I can give you would be to duplicate lines where you find categories_name in the code.

 

Thanks for getting back to me, I did look at the source to see how one would go about it, and ended up looking for another method, I am now updating these fields via openoffice - mySQL DB link that I just got working :-" ... which is no where near as good as this mod.

 

thanks again for this great contrib.

Link to comment
Share on other sites

that code would be a small part of what is necessary to complete the multi-language cats. If I'm remembering correctly, it would only setup the file layout for them. Additional code for the actual import/export would be necessary.

 

re: Easypopulate 2.76d Multilanguage categories_name

 

The multilanguage modifications are set to go. :rolleyes:

 

Downloads perfectly the existing db, 4 categories, 2 languages: categories_name_1_1

categories_name_x_y (where x = cat level, and y = language id)

 

| v_products_model | v_products_id | v_products_image | v_products_name_1 | v_products_description_1 | v_products_url_1 | v_products_name_3 | v_products_description_3 | v_products_url_3 | v_products_price | v_products_weight | v_date_avail | v_date_added | v_products_quantity | v_products_master | v_products_master_status | v_products_listing_status | v_manufacturers_name | v_categories_name_1_1 | v_categories_name_2_1 | v_categories_name_3_1 | v_categories_name_1_3 | v_categories_name_2_3 | v_categories_name_3_3 | v_tax_class_title | v_status | EOREOR

 

| E-3115-25- | 348 | Biochem/E-3115-25.jpeg | GenePure HiRes Agarose | GenePure HiRes Agarose is specifically | | GenePure HiRes - Agarosa de Alta Resolución | GenePure HiRes Agarose is specifically | | 0 | | | | 1 | 0 | 1 | 1 | GenePure | Laboratory | Electrophoresis & Blotting | Agarose | Laboratorio | Electrophoresis y Transferencia | Agarosa | --none-- | Active | EOREOR

 

Now, uploading is another saga………… :(

 

- Categories do not appear in Admin/Catalog

- Products appear in phpmysql

- Good - Products_info page displays the right product in 2 languages (Master Products not working though – maybe because of the product_to_category malfunctioning - I guess)

- Not getting errors while uploading:

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

Easy Populate 2.76d-MS2 - Default Language : English(1)

 

File uploaded.

Temporary filename: /tmp/phpgWaqDS

User filename: EP2007Jun15-short-4.txt

Size: 3267

| E-3115-25- | | Biochem/E- | GenePure H | GenePure H | | GenePure H | GenePure H | | 0 | | 6/8/2007 | 6/8/2007 | | 0 | 1 | 1 | GenePure | Laboratory | Electropho | Agarose | Laboratori | Electropho | Agarosa | --none-- | Active Updated

| E-3115-25 | | Biochem/pi | GenePure H | 25g | | GenePure A | 25g | | 125 | | 6/8/2007 | 6/8/2007 | | 314 | 0 | 0 | GenePure | Laboratory | Electropho | Agarose | Laboratori | Electropho | Agarosa | --none-- | Active Updated

| E-3115-125 | | Biochem/pi | GenePure H | 125g | | GenePure A | 125g | | 350 | | 6/8/2007 | 6/8/2007 | | 314 | 0 | 0 | GenePure | Laboratory | Electropho | Agarose | Laboratori | Electropho | Agarosa | --none-- | Active Updated

| E-3115-500 | | Biochem/pi | GenePure H | 500g | | GenePure A | 500g | | 1105 | | 6/8/2007 | 6/8/2007 | | 314 | 0 | 0 | GenePure | Laboratory | Electropho | Agarose | Laboratori | Electropho | Agarosa | --none-- | Active Updated

| | | | | | | | | | | | | | | | | | | | | | | | | |

 

No products_model field in record. This line was not imported

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

 

What is the $sql_filter; at the end of this code: ".TABLE_PRODUCTS_TO_CATEGORIES." as ptoc

WHERE p.products_id = ptoc.products_id AND ptoc.categories_id = subc.categories_id " . $sql_filter;

 

Your comments would be greatly appreciated.

Link to comment
Share on other sites

Can someone help me figure out why when I click on a txt file template to download, nothing happens. The screen just refreshes. I checked the "/catalog/temp/" Directory and it's empty. I've checked just about every temp directory on my HDD with no luck.

 

I've also checked the apache Log file for errors and come up with nothing.

 

I'm running windows XP with Apache web server. All "temp" folders have full write privleges but absolutly no luck. I feel like I've tried everything.

 

This post here :http://www.oscommerce.com/forums/index.php?showtopic=108825&hl=Easy+Populate

Mentions to try placing $_SERVER["DOCUMENT_ROOT"] before each $tempdir.

 

Where before each $tempdir??? Can anyone show me an example? I've tried just about every possible combination with little luck.

 

I dont mean to beg, but PLEEAAAASSSEE can someone help me with this issue. Surely I cant be the only person stupid enough to attempt this on Windows XP running Apache?

 

Thanks in advance

Dan

Link to comment
Share on other sites

I've read I believe all the posts regarding 1064 errors. Typically it seems to be a single quote error. I have replaced all my single quotes with \' but I am still getting a 1064 error. Installed along with easy populate are the multi images contribution. The weird thing is that when I exported the current database and re-imported it everything went smoothly. Now I am importing more products I get this 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 '", "largeimage.jpg", "", "", "", "", "", "", "", "", "", "", "", "", " 'AlaS' at line 28

 

INSERT INTO products ( products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( 'thumbimage.jpg',medimage.jpg", "largeimage.jpg", "", "", "", "", "", "", "", "", "", "", "", "", " 'modelid', 'price', '1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, '', '', '1000', '10')

 

[TEP STOP]

 

Please help I've done this about a hundred times and it always reverts back to the same error. Thanks :)

Link to comment
Share on other sites

An update to the above issue with Easy Populate 2.76-MS2 and UltraPics

I kept all the headers in the file I need to import and cleared the data in most of the columns. The Error message I now get is:

 

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

 

INSERT INTO products ( products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( 'Alabama.jpg',", "", "", "", "", "", "", "", "", "", "", "", "", "", " 'AlaSport', '0', '1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, '', '', '1', '10')

 

I'm thinking the 1064 error is simply due to another single comma -- or other symbol? I have updated my product_attributes.php and it has not done the trick (at line 61 I replaced the area with: tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . (int)$attributes_sort . "')");

 

Please any help? :(

Link to comment
Share on other sites

An update to the above issue with Easy Populate 2.76-MS2 and UltraPics

I kept all the headers in the file I need to import and cleared the data in most of the columns. The Error message I now get is:

 

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

 

INSERT INTO products ( products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( 'Alabama.jpg',", "", "", "", "", "", "", "", "", "", "", "", "", "", " 'AlaSport', '0', '1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, '', '', '1', '10')

 

I'm thinking the 1064 error is simply due to another single comma -- or other symbol? I have updated my product_attributes.php and it has not done the trick (at line 61 I replaced the area with: tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . (int)$attributes_sort . "')");

 

Please any help? :(

your ultrapics addon is in the wrong place.

INSERT INTO products ( products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( 'Alabama.jpg',", "", "", "", "", "", "", "", "", "", "", "", "", "", " 'AlaSport', '0', '1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, '', '', '1', '10')

 

in the section I highlighted, you have a beginning double quote in the value just after the 'Alabama.jpg' value. that doesn't get closed until the value that should be your model number 'AlaSport'. So both of those values are causing the error. quotes and double quotes should be balanced to two per value location.

 

so recheck you code and make the mods that will balance that out.

Link to comment
Share on other sites

your ultrapics addon is in the wrong place.

INSERT INTO products ( products_image, products_image_med, products_image_lrg, products_image_sm_1, products_image_xl_1, products_image_sm_2, products_image_xl_2, products_image_sm_3, products_image_xl_3, products_image_sm_4, products_image_xl_4, products_image_sm_5, products_image_xl_5, products_image_sm_6, products_image_xl_6, products_model, products_price, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( 'Alabama.jpg',", "", "", "", "", "", "", "", "", "", "", "", "", "", " 'AlaSport', '0', '1', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, '', '', '1', '10')

 

in the section I highlighted, you have a beginning double quote in the value just after the 'Alabama.jpg' value. that doesn't get closed until the value that should be your model number 'AlaSport'. So both of those values are causing the error. quotes and double quotes should be balanced to two per value location.

 

so recheck you code and make the mods that will balance that out.

 

I'm very much a beginner to php and OSC. No ' or '' are present in my tab deliminated text file at this point. How would I go about balancing the quotes and double quotes?

Edited by dayreach
Link to comment
Share on other sites

Just an update on what I've done (although it has not helped and I'm very much a beginner):

I installed contribution: Easy Populate 2.76d and also ultra pics along with ultra pics for ep. Right now the ultri pics ep files are being used. I have udated my database with the sql that added the extra columns for the database. I have also used an attributes_optimize txt file to update the ultra pics ep (see at the very end of this post)::

 

Doing this reverted to: 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 '", "raw_Alabama.jpg", "", "", "", "", "", "", "", "", "", "", "", "", " 'AlaS' at line 28

 

If I remove all the extra images and attributtes I get a 1136 error

 

 

"Attributes_optimized"

All this optimization does is first load the entire attributes and options tables

into an arrays. Then while its going product by product, it no longer makes

a seperate mysql query calls, it just grabs the data from the existing array.

 

 

//---------------------------------------------------------------

// The only file to edit is cataolg/admin/easypopulate.php

//---------------------------------------------------------------

 

 

 

//--------------------------------------------------

//FIND (around line 135)

//--------------------------------------------------

 

$result = tep_db_query($filelayout_sql);

$row = tep_db_fetch_array($result);

 

 

//--------------------------------------------------

//PUT BELOW

//--------------------------------------------------

 

 

//SETUP ATTRIBUTES ARRAY

 

$attribute_values_sql = "select products_id, options_id, options_values_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " ORDER BY products_attributes_id";

$attributes_query= tep_db_query($attribute_values_sql);

 

$attributes_array=array();

while($row_attributes= tep_db_fetch_array($attributes_query)){

$attributes_array[$row_attributes["products_id"]."_".$row_attributes["options_id"]."_".$row_attributes["options_values_id"]]=array("products_id"=>$row_attributes["products_id"],

"options_id"=>$row_attributes["options_id"],

"options_values_id"=>$row_attributes["options_values_id"],

"options_values_price"=>$row_attributes["options_values_price"],

"price_prefix"=>$row_attributes["price_prefix"]

);

}

 

$attributes_values_sql= "select products_options_values_id, products_options_values_name, language_id from " . TABLE_PRODUCTS_OPTIONS_VALUES;

$attributes_values_query = tep_db_query($attributes_values_sql);

$attributes_values_array=array();

while($row_attributes_values= tep_db_fetch_array($attributes_values_query)){

$attributes_values_array[$row_attributes_values["products_options_values_id"]."_".$row_attributes_values["language_id"]]=array("products_options_values_id"=>$row_attributes_values["products_options_values_id"],

"products_options_values_name"=>$row_attributes_values["products_options_values_name"]

);

}

 

$attribute_options_lang_sql= "select products_options_id, products_options_name, language_id from " . TABLE_PRODUCTS_OPTIONS;

$attribute_options_lang_query = tep_db_query($attribute_options_lang_sql);

$attribute_options_lang_array=array();

while($row_attributes_lang= tep_db_fetch_array($attribute_options_lang_query)){

$attribute_options_lang_array[$row_attributes_lang["products_options_id"]."_".$row_attributes_lang["language_id"]]=array("products_options_id"=>$row_attributes_lang["products_options_id"],

"products_options_name"=>$row_attributes_lang["products_options_name"]

);

}

 

 

// END SETUP ATTRIBUTES ARRAY

 

 

//--------------------------------------------------

//FIND (around line 380)

//--------------------------------------------------

 

$attribute_values_price_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$row['v_products_id'] . "' and options_id = '" . (int)$attribute_options['products_options_id'] . "' and options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "'";

 

$attribute_values_price_values = tep_db_query($attribute_values_price_query);

 

$attribute_values_price = tep_db_fetch_array($attribute_values_price_values);

 

 

//--------------------------------------------------

//REPLACE WITH

//--------------------------------------------------

 

//$attribute_values_price_query = "select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$row['v_products_id'] . "' and options_id = '" . (int)$attribute_options['products_options_id'] . "' and options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "'";

//$attribute_values_price_values = tep_db_query($attribute_values_price_query);

//$attribute_values_price = tep_db_fetch_array($attribute_values_price_values);

 

$attribute_values_price=$attributes_array[(int)$row['v_products_id']."_".(int)$attribute_options['products_options_id']."_".(int)$attribute_values['products_options_values_id']];

 

 

 

 

 

 

 

//--------------------------------------------------

//FIND (around Line 380)

//--------------------------------------------------

 

$attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'";

 

$attribute_options_languages_values = tep_db_query($attribute_options_languages_query);

 

$attribute_options_languages = tep_db_fetch_array($attribute_options_languages_values);

 

 

//--------------------------------------------------

//Replace With

//--------------------------------------------------

 

//$attribute_options_languages_query = "select products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$attribute_options['products_options_id'] . "' and language_id = '" . (int)$lid . "'";

//$attribute_options_languages_values = tep_db_query($attribute_options_languages_query);

//$attribute_options_languages = tep_db_fetch_array($attribute_options_languages_values);

$attribute_options_languages=$attribute_options_lang_array[(int)$attribute_options['products_options_id']."_".(int)$lid];

 

 

 

 

//--------------------------------------------------

//FIND (around line 408)

//--------------------------------------------------

$attribute_values_languages_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "' and language_id = '" . (int)$lid . "'";

 

$attribute_values_languages_values = tep_db_query($attribute_values_languages_query);

 

$attribute_values_languages = tep_db_fetch_array($attribute_values_languages_values);

 

//--------------------------------------------------

//REPLACE WITH

//--------------------------------------------------

 

 

//$attribute_values_languages_query = "select products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$attribute_values['products_options_values_id'] . "' and language_id = '" . (int)$lid . "'";

//$attribute_values_languages_values = tep_db_query($attribute_values_languages_query);

//$attribute_values_languages = tep_db_fetch_array($attribute_values_languages_values);

 

$attribute_values_languages=$attributes_values_array[(int)$attribute_values['products_options_values_id']."_".(int)$lid];

Edited by dayreach
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...