Page 1 of 2

Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Wed Jan 25, 2012 3:09 am
by warpconduit
For those of you that are looking for this extension for OC 1.5 or upgrading from OC 1.4 to 1.5 and are having issues with moving the Google Base Improved extension over, here is an updated package for OpenCart 1.5.x.

Note: I've only tested this on 1.5.1, so please test on your version and post your errors/issues, along with your OC version.

Credit goes to the creator JAY6390 for the original code. I'm assigning a starting version number of 1.5a to this package.

Hope it works for the rest of you OC 1.5ers!

Change Log
1.5b (1/30/2012) - Updated weight attribute code to include measurement unit. Thanks go to monkeyhouse.
1.5a (1/24/2012) - Updated existing code to work on OC 1.5

Google Base Improved v1.5b for OpenCart 1.5.x


Re: Google Base Improved v1.5a for OpenCart 1.5.x

Posted: Fri Jan 27, 2012 6:13 am
by monkeyhouse
Installed on 1.5.1...

It generated a bunch of notice errors which were fixed by changing this (weight_class)

Code: Select all

$item->appendChild($this->_c('g:weight', $this->weight->format($p['weight'], $p['weight_class'])));
to this (weight_class_id):

Code: Select all

$item->appendChild($this->_c('g:weight', $this->weight->format($p['weight'], $p['weight_class_id'])));

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Tue Jan 31, 2012 1:43 am
by warpconduit
Nice, that adds the measurement unit to the shipping weight. Updated post and zip to 1.5b. Thanks monkeyhouse.

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Mon Feb 06, 2012 5:17 am
by eventpromotions
Hi there,

I have added this to my OpenCart Version 1.5.1.3 all works. Apart from I am getting this error:

Missing recommended attribute: google product category

Can anyone help?

Kind Regards,
Doug

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Thu Feb 16, 2012 4:19 am
by afonte
Its only uploading 7 out of 275 products. I also have the following errors:
Feed details

Uploaded on Feb 15, 2012 3:04 pm EST
7 of 8 items inserted - Processed on Feb 15, 2012 3:10 pm EST
Destinations: Product Ads, Product Search, Search API for Shopping

Input Method: Fetch
Detected file format: XML
Default timezone for dates: GMT-07:00
Download feed
Recent uploads

Feb 15, 2012 3:04 pm EST - 7 of 8 items inserted
Feed Level Messages

XML formatting error - Error
Our system encountered an error when processing your data feed. Learn more.
Examples:
Line Nr. Column Nr.
199 34
Item Warnings 23 items affected

Missing 'shipping' attribute. (7 warnings)
Shipping method must be specified either in 'shipping' attribute or in Google Merchant Center. Requirement will be enforced starting September 2011.
Examples:
Item ID Line Nr.
76 7 Show Item
144 45 Show Item
177 67 Show Item
241 142 Show Item
273 161 Show Item
Missing 'tax' attribute. (7 warnings)
Tax settings must be specified either in 'tax' attribute or in Google Merchant Center. Requirement will be enforced starting September 2011.
Examples:
Item ID Line Nr.
76 7 Show Item
112 26 Show Item
144 45 Show Item
209 90 Show Item
241 142 Show Item
Missing recommended attribute: google product category (7 warnings)
While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available.
Examples:
Item ID Line Nr.
76 7 Show Item
112 26 Show Item
144 45 Show Item
241 142 Show Item
273 161 Show Item
Missing recommended attribute: brand (2 warnings)
While items missing recommended attributes will process successfully, we recommend including relevant attributes if they are available.
Examples:
Item ID Line Nr.
112 26 Show Item
209 90 Show Item
Any help?

EDIT: This was answered for me here, http://forum.opencart.com/viewtopic.php?f=116&t=25662

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Fri May 04, 2012 8:13 pm
by geidorei
Hi re brand (as it doesnt work as standard) and google product category (as its not included and google flags it): mooded google_base_improved.php as follows and all is well:

// Add brand, condition, id, mpn, quantity and weight
$item->appendChild($this->_c('g:brand', 'just put your brand name here'));
$item->appendChild($this->_c('g:google_product_category', 'Apparel & Accessories > Clothing > Shirts & Tops > T-Shirts'));
$item->appendChild($this->_c('g:condition', 'new'));
$item->appendChild($this->_c('g:id', $p['product_id']));
$item->appendChild($this->_c('g:mpn', $p['model']));
$item->appendChild($this->_c('g:quantity', $p['quantity']));
$item->appendChild($this->_c('g:weight', $this->weight->format($p['weight'], $p['weight_class_id'])));
$item->appendChild($this->_c('g:availability', ($p['quantity'] ? 'in stock' : 'out of stock')));

Hope this helps folks.

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Fri May 11, 2012 1:44 am
by takahashi1973
Hi!

Maybe stupid Q but why does it not use the seo url in the url of a product? Or is this due to some SEO module in my shop?

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Thu May 17, 2012 1:04 am
by JAY6390
Not seen this before, looks like you have been doing some great work warpconduit

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Mon May 21, 2012 9:57 pm
by cmhalon
Absolutely excellent, for whatever reason, the standard google feed extension that comes with OpenCart wasn't working correctly, but I installed this bad boy and it fixed it right up. Thank you for this. :)

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Mon May 21, 2012 11:48 pm
by cmhalon
Quick question, for the google_product_category, I haven't found a fix that addresses this, this is currently the only error I'm getting but I don't know how to get rid of it and get that attribute included. Anyone have a fix for this?

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Thu Jun 28, 2012 12:07 am
by storm-cloud
I have just downloaded this module. Looks great! The format is much cleaner than the default module.

A couple questions...

1) As mentioned above, is there any way to have SEO URL's show? Full product path would be even better!

