This commit is contained in:
Pedro Silva 2024-01-05 09:58:00 +00:00
parent a23dbb9c8b
commit 3c9043eeb6
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -67,10 +67,10 @@ class CartScriptParamsEndpoint implements EndpointInterface {
*/
public function handle_request(): bool {
try {
if ( ! $this->smart_button instanceof SmartButton ) {
wp_send_json_error();
return false;
}
if ( ! $this->smart_button instanceof SmartButton ) {
wp_send_json_error();
return false;
}
if ( is_callable( 'wc_maybe_define_constant' ) ) {
wc_maybe_define_constant( 'WOOCOMMERCE_CART', true );