public function script() { if (WC_Gateway_PayGate::$is_script_already === true) { return; } if ($this->enabled == 'yes') { WC_Gateway_PayGate::$is_script_already = true; $order_id = isset($_GET['order']) ? absint($_GET['order']) : 0; $order_key = isset($_GET['key']) ? woocommerce_clean($_GET['key']) : ''; $order = new WC_Order($order_id); $thanks_url = get_permalink($order->get_checkout_order_received_url()); $thanks_url = add_query_arg('key', $order->order_key, add_query_arg('order', $order->id, $thanks_url)); //wp_enqueue_script( 'wc_paygate_remote', 'https://api.paygate.net/ajax/common/OpenPayAPI.js',null, null,true); #ie 7 지원 echo '<script language="javascript" src="https://api.paygate.net/ajax/common/OpenPayAPI.js" charset="utf-8"></script>'; wp_enqueue_script('wc_paygate_main', WCKP_PAYGATE_PLUGIN_URL . 'assets/paygate.js', array('jquery'), wc_korea_pack()->version, true); wp_localize_script('wc_paygate_main', 'wckp', array('thanks_url' => $thanks_url, 'cart_url' => get_permalink(woocommerce_get_page_id('cart')), 'message_failure' => __('결제가 실패했습니다. 다시 이용해 주세요', 'wc_korea_pack'))); wp_register_style('wc_paygate_main', WCKP_PAYGATE_PLUGIN_URL . 'assets/style.css', '', wc_korea_pack()->version); wp_enqueue_style('wc_paygate_main'); } }
function scripts() { global $woocommerce, $wp_scripts; if (get_option('woocommerce_wckp_zip_code') == 'yes') { if (is_checkout() || is_account_page()) { $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; wp_enqueue_script('daum-post-code', '//dmaps.daum.net/map_js_init/postcode.js', 'jquery', '1.0', TRUE); wp_enqueue_script('wckp-checkout', plugin_dir_url(__FILE__) . 'checkout.js', array('jquery', 'daum-post-code'), wc_korea_pack()->version, true); } } }