• We’re having problems with the information the plugin sends to YOTPO’s API because it’s all based on product IDs, rather than Variation IDs when they apply.

    In the wc_yotpo_get_single_map_data() function, you’re grabbing the product ID from the order data, but not checking for the existence of a variation ID that (at least in our case) should supersede the Product ID (when it’s a WC_Product_Variable class instance).

    Is there any chance that you could adjust it to look for variations ( if ( ! empty( $product['variation_id'] ) ) {, for example ) and using that to ID to get the title, URL, SKU, etc.?

    If not, would it be possible to, at least, add a filter after you’ve gathered the $product_data (maybe passing it $product and $_product variables for context) so that we can adjust the data ourselves? Something like

    apply_filters('yotpo_order_product_data', $product_data, $wc_product, $wc_order_item_product );

    $wc_product being your $_product variable
    $wc_order_item_product being your $product variable

    Thank you,
    Michal Bluma

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter michalbluma

    (@michalbluma)

    ..sorry, of course, I meant
    $product_data = apply_filters('yotpo_order_product_data', $product_data, $wc_product, $wc_order_item_product );

    Hey Michal, the problem stems from the way WC handles variations – they are not a separate entity when it comes to the front-end page they are on.
    Allow me to paint an example:
    – Shirt (ID: 1) – main product.
    – Shirt – Red (ID: 2) – variation of 1.
    – Shirt – Blue (ID: 3) – variation of 1.

    All three products point to product 1’s page (e.g https://localhost/shirt), and when you go to this page, the WooCommerce global $product will have an ID of 1.
    Even if you choose variation 2 or 3, the product you are currently on is 1.
    If you submit the variation ID to Yotpo, review requests will be sent for those IDs and will never show up on the main product ID (1).

    It’d be much simpler if variations were separate entities in WooCommerce.

    Hi,

    No sure if I have the same problem but sounds like it could be similar.
    Each time a purchase is made on my site the Yotpo product catalog information is updated. This is resulting in customers getting review requests on the wrong product variation.

    For example, I have:
    Product id: 123
    Product A – 48, green
    Product A – 50, black

    Customer Johan buys Product A – 48, green. The the Yotpo product catalog information is updated with Product id: 123 = Product A – 48, green

    Customer David buys Product A – 50, black. The the Yotpo product catalog information is updated with Product id: 123 = Product A – 50, black

    Once Yotpo is sending out the review request to customer Johan the product title in their email will be Product A – 50, black. Even though Johan bought Product A – 48, green. Just because the Yotpo product catalog information was update in between that purchase and the review email being sent out.

    Those anyone have any solution to this?

    Is there any way for WooCommerce to only send the production title without the variation information to Yotpo?

    Any help would be highly appreciated.

    All the best
    Jacob

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Variations vs Products’ is closed to new replies.