From b5f1f92cc26c72a96e6425d1f397dc7ed3328787 Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 24 Feb 2025 18:38:48 +0100 Subject: [PATCH] wait #7353 @4:30 --- .../resources/assets/styles/common/app.styl | 13 +++++---- .../physioassist/resources/functions.php | 27 +++++++++++++++++++ .../resources/views/layouts/app.blade.php | 5 +++- .../woocommerce/cart/cart-totals.blade.php | 6 ++--- .../views/woocommerce/cart/cart.blade.php | 2 +- .../woocommerce/checkout/payment.blade.php | 3 +++ .../single-product/title.blade.php | 22 +++++++++++++++ 7 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 wp-content/themes/physioassist/resources/views/woocommerce/single-product/title.blade.php diff --git a/wp-content/themes/physioassist/resources/assets/styles/common/app.styl b/wp-content/themes/physioassist/resources/assets/styles/common/app.styl index 0be6a4fd..40fa11d7 100644 --- a/wp-content/themes/physioassist/resources/assets/styles/common/app.styl +++ b/wp-content/themes/physioassist/resources/assets/styles/common/app.styl @@ -250,11 +250,14 @@ padding-bottom: 24px margin-bottom: 24px border-bottom: 1px solid #E3E4E7 - &-form .product-thumbnail - width: 60px - flex-shrink: 0 - img - border-radius: 5px + &-form + .product-thumbnail + width: 60px + flex-shrink: 0 + img + border-radius: 5px + &__cart-item + width: 100% .product-name line-height: normal diff --git a/wp-content/themes/physioassist/resources/functions.php b/wp-content/themes/physioassist/resources/functions.php index 68d0d4e4..224028dc 100644 --- a/wp-content/themes/physioassist/resources/functions.php +++ b/wp-content/themes/physioassist/resources/functions.php @@ -187,3 +187,30 @@ add_action( 'woocommerce_update_cart_action_cart_updated', function($cart_update } return true; }); + +add_filter('wc_get_template', function($template, $template_name, $args, $template_path, $default_path) { + if ($template_name === 'checkout/payment.php') { + $custom_template = get_stylesheet_directory() . '/woocommerce/checkout/payment.blade.php'; + if (file_exists($custom_template)) { + return $custom_template; + } + } + return $template; +}, 10, 5); + +add_action('woocommerce_before_add_to_cart_quantity', function(){ + echo "

Quantité

"; +}); + +add_filter('woocommerce_add_to_cart_redirect', function() { + $app = filter_input(INPUT_GET, 'app', FILTER_SANITIZE_STRING); + if ($app == "true") { + return wc_get_cart_url()."?app=true"; + } + return wc_get_cart_url(); +}); + +add_filter('woocommerce_get_return_url', function($return_url, $order) { + $app = filter_input(INPUT_POST, '_app', FILTER_SANITIZE_STRING); + return add_query_arg('app', $app, $return_url); +}, 10, 2); diff --git a/wp-content/themes/physioassist/resources/views/layouts/app.blade.php b/wp-content/themes/physioassist/resources/views/layouts/app.blade.php index 1134f819..083a1c4c 100644 --- a/wp-content/themes/physioassist/resources/views/layouts/app.blade.php +++ b/wp-content/themes/physioassist/resources/views/layouts/app.blade.php @@ -3,7 +3,7 @@ @include('partials.head') {{-- When not using the hero image header template the compact header is set --}} - +