Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy Populate & Products Attributes


VJ

Recommended Posts

The only way my site will properly output a froogle feed, due to a large inventory, is with easy populate.

 

1. How can easy populate be adjusted so that it can produce the google base feed according to new requirements?

 

2. What needs to be done to easy populate so that it can produce a yahoo feed and a shopzilla feed?

 

Thanks.

http://www.oscommerce.com/forums/index.php?s=&...st&p=984338

good luck with that. Please share any advances you've made.

Link to comment
Share on other sites

I'm having a good success with my EP. I've now got it to export all my fields (I've added two extra fields 'v_vendors_id' and 'v_vendors_prod_id') :) I've also got it to import without comming up with errors :) However......

 

Although the report at the top of the EP page shows its importing all the fields, when a product is checked, its not updating my two extra fields :(

 

I felt its not a good idea to post thousands of lines of code, so I've uploaded it to this location, I've coloured my extra fields in red, so hopefully you can find my changes reasonably easily.

 

Can anyone give me any clues where to start looking to make good my lack of updating fields please?

 

Thanks in advance for any help and guidence :D

someone posted a nice little how-to for adding fields a while back (5-10 pages back). Essencially find a field that is similar and search the file for the places it turns up. Then add your code.

Link to comment
Share on other sites

How would I include the manufacturer automatically in the following fix/update?

 

Before editing with these changes always BACKUP! BACKUP! BACKUP!

Now, with that out of the way I have worked on some of the issues I have seen posted here recently. So here we go:

Here are some changes I have made on catalog/admin/easypopulate.php from EP 2.74d

 

in catalog/admin/easypopulate.php

 

line 31

find:

$tempdir = DIR_FS_DOCUMENT_ROOT . "/catalog/temp/";

 

replace with:

$tempdir = DIR_FS_DOCUMENT_ROOT . "temp/";

 

line 72

find:

$modelsize = 25;

 

replace with:

$modelsize = 12;

 

Regarding this change, as it states in the comments, this number MUST match the size set in your database for the product_model field. I have mine set to 64 because some model numbers can be lengthy. I changed it back to '12' here because that is what that is set to in the db in the standard osC install.

 

line 151

 

find:

global $froogle_product_info_path;
$froogle_product_info_path = "http://www.yourdomain.com/catalog/product_info.php";

// **** Froogle product image path ****
// Set this to the path to your images directory
global $froogle_image_path;
$froogle_image_path = "http://www.yourdomain.com/catalog/images/";

 

replace with:

global $froogle_product_info_path;
$froogle_product_info_path = HTTP_CATALOG_SERVER . DIR_WS_CATALOG . "product_info.php";

// **** Froogle product image path ****
// Set this to the path to your images directory
global $froogle_image_path;
$froogle_image_path = HTTP_CATALOG_SERVER . DIR_WS_CATALOG . "images/";

 

This section now conforms with osC development standards and no longer requires editing from a store owner. It never should have been written any other way.

 

Now for Froogle

 

I have not tested this yet and I know there are some rules that need to be followed (sometimes) i.e. Product descriptions have a length limit of 100 charcters(something like that) however when the file is uploaded this limit gets ignored. I'm sure this won't last long so we will need to add in a couple of lines to cut the descriptions down to size in thev Froogle export file. The same holds true for meta-tags, except here the Froogle/GoogleBase parser will catch data that exceeds the limit and this product will be skipped!

 

Here are some links regarding Bulk uploads

http://www.google.com/base/attributes.html

and

http://www.google.com/base/help/custom-attributes.html

 

Down near line 358

find:

$row['v_froogle_instock'] 		= 'Y';
	$row['v_froogle_shipping'] 		= '';
	$row['v_froogle_upc'] 			= '';
	$row['v_froogle_color']			= '';
	$row['v_froogle_size']			= '';
	$row['v_froogle_quantitylevel']		= '';
	$row['v_froogle_manufacturer_id']	= '';
	$row['v_froogle_exp_date']		= '';
	$row['v_froogle_product_type']		= 'OTHER';
	$row['v_froogle_delete']		= '';
	$row['v_froogle_currency']		= 'USD';
	$row['v_froogle_offer_id']		= $row['v_products_model'];
	$row['v_froogle_product_id']		= $row['v_products_model'];

 

replace with:

$row['v_froogle_quantitylevel']		= $row['v_products_quantity'];
	$row['v_froogle_manufacturer_id']	= '';
	$row['v_froogle_exp_date']		= date('Y-m-d', strtotime('+30 days'));
	$row['v_froogle_product_type']		= $row['v_categories_id'];
	$row['v_froogle_product_id']		= $row['v_products_model'];
	$row['v_froogle_currency']		= 'USD';

Down near line 1499 (about 1490 after above changes)

find:

$filelayout  = array_merge($filelayout , array(
		'v_products_price'		=> $iii++,
		'v_products_fullpath_image'	=> $iii++,
		'v_category_fullpath'		=> $iii++,
		'v_froogle_offer_id'		=> $iii++,
		'v_froogle_instock'		=> $iii++,
		'v_froogle_ shipping'		=> $iii++,
		'v_manufacturers_name'		=> $iii++,
		'v_froogle_ upc'		=> $iii++,
		'v_froogle_color'		=> $iii++,
		'v_froogle_size'		=> $iii++,
		'v_froogle_quantitylevel'	=> $iii++,
		'v_froogle_product_id'		=> $iii++,
		'v_froogle_manufacturer_id'	=> $iii++,
		'v_froogle_exp_date'		=> $iii++,
		'v_froogle_product_type'	=> $iii++,
		'v_froogle_delete'		=> $iii++,
		'v_froogle_currency'		=> $iii++,
			));
	$iii=0;
	$fileheaders = array(
		'product_url'		=> $iii++,
		'name'			=> $iii++,
		'description'		=> $iii++,
		'price'			=> $iii++,
		'image_url'		=> $iii++,
		'category'		=> $iii++,
		'offer_id'		=> $iii++,
		'instock'		=> $iii++,
		'shipping'		=> $iii++,
		'brand'			=> $iii++,
		'upc'			=> $iii++,
		'color'			=> $iii++,
		'size'			=> $iii++,
		'quantity'		=> $iii++,
		'product_id'		=> $iii++,
		'manufacturer_id'	=> $iii++,
		'exp_date'		=> $iii++,
		'product_type'		=> $iii++,
		'delete'		=> $iii++,
		'currency'		=> $iii++,
		);

 

and replace with:

$filelayout  = array_merge($filelayout , array(
		'v_products_price'		=> $iii++,
		'v_products_fullpath_image'	=> $iii++,
		'v_froogle_product_id'		=> $iii++,
		'v_froogle_quantitylevel'	=> $iii++,
		'v_category_fullpath'		=> $iii++,
		'v_froogle_exp_date'		=> $iii++,
		'v_froogle_currency'		=> $iii++,
			));
	$iii=0;
	$fileheaders = array(
		'link'		=> $iii++,
		'title'			=> $iii++,
		'description'		=> $iii++,
		'price'			=> $iii++,
		'image_link'		=> $iii++,
		'id'		=> $iii++,
		'quantity'		=> $iii++,
		'product_type'		=> $iii++,
		'expiration_date'	 => $iii++,
		'currency'		=> $iii++,
		);

And that will (should) clear up some of the issues posted here. When it comes to Froogle/GoogleBase I have learned to keep as simple as possible.

Link to comment
Share on other sites

How would I include the manufacturer automatically in the following fix/update?

need to try some things and compare your output to the required format that Google posts. HallMark did a nice job pointing out the changes.

Link to comment
Share on other sites

Hi surfalot,

 

Thanks for your reply.

 

What you have said, is basically what I had done (about 6 months ago). I've decided to update to a newer version as I could never upload new products. With the updates I have done so far now allows the uploading of new products, but... without the two extra fields :(

 

Looking at the following bit of code, I think my lack of updating the two new fields may be due to the way I've edited lines 2168 and 2170, which I think I picked up from some code a long time back and now trying to use a compare programme to update my new file from the original easypopulate.php file. Anyway my code below certainly dosn't look right :(

 

Any coments please? :)

2162 	echo "<font color='black'> Updated</font><br>";
2163 	$row = tep_db_fetch_array($result);
2164 	$query = 'UPDATE '.TABLE_PRODUCTS.'
2165 	SET
2166 	products_price="'.$v_products_price. '" ,products_image="'.$v_products_image; 
2167 	 
2168 	'" ,vendors_prod_id="'.$v_vendors_prod_id;
2169 	 
2170 	 '" ,vendors_id="'.$v_vendors_id;
2171 	 
2172 	 
2173 	// uncomment these lines if you are running the image mods
2174 	/*
2175 	$query .=
2176 	'" ,products_mimage="'.$v_products_mimage.
2177 	'" ,products_bimage="'.$v_products_bimage.

Thanks

 

Steve

____________________________________________________________________

____________________________________________________________________

Link to comment
Share on other sites

Using Windows XP SP2, OSC MS2 update 2 package and EP 2_76c (couldn't get 2_76d to upload)

 

So I have finally gotten EP to upload, in so much as it says it has uploaded the file. However, the changes I make are not showing up in the admin section. I have tried just changing a price or a name and uploading, but it stays the same as it was before I uploaded.

 

Can anyone point me in the direction of a forum, or tell me of a remedy?

Thanks.

Link to comment
Share on other sites

Using Windows XP SP2, OSC MS2 update 2 package and EP 2_76c (couldn't get 2_76d to upload)

 

So I have finally gotten EP to upload, in so much as it says it has uploaded the file. However, the changes I make are not showing up in the admin section. I have tried just changing a price or a name and uploading, but it stays the same as it was before I uploaded.

 

Can anyone point me in the direction of a forum, or tell me of a remedy?

Thanks.

 

I just managed to get 2_76d to upload - well it says it has anyway - no error message or anything, but still not displaying the changes I make. The txt file has the changes, but my store doesn't.

 

Hope that helps someone guide me in the right direction!

Link to comment
Share on other sites

I just managed to get 2_76d to upload - well it says it has anyway - no error message or anything, but still not displaying the changes I make. The txt file has the changes, but my store doesn't.

 

Hope that helps someone guide me in the right direction!

can you post what is displayed after you upload?

Link to comment
Share on other sites

.... have you read the docs? must have an unique product model number for every product in the first column of the import file. both for the new products and the ones in your database.

Surfalot,

My issue here is that my product model can be the same across multiple products. I cannot use this field as a unique identifier. What do you advise?

Thanks

Brendon

Link to comment
Share on other sites

My issue here is that my product model can be the same across multiple products. I cannot use this field as a unique identifier. What do you advise?

that is what this project uses. don't have any advice for you, sorry. Maybe a future version.

Link to comment
Share on other sites

can you post what is displayed after you upload?

 

 

this is what is displayed

 

File uploaded.

Temporary filename: C:\WINDOWS\TEMP\php76.tmp

User filename: test2.txt

Size: 79469

 

no error or anything?

 

Thanks for your help!

Link to comment
Share on other sites

this is what is displayed

 

File uploaded.

Temporary filename: C:\WINDOWS\TEMP\php76.tmp

User filename: test2.txt

Size: 79469

 

no error or anything?

 

Thanks for your help!

PHP ver? (Register Globals on/off?)

MySQL ver?

 

see post #5307

Link to comment
Share on other sites

try this there

 

$query .= '" ,vendors_prod_id="'.$v_vendors_prod_id;

$query .= '" ,vendors_id="'.$v_vendors_id;

:D Thanks for that.

 

It gives me a two part solution, in that the first import adds the new products without the two extra fields, then when I do a second import of the same file, all the fields are updated, including the two missed fields from the previous run. Strange, but true! but we do have progress in the right direction :D

 

I expect I've missed to enter the new fields somewhere :'(

____________________________________________________________________

____________________________________________________________________

Link to comment
Share on other sites

questions still stand...

do you have attributes defined AND assigned to a product in the shop now? Do you have unique model numbers assigned to each product?

and don't forget the system details. PHP ver? register globals setting? MySQL ver? server?

can't help much if I don't know what you are working with.

 

Hi

 

Yes I have attributes defined AND assigned to all the products in the shop.

Yes I have unique model numbers on all the products.

 

Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_perl/1.999.21 Perl/v5.8.4

 

PHP Version: 4.3.10-16 (Zend: 1.3.0)

Register Globals: Off

MySQL 4.0.24

 

Thanks

Graeme

Link to comment
Share on other sites

Hi

 

Yes I have attributes defined AND assigned to all the products in the shop.

Yes I have unique model numbers on all the products.

 

Apache/2.0.54 (Debian GNU/Linux) PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_perl/1.999.21 Perl/v5.8.4

 

PHP Version: 4.3.10-16 (Zend: 1.3.0)

Register Globals: Off

MySQL 4.0.24

 

Thanks

Graeme

your problem is most likely the Register Globals: Off.

This contribution is not register globals off compatible. See if your host allows you to override it with a local php.ini

Link to comment
Share on other sites

I have a weird problem when trying to export the tab-delimited file, there is no delimination, just one big solid lump of text. What could cause this?

any of the following

php ver? globals (on/off) ?

My SQL ver?

EP ver?

Link to comment
Share on other sites

Register Globals is on

using PHP 5.2

Mysql 5.0.72

 

THanks again

try this fix and search your easypopulate.php file for any other array_walk() function uses and apply the same logic (each case may not use the exact same code). I think there are a total of 3 uses in that file.

Edited by surfalot
Link to comment
Share on other sites

any of the following

php ver? globals (on/off) ?

My SQL ver?

EP ver?

 

PHP version 4.4.4 (globals is on)

MySQL 4.0.72

EP I downloaded was "ep_2.76d_with_admin.zip"

 

Also the installation file was confusing, when it said set document root to $DOCUMENT_ROOT what? huh? Does it mean to change the only instance of DOCUMENT_ROOT which is:

define('DIR_FS_DOCUMENT_ROOT', '/home/xxx/public_html/shop/catalog/'); to:

define('DIR_FS_$DOCUMENT_ROOT', '/home/xxx/public_html/shop/catalog/'); ?

Link to comment
Share on other sites

Hello all, I hope someone here can help with an images problem after uploading via EP.

 

I have been playing with EP for awhile now with my test store. I have an "almost live" store that had several hundred products with images, but after finding out about EP I discovered that none of the products contained model numbers. We have created a tab delimited file for EP with all the correct fields and info inclucing the image paths. I have this store set up in the root of my server and all the images all reside in the root/images folder.

 

I had deleted the previous categories and products through the store Admin (because with they didn't contain model numbers) and uploaded the new EP tab delimited text file. It added the correct categories and all the products as expected. However, only some of the images are showing. I have checked the path on the images that are not showing and they are pointed to http://mystore.com/images/imagename.jpg. In my mind this is correct, but they do not show.

 

I then went to Admin and checked one of the products that the images are not showing and went to edit where you can browse for an image. The correct image name is already in there. I am stumped. Can anyone offer any assistance or advice on what may be causing this?

 

I do not have any image contribs installed except for lightbox which I believe should not be an issue.

 

Any help with this is greatly appreciated:)

Edited by awarner20

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

Link to comment
Share on other sites

PHP version 4.4.4 (globals is on)

MySQL 4.0.72

EP I downloaded was "ep_2.76d_with_admin.zip"

 

Also the installation file was confusing, when it said set document root to $DOCUMENT_ROOT what? huh? Does it mean to change the only instance of DOCUMENT_ROOT which is:

define('DIR_FS_DOCUMENT_ROOT', '/home/xxx/public_html/shop/catalog/'); to:

define('DIR_FS_$DOCUMENT_ROOT', '/home/xxx/public_html/shop/catalog/'); ?

leave that alone in your configure.php. Most already have that set correctly. What i means is this:

define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT);

the main concern is the temp path setting in your easypopulate.php file. Please download and try the version I uploaded v2.76d. Go through the settings in the easypopulage.php file since this version has all the settings in the file itself. You shouldn't have any trouble using the default settings with $excel_safe_output set to true (and the temp path mensioned earlier of course)

Link to comment
Share on other sites

Hello all, I hope someone here can help with an images problem after uploading via EP.

 

I have been playing with EP for awhile now with my test store. I have an "almost live" store that had several hundred products with images, but after finding out about EP I discovered that none of the products contained model numbers. We have created a tab delimited file for EP with all the correct fields and info inclucing the image paths. I have this store set up in the root of my server and all the images all reside in the root/images folder.

 

I had deleted the previous categories and products through the store Admin (because with they didn't contain model numbers) and uploaded the new EP tab delimited text file. It added the correct categories and all the products as expected. However, only some of the images are showing. I have checked the path on the images that are not showing and they are pointed to http://mystore.com/images/imagename.jpg. In my mind this is correct, but they do not show.

 

I then went to Admin and checked one of the products that the images are not showing and went to edit where you can browse for an image. The correct image name is already in there. I am stumped. Can anyone offer any assistance or advice on what may be causing this?

 

I do not have any image contribs installed except for lightbox which I believe should not be an issue.

 

Any help with this is greatly appreciated:)

I have not heard of this before. try using FireFox bowser to browse the site with missing images. one nice feature is you can right-click any image (or place an image should show) and select copy image location. The open notepad and paste the location there. Does the location make sence? Does the image actually exist? the paste that image path into the address bar of your browser and hitthe enter key. does your image show up in the browser? If not what is wrong with the path? hope that helps.

Edited by surfalot
Link to comment
Share on other sites

I have not heard of this before. try using FireFox bowser to browse the site with missing images. one nice feature is you can right-click any image (or place an image should show) and select copy image location. The open notepad and paste the location there. Does the location make sence? Does the image actually exist? the paste that image path into the address bar of your browser and hitthe enter key. does your image show up in the browser? If not what is wrong with the path? hope that helps.

 

Thanks surfalot,

 

I solved the problem, and it appears it was my own ignorance;) I was seeing the images on the server through my FTP however, I did not refresh the list after I deleted all the categories and products! The images were deleted...duh!

 

So, I just uploaded the images folder (that I had backed up, whew!), and all the images are now showing! Sorry for the confusion, and thanks again for providing this GREAT contrib and the support!

We see our customers as invited guests to a party, and we are the hosts. It's our job every day to make every important aspect of the customer experience a little bit better. - Jeff Bezos

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.
Note: Your post will require moderator approval before it will be visible.

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