parent
b69066405b
commit
4a7f207eff
|
@ -0,0 +1,27 @@
|
|||
jQuery(document).ready(function($){
|
||||
|
||||
$('#add_payment_method')
|
||||
|
||||
/* Payment option selection */
|
||||
|
||||
.on( 'click init_add_payment_method', '.payment_methods input.input-radio', function() {
|
||||
if ( $('.payment_methods input.input-radio').length > 1 ) {
|
||||
$('div.payment_box').filter(':visible').slideUp(250);
|
||||
if ($(this).is(':checked')) {
|
||||
$('div.payment_box.' + $(this).attr('ID')).slideDown(250);
|
||||
}
|
||||
} else {
|
||||
$('div.payment_box').show();
|
||||
}
|
||||
})
|
||||
|
||||
// Trigger initial click
|
||||
.find('input[name=payment_method]:checked').click();
|
||||
|
||||
$('#add_payment_method').submit(function(){
|
||||
$('#add_payment_method').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
||||
});
|
||||
|
||||
$('body').trigger('init_add_payment_method');
|
||||
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function(e){e("#add_payment_method").on("click init_add_payment_method",".payment_methods input.input-radio",function(){if(e(".payment_methods input.input-radio").length>1){e("div.payment_box").filter(":visible").slideUp(250);if(e(this).is(":checked")){e("div.payment_box."+e(this).attr("ID")).slideDown(250)}}else{e("div.payment_box").show()}}).find("input[name=payment_method]:checked").click();e("#add_payment_method").submit(function(){e("#add_payment_method").block({message:null,overlayCSS:{background:"#fff url("+woocommerce_params.plugin_url+"/assets/images/ajax-loader.gif) no-repeat center",backgroundSize:"16px 16px",opacity:.6}})});e("body").trigger("init_add_payment_method")})
|
|
@ -73,7 +73,7 @@ class WC_Frontend_Scripts {
|
|||
if ( is_cart() )
|
||||
wp_enqueue_script( 'wc-cart', $frontend_script_path . 'cart' . $suffix . '.js', array( 'jquery', 'wc-country-select' ), WC_VERSION, true );
|
||||
|
||||
if ( is_checkout() || is_add_payment_method_page() ) {
|
||||
if ( is_checkout() ) {
|
||||
|
||||
if ( get_option( 'woocommerce_enable_chosen' ) == 'yes' ) {
|
||||
wp_enqueue_script( 'wc-chosen', $frontend_script_path . 'chosen-frontend' . $suffix . '.js', array( 'chosen' ), WC_VERSION, true );
|
||||
|
@ -83,6 +83,9 @@ class WC_Frontend_Scripts {
|
|||
wp_enqueue_script( 'wc-checkout', $frontend_script_path . 'checkout' . $suffix . '.js', array( 'jquery', 'woocommerce', 'wc-country-select' ), WC_VERSION, true );
|
||||
}
|
||||
|
||||
if ( is_add_payment_method_page() )
|
||||
wp_enqueue_script( 'wc-add-payment-method', $frontend_script_path . 'add-payment-method' . $suffix . '.js', array( 'jquery', 'woocommerce' ), WC_VERSION, true );
|
||||
|
||||
if ( $lightbox_en && ( is_product() || ( ! empty( $post->post_content ) && strstr( $post->post_content, '[product_page' ) ) ) ) {
|
||||
wp_enqueue_script( 'prettyPhoto', $assets_path . 'js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array( 'jquery' ), '3.1.5', true );
|
||||
wp_enqueue_script( 'prettyPhoto-init', $assets_path . 'js/prettyPhoto/jquery.prettyPhoto.init' . $suffix . '.js', array( 'jquery' ), WC_VERSION, true );
|
||||
|
@ -115,7 +118,7 @@ class WC_Frontend_Scripts {
|
|||
'apply_coupon_nonce' => wp_create_nonce( "apply-coupon" ),
|
||||
'option_guest_checkout' => get_option( 'woocommerce_enable_guest_checkout' ),
|
||||
'checkout_url' => add_query_arg( 'action', 'woocommerce-checkout', WC()->ajax_url() ),
|
||||
'is_checkout' => is_page( woocommerce_get_page_id( 'checkout' ) ) && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) && ! isset( $wp->query_vars['add-payment-method'] ) ? 1 : 0,
|
||||
'is_checkout' => is_page( woocommerce_get_page_id( 'checkout' ) ) && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ? 1 : 0,
|
||||
'locale' => json_encode( WC()->countries->get_country_locale() )
|
||||
) ) );
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||
|
||||
global $woocommerce;
|
||||
?>
|
||||
<form id="order_review" method="post">
|
||||
<form id="add_payment_method" method="post">
|
||||
<div id="payment">
|
||||
<ul class="payment_methods methods">
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue