]> _ Git - pmi.git/commitdiff
wip #6121 @1:00
authorsoufiane <soufiane@cubedesigners.com>
Tue, 11 Jul 2023 09:53:50 +0000 (11:53 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 11 Jul 2023 09:53:50 +0000 (11:53 +0200)
app/Events/OrderOperation.php [new file with mode: 0644]
app/Events/OrderSaved.php [deleted file]
app/Http/Controllers/AjaxController.php
app/Models/Order.php
resources/styles/components/products.styl
resources/views/partials/product-link.blade.php

diff --git a/app/Events/OrderOperation.php b/app/Events/OrderOperation.php
new file mode 100644 (file)
index 0000000..beb17d7
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Events;
+
+use Illuminate\Queue\SerializesModels;
+use App\Models\Order;
+use App\Models\Client;
+
+class OrderOperation
+{
+    use SerializesModels;
+    public function __construct(Order $order)
+    {
+        $clientById = Client::find($order->user_id);
+        $company = $clientById->company;
+        $addresses = $clientById->address;
+
+        $newUserId = $order->getAttribute('user_id');
+        $originalUserID = $order->getOriginal('user_id');
+
+        if($newUserId != $originalUserID)
+            $order->addresses = $addresses;
+
+        $order->company = $company;
+    }
+}
diff --git a/app/Events/OrderSaved.php b/app/Events/OrderSaved.php
deleted file mode 100644 (file)
index a377159..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-namespace App\Events;
-
-use Illuminate\Queue\SerializesModels;
-use App\Models\Order;
-use App\Models\Client;
-
-class OrderSaved
-{
-    use SerializesModels;
-    public function __construct(Order $order)
-    {
-        $clientById = Client::find($order->user_id);
-        $company = $clientById->company;
-        $addresses = $clientById->address;
-
-        $newUserId = $order->getAttribute('user_id');
-        $originalUserID = $order->getOriginal('user_id');
-
-        if($newUserId != $originalUserID)
-            $order->addresses = $addresses;
-
-        $order->company = $company;
-    }
-}
index c4835856c50776b0e37e8670054dacda2c1b0784..6c1c7e7601db4bfcd75a63ad704d56da5e2eb91c 100644 (file)
@@ -402,7 +402,7 @@ class AjaxController extends CubistFrontController
 
         /**
          *
-         * The following block of code format address data with good format of database [{'...','...'}]
+         * The following block of code format address data with good format in database [{'...','...'}]
          * to make it same in the database, readable and editable later in front
          *
          */
index dfd156dae867fc6ac1302764c083721cf1f6d369..28dee92300c7a4af7db602f807c4e611f3c3dd32 100644 (file)
@@ -1,8 +1,7 @@
 <?php
 namespace App\Models;
 
-use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
-use App\Events\OrderSaved;
+use App\Events\OrderOperation;
 
 class Order extends ECommerceCommon
 {
@@ -24,7 +23,7 @@ class Order extends ECommerceCommon
     protected $_optionsForUserInfo = [];
 
     protected $dispatchesEvents = [
-        'saving' => OrderSaved::class
+        'saving' => OrderOperation::class
     ];
 
     public function setFields()
index bb16191d4d1e8f2fbf33143e7e11a666d4befa60..b18c90d759482d77cb787d7d4b71a4b2941a7196 100644 (file)
@@ -4,7 +4,7 @@
 
   &-grid
     &-switch
-      +below(960px)
+      +below(1200px)
         display: none;
 
       margin-left: 1rem;
 
       // On the smaller screens, 270px min-width is sometimes too wide
       // when including the content padding so reduce it when getting close.
-      +below(960px)
+      +below(1200px)
         grid-template-columns: repeat(auto-fill, minmax(225px, 1fr))
 
       &.products-grid-aslist
-        +above(960px)
+        +above(1200px)
           grid-gap 20px
           grid-template-columns: repeat(auto-fill, minmax(100%, 1fr))
 
@@ -94,7 +94,7 @@
                 white-space nowrap
                 height auto
                 overflow hidden
-                width: calc(100% - 300px)
+                width: calc(100% - 100px)
                 text-overflow ellipsis
 
               .links
               h3
                 margin-bottom: 0.25em;
 
+            .product-container
+              display: flex
+
+            .product-description-container
+              width: 40%
+
+            .product-price-info p
+              margin: 0 !important
+        +above(1400px)
+          .product-description-container
+            width: 50% !important
+
     .btn
       width 100%;
       padding-top 0.7rem
index 8e522b55cfe262d502e3684325fa31133485e9ce..a58550d31d241aadc4f95dd5262f06990bf1591e 100644 (file)
     There shoulln't be any space between closing of a and opening of div
     {{-- Product details --}}
     --><div class="product-content p-4 text-navy">
-        <h3><a class="text-navy" href="{{ $product->getEntity()->URL }}">{{ $product->get('reference') }}</a>
-        </h3>
-        <div class="product-highlights text-sm">
-            {{$product->get('name')}}
-        </div>
-        <div class="product-price-info">
-            @if($product->basic_selling_price && $product->json)
-                @php($options = true)
-                <p class="no-m text-sm mt-5">{{ __('Produit configurable') }}</p>
-                <p>{{ __('A partir de :').' '. $price }}€ HT</p>
-            @elseif($product->basic_selling_price && !$product->json)
-                <p class="no-m line-through text-sm mt-5">{{ __('Prix catalogue :').' '.$product->basic_selling_price }}€ HT</p>
-                <p>{{ __('Votre prix :').' '. $price }}€ HT</p>
-            @endif
+        <div class="product-container">
+            <div class="product-description-container">
+                <h3><a class="text-navy" href="{{ $product->getEntity()->URL }}">{{ $product->get('reference') }}</a>
+                </h3>
+                <div class="product-highlights text-sm">
+                    {{$product->get('name')}}
+                </div>
+            </div>
+            <div class="product-price-info">
+                @if($product->basic_selling_price && $product->json)
+                    @php($options = true)
+                    <p class="no-m text-sm mt-5">{{ __('Produit configurable') }}</p>
+                    <p>{{ __('A partir de :').' '. $price }}€ HT</p>
+                @elseif($product->basic_selling_price && !$product->json)
+                    <p class="no-m line-through text-sm mt-5">{{ __('Prix catalogue :').' '.$product->basic_selling_price }}€ HT</p>
+                    <p>{{ __('Votre prix :').' '. $price }}€ HT</p>
+                @endif
+            </div>
         </div>
         @if(config('features.quote'))
             <cart-add :id="$product->id" :reference="$product->reference" :link="$product->getEntity()->URL" :price="$price" :options="$options" :hasprice="$product->basic_selling_price" template="miniature"></cart-add>