• Resolved Jim

    (@smokingblends)


    On single products we are still getting these warnings. Global Identifier is new I believe.
    global identifier, brand, offerCount

    I have looked over your documentation regarding creating custom schema here.
    https://github.com/woocommerce/woocommerce/wiki/Structured-data-for-products

    1. Where do you put the code? We would rather not use another plugin and unfortunately we can not get a child theme to work at this time.

    2. Here is the example code that sets the sku to product id.
    How would you be able to set it for global identifier or brand if there is nothing to set it to?

    add_filter( ‘woocommerce_structured_data_product’, function( $markup, $product ) {
    $markup[‘sku’] = $product->get_id(); // Set sku to product id.
    return $markup;
    } );

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @smokingblends,

    I understand that you don’t want to use another plugin, but what if it was super-easy to use and would allow you to use it in a myriad of ways? I am talking about a free plugin in the repository called Code Snippets (https://www.ads-software.com/plugins/code-snippets/).

    Adding the code you have above to this plugin will allow you to implement your custom code without it being overwritten during an update. Please give it a try and see if it allows you to make the updates you would like to.

    All the best!

    Thread Starter Jim

    (@smokingblends)

    @phillipwoo

    We have a working Child Theme now. Can we use that? Do you have a good tutorial for how to create a code for the specific issues? Where would you put the code via a child theme?

    What we were hoping to do here is get some people to collaborate on this. Everyone using this cart is experiencing the same warning and this should be easy to resolve via custom code.

    Yes, you can! You can add the code you want to the child theme’s functions.php as well. Here’s more information on how to use a child theme functions.php:

    https://developer.www.ads-software.com/themes/advanced-topics/child-themes/#using-functions-php

    Please let me know how this works for you.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating custom schema’ is closed to new replies.