2) We have the ™ symbol in some of our category titles. The mod doesn't seem to like these and causes errors but the default Google Base Feed is ok with this. Any suggestion to fix this? *

* Note (off topic): I have noticed that OpenCart doesn't seem to encode both ™ and ® to ™ and &reg: as they are meant to be in HTML. The page seems to pass vaildation but I was wondering if there was a way to fix this?

Edit: I also just noticed that for some reason the tags are not being stripped. I have removed the strip tags code for the description area on our site but the standard feed is still able to remove these. Perhaps this one works differently.

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Fri Jul 13, 2012 11:21 am
by moneycarlo
tried this but it stopped at a â character. Weird thing is i can't find that anywhere in my products/titles etc so who knows. It's weird because it breaks the xml too. Here's the line it chokes on:
<g:brand>Green Toys&acirc;al Care Products</g:product_type>

I did have a brand called Green Toys and a little tm symbol next to it but I deleted that. I even went into database to verify the brand was changed so I'm not sure where it's pulling this from...
Plus the &acirc character is like the letter "a" with an accent mark on it, vs the trademark symbol which would be &trade

maybe its a bug in the html_entities call? I really have no idea but thorwing it out there for ppl smarter than me :)

Although the original google base and the open base seem to get through the whole file without these errors...

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Wed Jul 18, 2012 11:15 am
by slasher
Works perfect but I'm trying to add an on off switch for certain products as I don't want then to show

Have created an extra field in product table

google_status tinyint(1)

Code: Select all

if ($p['google_status']=0) {
	} else {
 $item = $this->_c('item');
                // Add basic title, link and description
                $item_title = $item->appendChild($this->_c('title', '', false));
#################rest of the code etc  ################
}
I have 10 products set to 1 for tesing

Can't get this to work any ideas?

Thanks in advance

Slasher

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Wed Jul 18, 2012 9:44 pm
by slasher
It's ok worked it out

For anyone else that needs this

create field in product table

`google_status` tinyint(1) NOT NULL default '1'

in catalog/controller/feed/google_base_improved.php

line 88 change

from

Code: Select all

$channel->appendChild($item);
to

Code: Select all

if ($p['google_status']==0) {
} else {
$channel->appendChild($item);
}
simply change the value to 0 in product table to remove the the product from the feed

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Thu Jul 19, 2012 5:48 pm
by storm-cloud
Slasher just to confirm, your code works by manually updating the database with the extra field you have created? It would be great if someone could somehow integrate this feature into the admin panel with perhaps a simple checkbox.

I agree with Jay that this feed certainly looks fantastic. It is a shame that Warp Conduit hasn't been around to consider further development.

So far I can see two main improvements that can be made...

1) It seems that special characters are not being encoded correctly and/or are breaking the feed.

2) SEO URL's should be enabled if they have been selected in the admin panel*.

* Has anyone worked out how to enable SEO URL's with this feed?

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Thu Jul 26, 2012 4:09 am
by rfutrell
Having issue with feed calculating tax and adding it to the price. Only need to charge tax in certain areas and can set that up on Google. What could I change to get the feed to stop calculating tax and upload correctly to Google? Right now on Google it is showing all of my base prices as including tax .... for example the ad (if Product X sells for $1 and the tax was 7% only in certain areas) would read :

Image Product X Price $1.07
Description $1.14 with est. tax & free shipping

Where it should read as follows:

Image Product X Price $1.00
Description $1.07 with est. tax & free shipping

In other areas where tax is not applicable the ad currently reads

Image Product X Price $1.07
Description Free Shipping

Where it should read as follows:

Image Product X Price $1.00
Description Free Shipping

The feed is sending the total price including tax and I just need it to send the product price or the special price - Google can calculate the tax for their ad for the area that I need and the shopping cart can do it when a sale is checking out ...

I hope I have made sense of this problem. Please help.

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Sun Nov 18, 2012 9:25 pm
by eyal
Hi,

I have special characters in description / title such as &, ®, ™, in my other XML feed I was using in oscommerece I have these lines that handle replacement of these 3 characters:

Code: Select all

	// search and replace characters from data which xml will not process 
  	if ($product_name == 1) { 
	$row['products_name']	= ereg_replace ("&", " and ", $row['products_name']); 
  	$row['products_name']	= ereg_replace ("®", "(R)", $row['products_name']); 
  	$row['products_name']	= ereg_replace ("™", "(TM)", $row['products_name']); 
 	} 
	if ($product_manufacturer == 1) { 
	$row['manufacturers_name']	= ereg_replace ("&", " and ", $row['manufacturers_name']); 
  	$row['manufacturers_name']	= ereg_replace ("®", "(R)", $row['manufacturers_name']); 
  	$row['manufacturers_name']	= ereg_replace ("™", "(TM)", $row['manufacturers_name']); 
	} 
I can' figure out how to implement this replace on google base xml...

HELP anyone? :crazy:

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Wed Jul 17, 2013 5:41 am
by colin136
i have at last got it to work just a bit missing i want to add the google product category to every product is there a easy way rather than do one at a time anyone got a good idea

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Thu Jan 30, 2014 2:48 am
by pensacolawebdesigns
I too would like to know if anyone has been able to get the SEO URL to work in this feed.

Thanks,

Chris

Re: Google Base Improved v1.5b for OpenCart 1.5.x

Posted: Thu Feb 06, 2014 9:32 am
by platinum
I am now all of a sudden getting this error. Did Google change something. It was working fine a month ago. PLEASE HELP!!!

XML Parsing Error: XML or text declaration not at start of entity
Location: http://www.platinum-records.com/index.p ... e_improved
Line Number 1, Column 5: <?xml version="1.0" encoding="UTF-8"?>
----^