Variations vs Products
-
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 aWC_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 likeapply_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 variableThank you,
Michal BlumaThe page I need help with: [log in to see the link]
- The topic ‘Variations vs Products’ is closed to new replies.