| @@ -365,9 +365,9 @@ | ||
| 365 | 365 | var cartButton = cartWrpper.find( |
| 366 | 366 | '.product_type_grouped, .add_to_cart_button, .single_add_to_cart_button ' |
| 367 | 367 | ); |
| 368 | 368 | if (cartIcon) { |
| 369 | - console.log( cartButton.find('svg') ) | |
| 369 | + //console.log( cartButton.find('svg') ) | |
| 370 | 370 | cartButton.find('i').remove(); |
| 371 | 371 | cartButton.find('svg').remove(); |
| 372 | 372 | cartButton.find('img').remove(); |
| 373 | 373 | cartButton.prepend(cartIcon); |
| @@ -750,6 +750,18 @@ | ||
| 750 | 750 | protected function apply_hooks_before_render() { |
| 751 | 751 | if ( $this->is_edit_mode() ) { |
| 752 | 752 | add_filter( 'wp_calculate_image_srcset_meta', '__return_null' ); |
| 753 | 753 | } |
| 754 | + } | |
| 755 | + | |
| 756 | + /** | |
| 757 | + * If checkout registration is disabled and not logged in, | |
| 758 | + * the user cannot check out. | |
| 759 | + * | |
| 760 | + * @return bool | |
| 761 | + */ | |
| 762 | + protected function has_checkout_restriction() { | |
| 763 | + $checkout = WC()->checkout(); | |
| 764 | + | |
| 765 | + return ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in(); | |
| 754 | 766 | } |
| 755 | 767 | } |