--- /dev/null
+<?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;
+ }
+}
+++ /dev/null
-<?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;
- }
-}
/**
*
- * 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
*
*/
<?php
namespace App\Models;
-use Cubist\Backpack\app\Magic\Controllers\CubistMagicController;
-use App\Events\OrderSaved;
+use App\Events\OrderOperation;
class Order extends ECommerceCommon
{
protected $_optionsForUserInfo = [];
protected $dispatchesEvents = [
- 'saving' => OrderSaved::class
+ 'saving' => OrderOperation::class
];
public function setFields()
&-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))
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
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>