]> _ Git - pmi.git/commitdiff
wait #6144 @0:15
authorsoufiane <soufiane@cubedesigners.com>
Wed, 19 Jul 2023 09:34:33 +0000 (11:34 +0200)
committersoufiane <soufiane@cubedesigners.com>
Wed, 19 Jul 2023 09:34:33 +0000 (11:34 +0200)
resources/js/app.js
resources/views/components/item-cart.blade.php

index b57ac7fd7545ae57a89d7683e5b4d38d13dd3282..89651ab7423415ab276b5995f7b418c15af4247e 100644 (file)
@@ -557,13 +557,15 @@ const app = new Vue({
                 })
         },
         savedCartToCurrent(event) {
-            const   id = event.target.dataset.id,
-                    homeUrl = window.location.origin;
+            const id = event.target.dataset.id;
+
+            let homeUrl = window.location.origin+'/';
+            homeUrl += event.target.dataset.to ?? 'ma-selection'
 
             axios.post('/ajax/savedCartToCurrent', {id: id})
                 .then(function (response) {
                     //root.animateDelete(el)
-                    window.location.replace(homeUrl+'/ma-selection')
+                    window.location.replace(homeUrl)
                 })
                 .catch(function (error) {
                 })
index 8c65fb03649ccf0be704c298ceb0f119c19a67e0..42e106da595975db3db9ea463f21613c8da6cca9 100644 (file)
@@ -74,7 +74,7 @@
                         {{ __('Modifier ce panier') }}
                     </a>
                     @isset($item['total'])
-                        <a href="#" class="btn" data-id="{{ $item['id'] }}" @click.self.prevent="savedCartToCurrent">{{ __('Passer commande') }}</a>
+                        <a href="#" class="btn" data-to="ma-commande" data-id="{{ $item['id'] }}" @click.self.prevent="savedCartToCurrent">{{ __('Passer commande') }}</a>
                     @else
                         <a href="" class="btn" data-id="{{ $item['id'] }}" @click.self.prevent="savedCartToCurrent">{{ __('Demander un devis') }}</a>
                     @endisset