Can we please have this filter added

#44913
  • Resolved Dale
    Rank Math free

    Can we please have this filter added to

    RankMath\RichSnippet\Product_WooCommerce::set_offers_variable( $product, &$entity, $seller )

    // Look for itemCondition override by variation.
    $this->set_variation_condition( $variation, $offer );
    
    // Have the chance to edit the offer scheme with the product data available
    $offer = apply_filters('rank_math/snippet/rich_snippet_product_offer', $offer, $variation, $product, $seller);
    
    $entity['offers'][] = $offer;

    We really need a way to be able to edit the offer schema on variable products, WITH the product data in context to avoid more db lookup. This is the only chance in the code to be able to match the variation with the offer schema building.

    • This topic was modified 4 years ago by Dale.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Michael Davis
    Rank Math pro

    Hello,

    Thank you for contacting Rank Math today.

    I have just submitted your feature request to our dev team and we will be getting back to you shortly to discuss this further.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    You can use following filter to change the Product schema data:
    https://rankmath.com/kb/filters-hooks-api-developer/#change-post-schema-data

    Here is an example:

    
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        $offer = [  ]; // Custom Code to get offer
        $entity['offers'] = $offer;
        return $entity;
    });
    

    I hope that helps.

    Dale
    Rank Math free

    There is no product data associated with that filter.

    We need the entity and the wc_product object side by side.

    Todd
    Rank Math free

    Hi Dale,

    As much as we would love to offer customized solutions to each and every user we have, it just isn’t possible for a small company like ours with limited resources.

    We have provided the filter and you can try playing with it and maybe seek a professional’s help to get it to do what you want.

    If you have any issues with the options we offer in the plugin, let us know.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘Can we please have this filter added’ is closed to new replies.