Enable login by role both on frontend and backend #40

Merged
akrdzic merged 6 commits from role-access into master 2018-10-22 11:26:57 +02:00
Showing only changes of commit e420953c39 - Show all commits

View File

@@ -28,6 +28,18 @@ class Wiaas_Cart {
add_action( 'woocommerce_cart_loaded_from_session', array( __CLASS__, 'on_calculate_totals' ), 99, 1);
add_action('woocommerce_checkout_create_order', array(__CLASS__, 'add_additional_order_data'), 99);
add_action('woocommerce_set_cart_cookies', array(__CLASS__, 'do_not_set_cart_cookies'));
}
/**
* Do not set cart cookies
*/
public static function do_not_set_cart_cookies() {
if ( isset( $_COOKIE['woocommerce_items_in_cart'] ) ) {
wc_setcookie( 'woocommerce_items_in_cart', 0, time() - HOUR_IN_SECONDS );
wc_setcookie( 'woocommerce_cart_hash', '', time() - HOUR_IN_SECONDS );
}
}
/**