| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | |
| 17 | 17 | public function __construct() { |
| 18 | 18 | add_action( 'wp_enqueue_scripts', [ $this, 'enqueue' ] ); |
| 19 | 19 | |
| 20 | - // Gallery Plugin Support rtwpvg_disable_enqueue_scripts | |
| 20 | + // Gallery Plugin Support rtwpvg_disable_enqueue_scripts. | |
| 21 | 21 | add_filter( 'rtwpvg_disable_enqueue_scripts', '__return_false', 11 ); |
| 22 | 22 | |
| 23 | 23 | // Template. |
| 24 | 24 | |
| @@ -64,17 +64,17 @@ | ||
| 64 | 64 | add_action( 'rtsb/wcqv/product/summary', 'woocommerce_template_single_meta', 30 ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function product_quick_view_ajax() { |
| 68 | - $product_id = absint( $_REQUEST['product_id'] ); | |
| 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; |
| 75 | 75 | |
| 76 | - $lang = isset( $_REQUEST['lang'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['lang'] ) ) : ''; | |
| 76 | + $lang = isset( $_REQUEST['lang'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['lang'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 77 | 77 | if ( defined( 'ICL_LANGUAGE_CODE' ) && $lang && isset( $sitepress ) ) { |
| 78 | 78 | $sitepress->switch_lang( $lang, true ); |
| 79 | 79 | } |
| 80 | 80 | |
| @@ -85,10 +85,10 @@ | ||
| 85 | 85 | if ( defined( 'RTWPVG_VERSION' ) ) { |
| 86 | 86 | remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); |
| 87 | 87 | } |
| 88 | 88 | if ( ! defined( 'RTWPVG_VERSION' ) ) { |
| 89 | - add_action( 'woocommerce_product_thumbnails', [ $this, 'woocommerce_product_thumbnails_before' ], 1 ); | |
| 90 | - add_action( 'woocommerce_product_thumbnails', [ $this, 'woocommerce_product_thumbnails_after' ], 25 ); | |
| 89 | + //add_action( 'woocommerce_product_thumbnails', [ $this, 'woocommerce_product_thumbnails_before' ], 1 ); | |
| 90 | + //add_action( 'woocommerce_product_thumbnails', [ $this, 'woocommerce_product_thumbnails_after' ], 25 ); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | ob_start(); |
| 94 | 94 | Fns::load_template( 'quick-view/content' ); |
| @@ -178,8 +178,9 @@ | ||
| 178 | 178 | global $product; |
| 179 | 179 | if ( $product instanceof WC_Product ) { |
| 180 | 180 | do_action( 'rtsb/modules/quick_view/print_button', $product->get_id() ); |
| 181 | 181 | } |
| 182 | + | |
| 182 | 183 | } |
| 183 | 184 | |
| 184 | 185 | |
| 185 | 186 | /** |
| @@ -240,8 +241,19 @@ | ||
| 240 | 241 | return ob_get_clean(); |
| 241 | 242 | } |
| 242 | 243 | |
| 243 | 244 | public function enqueue() { |
| 245 | + | |
| 246 | + wp_enqueue_style( 'elementor-icons-fa-regular' ); | |
| 247 | + | |
| 248 | + wp_enqueue_style( 'elementor-icons-fa-solid' ); | |
| 249 | + wp_enqueue_style( 'elementor-icons-shared-0' ); | |
| 250 | + // wp_enqueue_style( 'elementor-frontend' ); | |
| 251 | + | |
| 252 | + if ( ! class_exists('WooProductVariationGallery') && current_theme_supports( 'wc-product-gallery-slider' ) ) { | |
| 253 | + wp_enqueue_script( 'flexslider' ); | |
| 254 | + } | |
| 255 | + | |
| 244 | 256 | wp_enqueue_script( 'wc-add-to-cart-variation' ); |
| 245 | 257 | if ( version_compare( WC()->version, '3.0.0', '>=' ) ) { |
| 246 | 258 | if ( current_theme_supports( 'wc-product-gallery-zoom' ) ) { |
| 247 | 259 | wp_enqueue_script( 'zoom' ); |
| @@ -266,9 +278,9 @@ | ||
| 266 | 278 | ], |
| 267 | 279 | RTSB_VERSION, |
| 268 | 280 | true |
| 269 | 281 | ); |
| 270 | - wp_enqueue_style( 'rtsb-modules' ); | |
| 282 | + wp_enqueue_style( 'rtsb-modules' ); | |
| 271 | 283 | wp_enqueue_script( 'rtsb-quick-view' ); |
| 272 | 284 | |
| 273 | 285 | // Allow user to load custom style and scripts! |
| 274 | 286 | do_action( 'rtsb/modules/quick_view/custom_scripts' ); |