• Resolved RastaBomba

    (@rastabomba)


    I was trying to implement all recommended Product schema data, using diffferent approaches, but failed.

    I have a problem with ‘offercount’ ; ‘brand’ and ‘sku’.

    I used your recommended solution ‘a hook’ but found 2 issues with it:

    1). offercount would not work at all (google does not recognize it)
    2). brand and sku would apply to all products (I want to have unique brand and sku for each product presented on my website).

    Hook that I used:

    add_filter( ‘site-reviews/schema/Product’, function( $schema ) {
    $schema[‘sku’] = ‘2317’;
    $schema[‘brand’] = ‘Net Credit’;
    $schema[‘offercount’] = ‘1’;
    return $schema;

    });

    So I tried a diffferent approach and used custom fields on a chosen product page, but again faced an issue >> it would not be recognized in Google Schema Test.

    Custom fields I used (name/value):

    schema_offercount / 1
    schema_brand / Net Credit
    schema_sku / 2317

    How can I make it so that all these markups are added to my product page and get validated? (Also keeping in mind that these values would be different for each product page, not universal like the hook method does).

    Thank you and best regards,

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Site Reviews is not intended to be a complete schema.og solution for your website. All it does is provide the rating schema for your reviews, along with any schema fields that are required for the “LocalBusiness” and “Product” schema types.

    I suggest you find another plugin to use to complete your schema.org needs (i.e. something like https://wpschema.com).

    To link the schema from Site Reviews to other schemas on your page, use the Site Reviews hook to add an @id schema field (unless you are using the “Product” schema type, in which case Site Reviews will automatically add an @id tag which is compatible with the Woocommerce product schema). The @id tag is used to link multiple schemas together. If you have multiple schemas on your page and the schema type and id are identical, then search engines will see those schemas as linked.

    Please also see: https://www.ads-software.com/support/topic/merge-structured-data-values-to-woocommerce-default-product-structure-data/

    Thread Starter RastaBomba

    (@rastabomba)

    Ok, I’ll follow your recommendation and see how it goes. Thank you, I appreciate it.

    Plugin Author Gemini Labs

    (@geminilabs)

    An alternative solution is to use the Custom Fields meta box on your product pages to add custom fields for each of your additional schema values. For example:

    Then you can use these meta values like this:

    add_filter( 'site-reviews/schema/Product', function( $schema ) {
        $postId = get_the_ID();
        $schema['sku'] = get_post_meta( $postId, 'schema_sku', true );
        $schema['brand'] = get_post_meta( $postId, 'schema_brand', true );
        $schema['offercount'] = get_post_meta( $postId, 'schema_offercount', true );
        return $schema;
    });
    Thread Starter RastaBomba

    (@rastabomba)

    That seems to be an even better solution as I would not need to install additional plugins. I’ll test it out.

    Your level of support is outstanding. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Product Schema issue’ is closed to new replies.