]> _ Git - physioassist-wordpress.git/commitdiff
wait #7330 @4:00
authorsoufiane <soufiane@cubedesigners.com>
Tue, 25 Feb 2025 15:10:35 +0000 (16:10 +0100)
committersoufiane <soufiane@cubedesigners.com>
Tue, 25 Feb 2025 15:10:35 +0000 (16:10 +0100)
wp-content/themes/physioassist/resources/assets/scripts/routes/common.js
wp-content/themes/physioassist/resources/assets/styles/common/app.styl
wp-content/themes/physioassist/resources/views/woocommerce/checkout/payment.blade.php

index a2475c221f03e862625585d180145d5e09cce50f..f84b270f6ca622bfa9debd30f0cd551dc0316641 100644 (file)
@@ -72,6 +72,40 @@ export default {
       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
index 40fa11d72e38b1e4592a586e67d962f4b2d3bb2e..0708d82be8542368dfcdb4c26b529ca6e60fe41f 100644 (file)
@@ -5,6 +5,9 @@
     color: #1B2943
     line-height: normal
 
+  strong
+    font-weight: $semibold
+
   .content-inner
     horizontal-spacing(16px)
     padding-top: 0
       border-bottom: 1px solid rgba(#8E94A1,.5)
     .place-order
       padding: 0 !important
-      margin: 0
+      margin: 0 !important
 
   .woocommerce-checkout-payment-button
     margin-top: 16px
         max-width: 188px
         font-weight: 600
         margin-bottom: 8px
-      .quantity, small
+      .quantity
         font-size: 16px
+      small
+        font-size: inherit
       .order-total
         font-size: 22px
       h4,ul:not(.woocommerce-shipping-methods)
index b70e552c653058a3a1d1aaea4676f0e782db63c6..3c31c5722e5fff24f3904fabdbf498c4f736b56d 100644 (file)
@@ -16,8 +16,8 @@
  */
 
 defined( 'ABSPATH' ) || exit;
-
 if ( ! wp_doing_ajax() ) {
+  $app = filter_input(INPUT_GET, 'app', FILTER_SANITIZE_STRING);
   do_action( 'woocommerce_review_order_before_payment' );
 }
 ?>
@@ -50,9 +50,19 @@ if ( ! wp_doing_ajax() ) {
     <?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' ); ?>
@@ -61,9 +71,9 @@ if ( ! wp_doing_ajax() ) {
   </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' );
 }
+