const isApp = window.location.search.substring(1).split("&").includes("app=true")
if(isApp) $("button[name=update_cart]").trigger("click")
})
+
+ //
+ function addParam(url) {
+ if(url.indexOf('?') > -1) {
+ url += "&app=true"
+ }else{
+ url += "?app=true"
+ }
+ return url
+ }
+
+ if($("html").attr('data-app') === "on") {
+ let attr = null
+ $("a:not([role=tab]),form").each(function(){
+ if($(this).prop("tagName").toLowerCase() === 'a') {
+ attr = "href"
+ }else if($(this).prop("tagName").toLowerCase() === 'form') {
+ attr = "action"
+ }
+ let newUrl = addParam($(this).attr(attr))
+ $(this).attr(attr, newUrl)
+ })
+
+ $("[for=billing_address_2],[for=shipping_address_2]").removeClass("screen-reader-text")
+
+ if($(".tax_label")){
+ if($(".tax_label").length > 0){
+ $(".tax_label").each(function(){
+ let newText = $(this).text().replace(/[()]/g,"")
+ $(this).text(newText)
+ })
+ }
+ }
+ }
},
finalize() {
// JavaScript to be fired on all pages, after page specific JS is fired
*/
defined( 'ABSPATH' ) || exit;
-
if ( ! wp_doing_ajax() ) {
+ $app = filter_input(INPUT_GET, 'app', FILTER_SANITIZE_STRING);
do_action( 'woocommerce_review_order_before_payment' );
}
?>
<?php wc_get_template( 'checkout/terms.php' ); ?>
<?php do_action( 'woocommerce_review_order_before_submit' ); ?>
+ <div class="hide-on-mobileapp">
+ <?php
+ $order_button_text = esc_html("Commander");
+ ?>
+ <?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button alt' . esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ) . '" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
+
+ <?php do_action( 'woocommerce_review_order_after_submit' ); ?>
+
+ <?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
+ </div>
</div>
</div>
- <div class="woocommerce-checkout-payment-button">
+ <div class="woocommerce-checkout-payment-button hide-on-desktop">
<?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button alt' . esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : '' ) . '" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
<?php do_action( 'woocommerce_review_order_after_submit' ); ?>
</div>
</div>
<?php
-if ( ! wp_doing_ajax() ) {
- $app = filter_input(INPUT_GET, 'app', FILTER_SANITIZE_STRING); ?>
+if ( ! wp_doing_ajax() ) { ?>
<input type="hidden" name="_app" value="<?php echo esc_attr($app) ?>">
<?php
do_action( 'woocommerce_review_order_after_payment' );
}
+