Grab variation sku with wc_add_to_cart_message_html filter
-
I am needing to replace the product title in the “<product title> has been added to your cart” message with the name of the variation SKU that was added. However, the $products argument only contains this array:
Array ( [4431] => 3 )The array only contains the base product’s ID. I would appreciate a full array of the specific product data like the $cart_item variable outputs in other hooks. Does anybody have any ideas on how I can add an additional argument to the hook that contains at the very least the variation SKU? I think the array that is given is very bare bones compared to what other hooks have to offer. The array key should at least be the variation’s ID, not the base product’s.
Any help is appreciated.
The topic ‘Grab variation sku with wc_add_to_cart_message_html filter’ is closed to new replies.