]> _ Git - physioassist-wordpress.git/commitdiff
wip #7330 @6:30
authorsoufiane <soufiane@cubedesigners.com>
Tue, 18 Feb 2025 17:28:00 +0000 (18:28 +0100)
committersoufiane <soufiane@cubedesigners.com>
Tue, 18 Feb 2025 17:28:00 +0000 (18:28 +0100)
wp-content/themes/physioassist/resources/assets/styles/common/app.styl
wp-content/themes/physioassist/resources/assets/styles/common/mixins.styl
wp-content/themes/physioassist/resources/views/woocommerce/cart/cart-shipping.blade.php [new file with mode: 0644]
wp-content/themes/physioassist/resources/views/woocommerce/cart/cart-totals.blade.php

index 5292b862fe29d5fce2541605e130e8cbf74e49ec..61e96b0836d4fa278b8533940de4a49a0234ce88 100644 (file)
@@ -81,7 +81,7 @@
         margin-top: -10px
 
     .qib-container
-      margin-bottom: 23px
+      margin-bottom: 15px
 
   form.cart
     display: flex
       padding: 8px
       display: flex
       align-items: center
+      background-color: #FFFFFF
       .quantity input.qty:not(#qib_id):not(#qib_id)
         border: 0
         font-size: 18px
       &:not(#qib_id):not(#qib_id)
         height: 39px
         width: 39px
-        background-color: #6CC3EE
+        background: #6CC3EE
         border-radius: 39px
         border: 0
 
   .wps_sfw_subscription_wrapper
     margin-top: 8px
     margin-bottom: 20px
-    label
-      font-size: 18px
-    input
-      margin-right: 11px
-      width: 18px
-      height: 18px
-      color: currentColor
-      border: 0.063em solid currentColor
+
+  // Radio button
+  input[type=radio]
+    margin-right: 11px
+    width: 18px
+    height: 18px
+    color: currentColor
+    border: 0.063em solid currentColor
+    border-radius: 50%
+    vertical-align: middle
+    appearance: none
+    display: inline-flex
+    align-items: center
+    justify-content: center
+    &::before
+      content: ""
+      width: 0.75em
+      height: 0.75em
       border-radius: 50%
-      vertical-align: middle
-      appearance: none
-      display: inline-flex
-      align-items: center
-      justify-content: center
-      &::before
-        content: ""
-        width: 0.75em
-        height: 0.75em
-        border-radius: 50%
-        transform: scale(0)
-        transition: 120ms transform ease-in-out
-        background-color: #93C7C2
-      &:checked::before
-        transform: scale(1)
-
-  form.cart button[type='submit']:not(#qib_id):not(#qib_id):not(_):not(_)
+      transform: scale(0)
+      transition: 120ms transform ease-in-out
+      background-color: #93C7C2
+    &:checked::before
+      transform: scale(1)
+
+  form.cart button[type='submit']:not(#qib_id):not(#qib_id):not(_):not(_),
+  .checkout-button
     width: 100%
     height: 55px
     font-size: 18px !important
-    text-transform: initial
-    font-weight: 500
-    background-color: #1B2943
+    text-transform: initial !important
+    font-weight: 600
+    background-color: #1B2943 !important
+
+  .checkout-button
+    padding: 1em 2em !important
 
   // Cart
   .frequency,
   .hide-on-desktop
     display: block !important
 
+  // Cart page
   body.panier,
   body.cart
     font-size: 18px
       align-items: center
       .label
         margin-right: auto
+
+    .order-total
+      display: flex
+      justify-content: space-between
+      .label,
+      [data-title=Total] strong .woocommerce-Price-amount
+        font-size: 22px
+      [data-title=Total]
+        text-align: right
+      .includes_tax
+        display: block
+
+  .woocommerce-shipping-totals .label
+    margin-bottom: 10px
+
+  .woocommerce-shipping-calculator
+    padding-bottom: 16px
+    border-bottom: 1px solid #E3E4E7
+    margin-bottom: 22px
+    .shipping-calculator-button
+      text-decoration: underline
+      font-size: 16px
+      color: #356DA8
+      &:after
+        display: none
+
+  // Global style
+  .woocommerce-cart
+    &-summary-card
+      border-radius: 15px
+      padding: 23px 16px
+      white-box(15px)
+      .label
+        font-weight: 600
+
+      &__title
+        font-size: 22px
+        font-weight: 600
+        margin-bottom: 14px
+
+      .cart-subtotal
+        display: flex
+        justify-content: space-between
+        border-bottom: 1px solid #E3E4E7
+        padding-bottom: 16px
+        margin-bottom: 23px
+        font-weight: $semibold
+
+  .woocommerce ul#shipping_method li
+    margin-bottom: 3px
+
+  .woocommerce-billing-fields__field-wrapper
+    .form-row
+      width: 100%
+
+    .input-text::placeholder
+      color: #8E94A1
+
+    .input-text:not(textarea)
+      white-box(28px)
+      &#order_comments
+        border-radius: 24px
+
+  .woocommerce form .form-row label
+    text-transform: initial
+    color: #1B2943
+
+  body.validation
+    font-size: 16px
index 911c83b7ee8f45bd4a533f342c7126a7b3213f9b..865789d885eb7bbb17a68ab9748334edb8516c87 100644 (file)
@@ -100,3 +100,10 @@ font-smoothing-reset()
   -moz-osx-font-smoothing: auto
 
 //---------------------------------------//
+
+white-box(r)
+  background-color: #fff
+  border: 1px solid #E3E4E7
+  border-radius: r
+  box-shadow: 0 3px 6px #ECF2F8
+  padding: 16px 24px
diff --git a/wp-content/themes/physioassist/resources/views/woocommerce/cart/cart-shipping.blade.php b/wp-content/themes/physioassist/resources/views/woocommerce/cart/cart-shipping.blade.php
new file mode 100644 (file)
index 0000000..7cde79d
--- /dev/null
@@ -0,0 +1,173 @@
+<?php
+/**
+ * Shipping Methods Display
+ *
+ * In 2.1 we show methods per package. This allows for multiple methods per order if so desired.
+ *
+ * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart-shipping.php.
+ *
+ * HOWEVER, on occasion WooCommerce will need to update template files and you
+ * (the theme developer) will need to copy the new files to your theme to
+ * maintain compatibility. We try to do this as little as possible, but it does
+ * happen. When this occurs the version of the template file will be bumped and
+ * the readme will list any important changes.
+ *
+ * @see https://woocommerce.com/document/template-structure/
+ * @package WooCommerce\Templates
+ * @version 8.8.0
+ */
+
+defined( 'ABSPATH' ) || exit;
+
+$formatted_destination    = isset( $formatted_destination ) ? $formatted_destination : WC()->countries->get_formatted_address( $package['destination'], ', ' );
+$has_calculated_shipping  = ! empty( $has_calculated_shipping );
+$show_shipping_calculator = ! empty( $show_shipping_calculator );
+$calculator_text          = '';
+$app = filter_input(INPUT_GET, 'app', FILTER_SANITIZE_STRING)
+?>
+
+<?php if($app){ ?>
+<div class="woocommerce-shipping-totals shipping">
+  <div class="label"><?php echo wp_kses_post( $package_name ); ?></div>
+  <div data-title="<?php echo esc_attr( $package_name ); ?>">
+      <?php if ( ! empty( $available_methods ) && is_array( $available_methods ) ) : ?>
+    <ul id="shipping_method" class="woocommerce-shipping-methods">
+        <?php foreach ( $available_methods as $method ) : ?>
+      <li>
+          <?php
+          if ( 1 < count( $available_methods ) ) {
+            printf( '<input type="radio" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" %4$s />', $index, esc_attr( sanitize_title( $method->id ) ), esc_attr( $method->id ), checked( $method->id, $chosen_method, false ) ); // WPCS: XSS ok.
+          } else {
+            printf( '<input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" />', $index, esc_attr( sanitize_title( $method->id ) ), esc_attr( $method->id ) ); // WPCS: XSS ok.
+          }
+          printf( '<label for="shipping_method_%1$s_%2$s">%3$s</label>', $index, esc_attr( sanitize_title( $method->id ) ), wc_cart_totals_shipping_method_label( $method ) ); // WPCS: XSS ok.
+          do_action( 'woocommerce_after_shipping_rate', $method, $index );
+          ?>
+      </li>
+      <?php endforeach; ?>
+    </ul>
+      <?php if ( is_cart() ) : ?>
+    <p class="woocommerce-shipping-destination">
+        <?php
+        if ( $formatted_destination ) {
+          // Translators: $s shipping destination.
+          printf( esc_html__( 'Shipping to %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' );
+          $calculator_text = esc_html__( 'Change address', 'woocommerce' );
+        } else {
+          echo wp_kses_post( apply_filters( 'woocommerce_shipping_estimate_html', __( 'Shipping options will be updated during checkout.', 'woocommerce' ) ) );
+        }
+        ?>
+    </p>
+    <?php endif; ?>
+    <?php
+    elseif ( ! $has_calculated_shipping || ! $formatted_destination ) :
+      if ( is_cart() && 'no' === get_option( 'woocommerce_enable_shipping_calc' ) ) {
+        echo wp_kses_post( apply_filters( 'woocommerce_shipping_not_enabled_on_cart_html', __( 'Shipping costs are calculated during checkout.', 'woocommerce' ) ) );
+      } else {
+        echo wp_kses_post( apply_filters( 'woocommerce_shipping_may_be_available_html', __( 'Enter your address to view shipping options.', 'woocommerce' ) ) );
+      }
+    elseif ( ! is_cart() ) :
+      echo wp_kses_post( apply_filters( 'woocommerce_no_shipping_available_html', __( 'There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) );
+    else :
+      echo wp_kses_post(
+      /**
+       * Provides a means of overriding the default 'no shipping available' HTML string.
+       *
+       * @since 3.0.0
+       *
+       * @param string $html                  HTML message.
+       * @param string $formatted_destination The formatted shipping destination.
+       */
+        apply_filters(
+          'woocommerce_cart_no_shipping_available_html',
+          // Translators: $s shipping destination.
+          sprintf( esc_html__( 'No shipping options were found for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' ),
+          $formatted_destination
+        )
+      );
+      $calculator_text = esc_html__( 'Enter a different address', 'woocommerce' );
+    endif;
+      ?>
+
+      <?php if ( $show_package_details ) : ?>
+      <?php echo '<p class="woocommerce-shipping-contents"><small>' . esc_html( $package_details ) . '</small></p>'; ?>
+    <?php endif; ?>
+
+      <?php if ( $show_shipping_calculator ) : ?>
+      <?php woocommerce_shipping_calculator( $calculator_text ); ?>
+    <?php endif; ?>
+  </div>
+</div>
+<?php }else{ ?>
+<tr class="woocommerce-shipping-totals shipping">
+  <th><?php echo wp_kses_post( $package_name ); ?></th>
+  <td data-title="<?php echo esc_attr( $package_name ); ?>">
+    <?php if ( ! empty( $available_methods ) && is_array( $available_methods ) ) : ?>
+    <ul id="shipping_method" class="woocommerce-shipping-methods">
+        <?php foreach ( $available_methods as $method ) : ?>
+      <li>
+          <?php
+          if ( 1 < count( $available_methods ) ) {
+            printf( '<input type="radio" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" %4$s />', $index, esc_attr( sanitize_title( $method->id ) ), esc_attr( $method->id ), checked( $method->id, $chosen_method, false ) ); // WPCS: XSS ok.
+          } else {
+            printf( '<input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d_%2$s" value="%3$s" class="shipping_method" />', $index, esc_attr( sanitize_title( $method->id ) ), esc_attr( $method->id ) ); // WPCS: XSS ok.
+          }
+          printf( '<label for="shipping_method_%1$s_%2$s">%3$s</label>', $index, esc_attr( sanitize_title( $method->id ) ), wc_cart_totals_shipping_method_label( $method ) ); // WPCS: XSS ok.
+          do_action( 'woocommerce_after_shipping_rate', $method, $index );
+          ?>
+      </li>
+      <?php endforeach; ?>
+    </ul>
+      <?php if ( is_cart() ) : ?>
+    <p class="woocommerce-shipping-destination">
+        <?php
+        if ( $formatted_destination ) {
+          // Translators: $s shipping destination.
+          printf( esc_html__( 'Shipping to %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' );
+          $calculator_text = esc_html__( 'Change address', 'woocommerce' );
+        } else {
+          echo wp_kses_post( apply_filters( 'woocommerce_shipping_estimate_html', __( 'Shipping options will be updated during checkout.', 'woocommerce' ) ) );
+        }
+        ?>
+    </p>
+    <?php endif; ?>
+    <?php
+    elseif ( ! $has_calculated_shipping || ! $formatted_destination ) :
+      if ( is_cart() && 'no' === get_option( 'woocommerce_enable_shipping_calc' ) ) {
+        echo wp_kses_post( apply_filters( 'woocommerce_shipping_not_enabled_on_cart_html', __( 'Shipping costs are calculated during checkout.', 'woocommerce' ) ) );
+      } else {
+        echo wp_kses_post( apply_filters( 'woocommerce_shipping_may_be_available_html', __( 'Enter your address to view shipping options.', 'woocommerce' ) ) );
+      }
+    elseif ( ! is_cart() ) :
+      echo wp_kses_post( apply_filters( 'woocommerce_no_shipping_available_html', __( 'There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.', 'woocommerce' ) ) );
+    else :
+      echo wp_kses_post(
+      /**
+       * Provides a means of overriding the default 'no shipping available' HTML string.
+       *
+       * @since 3.0.0
+       *
+       * @param string $html                  HTML message.
+       * @param string $formatted_destination The formatted shipping destination.
+       */
+        apply_filters(
+          'woocommerce_cart_no_shipping_available_html',
+          // Translators: $s shipping destination.
+          sprintf( esc_html__( 'No shipping options were found for %s.', 'woocommerce' ) . ' ', '<strong>' . esc_html( $formatted_destination ) . '</strong>' ),
+          $formatted_destination
+        )
+      );
+      $calculator_text = esc_html__( 'Enter a different address', 'woocommerce' );
+    endif;
+    ?>
+
+    <?php if ( $show_package_details ) : ?>
+      <?php echo '<p class="woocommerce-shipping-contents"><small>' . esc_html( $package_details ) . '</small></p>'; ?>
+    <?php endif; ?>
+
+    <?php if ( $show_shipping_calculator ) : ?>
+      <?php woocommerce_shipping_calculator( $calculator_text ); ?>
+    <?php endif; ?>
+  </td>
+</tr>
+<?php } ?>
index f9c26059a0fa2c0930d18e7bff9333f4881df386..9c224213940441cdc57d3bdf47bde97aacd8d420 100644 (file)
@@ -22,48 +22,44 @@ defined( 'ABSPATH' ) || exit;
 
   <?php do_action( 'woocommerce_before_cart_totals' ); ?>
 
-  <h2><?php esc_html_e( 'Cart totals', 'woocommerce' ); ?></h2>
+  <h2 class="woocommerce-cart-summary-card__title"><?php esc_html_e( 'Cart totals', 'woocommerce' ); ?></h2>
   @php($app = filter_input(INPUT_GET, 'app', FILTER_SANITIZE_STRING))
-  <?php if($app == true) { ?>
+  <?php if($app == "true") { ?>
 
-  <div class="">
+  <div class="woocommerce-cart-summary-card">
     <div class="cart-subtotal">
-      <div><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></div>
+      <div class="label"><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></div>
       <div data-title="<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>"><?php wc_cart_totals_subtotal_html(); ?></div>
     </div>
 
-      <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
-    <div class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
-      <div><?php wc_cart_totals_coupon_label( $coupon ); ?></div>
-      <div data-title="<?php echo esc_attr( wc_cart_totals_coupon_label( $coupon, false ) ); ?>"><?php wc_cart_totals_coupon_html( $coupon ); ?></div>
-    </div>
+    <?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
+      <div class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
+        <div class="label"><?php wc_cart_totals_coupon_label( $coupon ); ?></div>
+        <div data-title="<?php echo esc_attr( wc_cart_totals_coupon_label( $coupon, false ) ); ?>"><?php wc_cart_totals_coupon_html( $coupon ); ?></div>
+      </div>
     <?php endforeach; ?>
 
-      <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
-
+    <?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
       <?php do_action( 'woocommerce_cart_totals_before_shipping' ); ?>
-
       <?php wc_cart_totals_shipping_html(); ?>
-
       <?php do_action( 'woocommerce_cart_totals_after_shipping' ); ?>
-
     <?php elseif ( WC()->cart->needs_shipping() && 'yes' === get_option( 'woocommerce_enable_shipping_calc' ) ) : ?>
 
-    <div class="shipping">
-      <div><?php esc_html_e( 'Shipping', 'woocommerce' ); ?></div>
-      <div data-title="<?php esc_attr_e( 'Shipping', 'woocommerce' ); ?>"><?php woocommerce_shipping_calculator(); ?></div>
-    </div>
+      <div class="shipping">
+        <div class="label"><?php esc_html_e( 'Shipping', 'woocommerce' ); ?></div>
+        <div data-title="<?php esc_attr_e( 'Shipping', 'woocommerce' ); ?>"><?php woocommerce_shipping_calculator(); ?></div>
+      </div>
 
     <?php endif; ?>
 
-      <?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
-    <div class="fee">
-      <div><?php echo esc_html( $fee->name ); ?></div>
-      <div data-title="<?php echo esc_attr( $fee->name ); ?>"><?php wc_cart_totals_fee_html( $fee ); ?></div>
-    </div>
+    <?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
+      <div class="fee">
+        <div><?php echo esc_html( $fee->name ); ?></div>
+        <div data-title="<?php echo esc_attr( $fee->name ); ?>"><?php wc_cart_totals_fee_html( $fee ); ?></div>
+      </div>
     <?php endforeach; ?>
 
-      <?php
+    <?php
     if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) {
       $taxable_address = WC()->customer->get_taxable_address();
       $estimated_text  = '';
@@ -96,7 +92,7 @@ defined( 'ABSPATH' ) || exit;
       <?php do_action( 'woocommerce_cart_totals_before_order_total' ); ?>
 
       <div class="order-total">
-        <div><?php esc_html_e( 'Total', 'woocommerce' ); ?></div>
+        <div class="label"><?php esc_html_e( 'Total', 'woocommerce' ); ?></div>
         <div data-title="<?php esc_attr_e( 'Total', 'woocommerce' ); ?>"><?php wc_cart_totals_order_total_html(); ?></div>
       </div>