Google Product Search Feeder II [Support Thread]
This is the support thread for the to-be-released shortly Google Product Search Feeder II (aka GPSF-2) plugin.
The plugin has been tested on zc156b through zc158a on PHP versions 7.0 through 8.2 and replaces
- Google Merchant Center Feeder: https://www.zen-cart.com/downloads.php?do=file&id=1375
- Google Froogle: https://www.zen-cart.com/downloads.php?do=file&id=319
I'll post the download link once it's available.
Re: Google Product Search Feeder II [Support Thread]
Thank you for making this available @lat9!
Re: Google Product Search Feeder II [Support Thread]
Re: Google Product Search Feeder II [Support Thread]
ZC v1.5.8a
PHP 8.0
GPSF v1.0.0
New install, not converting from a previous version.
Admin > Tools > Google Product Search Feeder II
Generate Feed gives 'Request failed, Gone (410).'
If I remove the currency_code portion from the GET request URL
HTML Code:
mydomain.co.uk/gpsf_main_controller.php?key=&feed=fy_un_tp&limit=0&offset=0¤cy_code=GBP&language_id=1
to
Code:
mydomain.co.uk/gpsf_main_controller.php?key=&feed=fy_un_tp&limit=0&offset=0&language_id=1
The feed is successfully generated, with the currency included together with the price:
HTML Code:
<g:price>2.75 GBP</g:price>
I gather that this is correct from Google's point of view and wonder if the '¤cy_code=GBP' in the GET request is actually needed.
I might have overthought all of this and there may exist a simple solution.
Edit: this is on a local dev server (WAMP) with self-signed SSL
Re: Google Product Search Feeder II [Support Thread]
Any logs generated? If the $_GET['currency_code'] is set, the processing looks for that in the currencies class.
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
lat9
Any logs generated? If the $_GET['currency_code'] is set, the processing looks for that in the currencies class.
No logs, I'll delve deeper.
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
simon1066
No logs, I'll delve deeper.
Some plonker(me) had added a currency redirect to 410 in .htaccess - when its contents were brought in from another site. All's working now.
Re: Google Product Search Feeder II [Support Thread]
These PHP extension classes are new to me, but as I wanted to create a custom product_type (I used 666 as a test) for category 66 I used this code in a new classes file (includes/classes/gpsf/gpsfKb.php):
PHP Code:
<?php
/**
*/
class gpsfKb extends gpsfBase
{
public function getProductsAttributes(string $products_id, array $product, array $categories_list, $cPath = '66', array $custom_fields): array
{
$extension_custom_fields = ['product_type' => '666',];
return $extension_custom_fields;
}
}
This works in that it adds the product_type to the feed,
Code:
<g:product_type>666</g:product_type>
<g:product_type><![CDATA[Gift Vouchers]]></g:product_type>
I would appreciate some guidance on the code changes needed to replace the already generated product_type rather than add a new one.
I think that this plugin's 'site-specific additions to a product feed' is going to be a stretch for most non-coders, like me, so hopefully this example will get the ball rolling.
Re: Google Product Search Feeder II [Support Thread]
Actually, what I've done hasn't worked as it adds the '666' to all products. Back to the drawing board.
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
simon1066
These PHP extension classes are new to me, but as I wanted to create a custom product_type (I used 666 as a test) for category 66 I used this code in a new classes file (includes/classes/gpsf/gpsfKb.php):
PHP Code:
<?php
/**
*/
class gpsfKb extends gpsfBase
{
public function getProductsAttributes(string $products_id, array $product, array $categories_list, $cPath = '66', array $custom_fields): array
{
$extension_custom_fields = ['product_type' => '666',];
return $extension_custom_fields;
}
}
This works in that it adds the product_type to the feed,
Code:
<g:product_type>666</g:product_type>
<g:product_type><=!=[=C=D=A=T=A=[Gift Vouchers]=]=></g:product_type>
I would appreciate some guidance on the code changes needed to
replace the already generated product_type rather than add a new one.
I think that this plugin's '
site-specific additions to a product feed' is going to be a stretch for most non-coders, like me, so hopefully this example will get the ball rolling.
At this point, the gpsfFeedGenerator class doesn't acknowledge an override for the product_type, using either a fixed value or a selection from the product's master-category's name 'tree'. I've created a change-request (https://github.com/lat9/gpsf/issues/11) on the GPSF GitHub repository.