Quote Originally Posted by simon1066 View Post
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.