* * Your Inspiration Themes * * @package WordPress * @subpackage Your Inspiration Themes * @author Your Inspiration Themes Team <*****@*****.**> * * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.gnu.org/licenses/gpl-3.0.txt */ wp_enqueue_script('yit_checkout', YIT_CORE_ASSETS_URL . '/js/yit/jquery.yit_checkout.js'); $woocommerce_ship_to_billing = yit_woocommerce_default_shiptobilling(); /* fix check default billing to address step 2*/ $labelShipp = __( 'Shipping Address →', 'yit' ); $labelPay = __( 'Payment Method →', 'yit' ); $next_step2 = $woocommerce_ship_to_billing ? "4" : "3"; $label_step2 = $woocommerce_ship_to_billing ? $labelPay : $labelShipp; $alter_label_step2 = $woocommerce_ship_to_billing ? $labelShipp : $labelPay; /*-fix prev button step 4---------*/ $labelBillingPrev = __('← Billing Address', 'yit'); $labelShippingPrev = __('← Shipping Method', 'yit'); $next_step4 = $woocommerce_ship_to_billing ? "2" : "3"; $label_step4 = $woocommerce_ship_to_billing ? $labelBillingPrev : $labelShippingPrev; $alter_label_step4 = $woocommerce_ship_to_billing ? $labelShippingPrev : $labelBillingPrev; /*-----------*/ remove_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?> <?php endforeach; ?> </div> <?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?> <?php endif; ?> <?php else: ?> <?php if ( ( WC()->cart->needs_shipping() || get_option('woocommerce_require_shipping_address') == 'yes' ) && ! WC()->cart->ship_to_billing_address_only() ) : ?> <?php if ( empty( $_POST ) ) : $shiptobilling = yit_woocommerce_default_shiptobilling() ? 1 : 0; $shiptobilling = apply_filters('woocommerce_shiptobilling_default', $shiptobilling); else : $shiptobilling = $checkout->get_value('shiptobilling'); endif; ?> <p class="form-row" id="shiptobilling_bill"> <input id="shiptobilling_bill-checkbox" class="input-checkbox" <?php checked($shiptobilling, 1); ?> type="checkbox" name="shiptobilling" value="1" /> <label for="shiptobilling_bill-checkbox" class="checkbox"><?php _e('Ship to billing address?', 'yit'); ?></label> </p> <?php endif ?> <?php endif; ?>
function yit_woocommerce_object() { wp_localize_script( 'jquery', 'yit_woocommerce', array( 'woocommerce_ship_to_billing' => yit_woocommerce_default_shiptobilling(), 'load_gif' => yit_get_ajax_loader_gif_url(), 'version' => WC()->version, )); }