| @@ -66,9 +66,9 @@ | ||
| 66 | 66 | |
| 67 | 67 | public function product_quick_view_ajax() { |
| 68 | 68 | $product_id = isset( $_REQUEST['product_id'] ) ? absint( $_REQUEST['product_id'] ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 69 | 69 | |
| 70 | - if ( empty( $product_id ) ) { | |
| 70 | + if ( empty( $product_id ) || 'publish' !== get_post_status( $product_id ) ) { | |
| 71 | 71 | wp_send_json_error( esc_html__( 'Product Id not found', 'shopbuilder' ) ); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | global $sitepress; |
| @@ -228,9 +228,8 @@ | ||
| 228 | 228 | * |
| 229 | 229 | * @return string [HTML] |
| 230 | 230 | */ |
| 231 | 231 | public function button_shortcode( $atts, $content = '' ) { |
| 232 | - $this->enqueue(); | |
| 233 | 232 | global $product; |
| 234 | 233 | if ( ! $product instanceof WC_Product ) { |
| 235 | 234 | return ''; |
| 236 | 235 | } |