Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
simon1066
Actually, what I've done hasn't worked as it adds the '666' to all products. Back to the drawing board.
Right, you'd need to check the incoming $products_id value and possibly the $product/$categories_list/$cPath arrays to see if the current product 'qualifies' for the change.
For what I think you're trying to do:
PHP Code:
public function getProductsAttributes(string $products_id, array $product, array $categories_list, array $cPath, array $custom_fields): array
{
if (!in_array(66, $cPath)) {
return [];
}
$extension_custom_fields = ['product_type' => '666',];
return $extension_custom_fields;
}
That checks to see if categories-id 66 is present in the current product's category-tree, returning the 'product_type' override if so; otherwise, no override is supplied.
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
lat9
Right, you'd need to check the incoming $products_id value and possibly the $product/$categories_list/$cPath arrays to see if the current product 'qualifies' for the change.
For what I think you're trying to do:
PHP Code:
public function getProductsAttributes(string $products_id, array $product, array $categories_list, array $cPath, array $custom_fields): array
{
if (!in_array(66, $cPath)) {
return [];
}
$extension_custom_fields = ['product_type' => '666',];
return $extension_custom_fields;
}
That checks to see if categories-id 66 is present in the current product's category-tree, returning the 'product_type' override if so; otherwise, no override is supplied.
That's great, thanks so much for the pointer/correction.
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
lat9
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.
Understood.
Re: Google Product Search Feeder II [Support Thread]
Cindy - Excited to try this one out! I just put it on our site but I'm seeing the following debug error on ALL the products:
Code:
Array
(
[20361] => # SELFIE by Simon R. Stefan & Alex Pandrea - Trick: title cannot be empty
[25185] => #Augmented (Gimmick and Online Instructions) by Luca Volpe and Renato Cotini - Trick: title cannot be empty
[21745] => #How by Magic from Holland and Ferry de Riemer - Trick: title cannot be empty
[35629] => $1.00 Prop Bill (1 bill/$1.00 value) - Realistic Fake Money: title cannot be empty
[35623] => $10.00 Prop Bill (1 bill/$10.00 value) - Realistic Fake Money: title cannot be empty
[24025] => $100 bill Silk 36 inch by Magic by Gosh - Trick: title cannot be empty
[12237] => $100 Bill Switch - Booklet + Gimmick by Royal Magic: title cannot be empty
.....
.....
Any idea what I should be looking at to resolve this?
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
Jeff_Mash
Cindy - Excited to try this one out! I just put it on our site but I'm seeing the following debug error on ALL the products:
Code:
Array
(
[20361] => # SELFIE by Simon R. Stefan & Alex Pandrea - Trick: title cannot be empty
[25185] => #Augmented (Gimmick and Online Instructions) by Luca Volpe and Renato Cotini - Trick: title cannot be empty
[21745] => #How by Magic from Holland and Ferry de Riemer - Trick: title cannot be empty
[35629] => $1.00 Prop Bill (1 bill/$1.00 value) - Realistic Fake Money: title cannot be empty
[35623] => $10.00 Prop Bill (1 bill/$10.00 value) - Realistic Fake Money: title cannot be empty
[24025] => $100 bill Silk 36 inch by Magic by Gosh - Trick: title cannot be empty
[12237] => $100 Bill Switch - Booklet + Gimmick by Royal Magic: title cannot be empty
.....
.....
Any idea what I should be looking at to resolve this?
Are you using products' meta-tag titles as the g:title? The value's either a product's name (which, for above isn't empty) or the metatags_title.
I might see the issue, darn it. /includes/classes/gpsfFeedGenerator.php, line 280, change from
if (GPSF_META_TITLE === 'true' && $product['metatags_title'] !== '') {
to
if (GPSF_META_TITLE === 'true' && !empty($product['metatags_title'])) {
... and let me know if that corrects the issue. That darn metatags_title can be null.
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
lat9
Are you using products' meta-tag titles as the g:title? The value's either a product's name (which, for above isn't empty) or the metatags_title.
I might see the issue, darn it. /includes/classes/gpsfFeedGenerator.php, line 280, change from
if (GPSF_META_TITLE === 'true' && $product['metatags_title'] !== '') {
to
if (GPSF_META_TITLE === 'true' && !empty($product['metatags_title'])) {
... and let me know if that corrects the issue. That darn metatags_title can be null.
BINGO! That fixed the issue!
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
Jeff_Mash
BINGO! That fixed the issue!
Thanks for the validation; I'll get a GitHub issue logged.
GitHub issue: https://github.com/lat9/gpsf/issues/12
Re: Google Product Search Feeder II [Support Thread]
Quote:
Originally Posted by
lat9
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.
Your code examples were a great help in enabling me to set up category changes, brand addition and title changes through the use of extensions. However, I jumped the gun a bit in that I didn't fully understand the workings of Google Merchant Center before posting. I now cannot see a need to manipulate the product_type so don't spend time on the Github change, on my account.
Re: Google Product Search Feeder II [Support Thread]
hey guys, super happy to have found this module after realising mine is almost ready to fail me completely. Thankyou lat9 for updating this :)
I've just downloaded the zip file and wanted to quickly ask if there is anything that needed updating before i proceed? I assume the github version has been updated to resolve the few issues identified in the thread already?
Re: Google Product Search Feeder II [Support Thread]
Other than the meta-tags' title issue; all others are included in the v1.0.0 version.