About 10% Discount in backend order
-
Hi
How to use a 10% discount in a Backend Order?
But there are still questions, in the backend after clicking the button the product immediately becomes processed, and the discount does not apply, because there are not 2 products in the cart.In 5.2.1 after backend order an error appears in the search form
PHP Fatal error: Uncaught Error: Call to a member function get_cart() on null in /wp-content/plugins/bus-ticket-booking-with-seat-reservation/mp_global/class/MP_Global_Function.php:398
This code fixed it in 5.2.1
public static function check_product_in_cart( $post_id ) { $status = MP_Global_Function::check_woocommerce();
if ( $status == 1 && function_exists( ‘WC’ ) && WC()->cart ) { $product_id = MP_Global_Function::get_post_info( $post_id, ‘link_wc_product’ );
if ( ! is_null( WC()->cart ) ) {
foreach ( WC()->cart->get_cart() as $cart_item ) {
if ( $cart_item[‘product_id’] == $product_id ) {
return true; }
}
}
}
return false;
}
- You must be logged in to reply to this topic.