Answer the question
In order to leave comments, you need to log in
WOOCOMMERCE - where are the functions connected to the hook?
Hello. Most likely, I did not fully understand the principle of how hooks work.
Woocommerce cart has
apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
Answer the question
In order to leave comments, you need to log in
Hello.
The value $_product
is written to the variable $cart_item['data']
.
This behavior can be changed with add_filter. In the function that you connect to this filter, you will have three options available: $cart_item['data'], $cart_item, $cart_item_key
. Based on which, you can customize your logic.
In your function, you will do return что-то
and this is what will be written in $_product
instead of $cart_item['data']
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question