Answer the question
In order to leave comments, you need to log in
Why is it not cleared after paying for the goods and returning to the basket?
There is a wordpress + woocommerce store. After paying with a card for the selected order using the return to cart button, it is not cleared. If you add a line of code:
<?php global $woocommerce; $woocommerce->cart->empty_cart(); ?>
/**
* Process the payment and return the result
**/
function process_payment( $order_id ) {
$order = wc_get_order( $order_id );
return array(
'result' => 'success',
'redirect' => $order->get_checkout_payment_url( true )
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question