PhastPress not working with Retainful scripts
-
We use a plugin called Retainful for our WooCommerce site.
I added “phast_no_defer” for the “rnoc_track-user-cart” script. It works, but the wp_localize_inline script tag is not set to phast_no_defer. What do I do?
Hope that makes sense. Here’s the relevant function in the plugin:
/** * Adding the script to track user cart */ function addCartTrackingScripts() { if (!wp_script_is('wc-cart-fragments', 'enqueued')) { wp_enqueue_script('wc-cart-fragments'); } if (!wp_script_is(RNOC_PLUGIN_PREFIX . 'track-user-cart', 'enqueued')) { wp_enqueue_script(RNOC_PLUGIN_PREFIX . 'track-user-cart', $this->getAbandonedCartJsEngineUrl(), array('jquery'), RNOC_VERSION, false); $user_ip = $this->getClientIp(); $user_ip = $this->formatUserIP($user_ip); $data = array( 'ajax_url' => admin_url('admin-ajax.php'), 'version' => RNOC_VERSION, 'public_key' => self::$settings->getApiKey(), 'api_url' => self::$api->getAbandonedCartEndPoint(), 'tracking_element_selector' => $this->getTrackingElementId(), 'cart_tracking_engine' => self::$settings->getCartTrackingEngine() ); $data = apply_filters('rnoc_add_cart_tracking_scripts', $data); wp_localize_script(RNOC_PLUGIN_PREFIX . 'track-user-cart', 'retainful_cart_data', $data); } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PhastPress not working with Retainful scripts’ is closed to new replies.