Astra_Ext_Woocommerce_Loader::disable_woo_cart_msg( string $message, int $product_id )

Disable add to cart messages for AJAX request.


Description


Parameters

$message

(string) (Required) add to cart message.

$product_id

(int) (Required) product ID.


Return

(string)


Source

File: addons/woocommerce/classes/class-astra-ext-woocommerce-loader.php

		public function disable_woo_cart_msg( $message, $product_id ) {
			$is_ajax_add_to_cart = astra_get_option( 'single-product-ajax-add-to-cart' );

			if ( wp_doing_ajax() && '1' == $is_ajax_add_to_cart ) {
				return null;
			}

			return $message;
		}

Changelog

Changelog
Version Description
1.1.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.