ayrez
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Woongkir] Load plugin only on certain page(s)Mungkin di update berikutnya bisa di perbaiki agar script hanya di-eneble pada page yang membutuhkan saja pak.
saya masukkan di theme functions.php
// Deregister woongkir add_action( 'wp_print_scripts', 'woongk_deregister_javascript', 100 ); function woongk_deregister_javascript() { if ( ! is_checkout() && ! is_cart() && ! is_page_template('form-billing.php') ) { wp_deregister_script( 'woongkir-frontend' ); } }Forum: Plugins
In reply to: [Woongkir] Load plugin only on certain page(s)Saya menambahkan conditional tags seperti di bawah, sementara berjalan dg baik dan ga ada kendala.
Terimakasih pak, this is the best ongkir plugin I’ve ever used.if ( is_checkout() || is_cart() ) { // Enqueue main scripts. $js_url = WOONGKIR_URL . 'assets/js/woongkir-frontend.min.js'; if ( $is_debug ) { $js_url = add_query_arg( array( 't' => time() ), str_replace( '.min', '', $js_url ) ); } wp_enqueue_script( 'woongkir-frontend', // Give the script a unique ID. $js_url, // Define the path to the JS file. array( 'jquery', 'wp-util', 'select2', 'selectWoo', 'lockr.js' ), // Define dependencies. WOONGKIR_VERSION, // Define a version (optional). true // Specify whether to put in footer (leave this true). ); woongkir_localize_script( 'woongkir-frontend', 'woongkir_params' ); }
Viewing 2 replies - 1 through 2 (of 2 total)