Promotion Frontend dynamic

This commit is contained in:
Kevin Adametz 2021-11-26 18:23:10 +01:00
parent c9e1545693
commit 1cc8e025a1
29 changed files with 551 additions and 163 deletions

View file

@ -91,7 +91,6 @@ class PromotionController extends Controller
public function load(){ public function load(){
$data = Request::all(); $data = Request::all();
if(Request::ajax()) { if(Request::ajax()) {
if(isset($data['action']) && $data['action'] === 'validate_url'){ if(isset($data['action']) && $data['action'] === 'validate_url'){
$rules = array( $rules = array(

View file

@ -9,6 +9,7 @@ use App\Services\Util;
use App\Models\Product; use App\Models\Product;
use App\Models\PaymentMethod; use App\Models\PaymentMethod;
use App\Models\PromotionUser; use App\Models\PromotionUser;
use App\Services\PromotionCart;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
@ -31,16 +32,16 @@ class PromotionController extends Controller
if(!$PromotionUser){ if(!$PromotionUser){
abort(402); abort(402);
} }
if($PromotionUser->checkOutOfStock()){ if(!$PromotionUser->promotion_admin->isActive() || $PromotionUser->checkOutOfStock()){
$data = [ $data = [
'promotion_user' => $PromotionUser, 'promotion_user' => $PromotionUser,
]; ];
return view('web.promotion.outofstock', $data); return view('web.promotion.outofstock', $data);
} }
PromotionCart::initYard();
$data = [ $data = [
'promotion_user' => $PromotionUser, 'promotion_user' => $PromotionUser,
'shop_products' => Product::where('active', true)->whereJsonContains('show_on', ['1', '2', '3'])->orderBy('pos', 'ASC')->get(), 'shop_products' => Product::where('active', true)->whereJsonContains('show_on', ['3'])->orderBy('pos', 'ASC')->get(),
'user_payment_methods' => PaymentMethod::getDefaultAsArray()->toArray(), 'user_payment_methods' => PaymentMethod::getDefaultAsArray()->toArray(),
]; ];
return view('web.promotion.index', $data); return view('web.promotion.index', $data);
@ -93,6 +94,32 @@ class PromotionController extends Controller
$product = Product::find($data['id']); //current user form order $product = Product::find($data['id']); //current user form order
$ret = view("web.promotion.show_product", compact('product', 'data'))->render(); $ret = view("web.promotion.show_product", compact('product', 'data'))->render();
} }
if($data['action'] === 'switch-free-product'){
\App\Services\PromotionCart::updateFeeProduct($data);
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
}
if($data['action'] === 'add-shop-product'){
$data['qty'] = \App\Services\PromotionCart::updateProduct($data, true);
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
}
if($data['action'] === 'update-shop-product'){
$data['qty'] = \App\Services\PromotionCart::updateProduct($data);
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
}
if($data['action'] === 'remove-shop-product'){
\App\Services\PromotionCart::updateProduct($data);
$data['qty'] = 0;
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
}
if($data['action'] === 'clear-cart'){
\App\Services\PromotionCart::clearCart($data);
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
}
if($data['action'] === 'switch-shipping'){
$ret = view("web.promotion._promotion_cart", compact('data'))->render();
}
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]); return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
} }
} }

View file

@ -296,7 +296,13 @@ class Product extends Model
return $this->hasMany(ProductIngredient::class, 'product_ingredients', 'id'); return $this->hasMany(ProductIngredient::class, 'product_ingredients', 'id');
} }
public function getShortCopy($clean = false, $len = false){
$ret = $this->short_copy ? $this->short_copy : $this->description;
if($len && $clean){
return substr_ellipsis($ret, $len, $clean);
}
return $ret;
}
public function getActionName($id = 0){ public function getActionName($id = 0){
if(isset($this->actions[$id])){ if(isset($this->actions[$id])){
return $this->actions[$id]; return $this->actions[$id];

View file

@ -125,6 +125,19 @@ class PromotionAdmin extends Model
} }
} }
public function isActive(){
if($this->active){
if($this->from && Carbon::parse($this->from)->gt(Carbon::now()->startOfDay())){
return false;
}
if($this->to && Carbon::parse($this->to)->lt(Carbon::now()->startOfDay())){
return false;
}
return true;
}
return false;
}
public function getFromAttribute($value) public function getFromAttribute($value)
{ {
if(!$value){ return ""; } if(!$value){ return ""; }

View file

@ -78,4 +78,8 @@ class Shipping extends Model
public function shipping_prices(){ public function shipping_prices(){
return $this->hasMany('App\Models\ShippingPrice', 'shipping_id', 'id'); return $this->hasMany('App\Models\ShippingPrice', 'shipping_id', 'id');
} }
public function getShippingPricesBy($shipping_for){
return $this->hasMany('App\Models\ShippingPrice', 'shipping_id', 'id')->where('shipping_for', $shipping_for);
}
} }

View file

@ -30,7 +30,6 @@ class ShippingCountry extends Model
{ {
protected $table = 'shipping_countries'; protected $table = 'shipping_countries';
protected $fillable = [ protected $fillable = [
'shipping_id', 'country_id' 'shipping_id', 'country_id'
]; ];

View file

@ -47,7 +47,12 @@ class ShippingPrice extends Model
protected $table = 'shipping_prices'; protected $table = 'shipping_prices';
protected $fillable = [ protected $fillable = [
'shipping_id', 'price', 'price_comp', 'num_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to', 'shipping_id', 'price', 'price_comp', 'num_comp', 'tax_rate', 'factor', 'total_from', 'total_to', 'weight_from', 'weight_to', 'shipping_for',
];
public static $shippingForTypes = [
1 => 'Berater Bestellungen',
2 => 'Shop Bestellungen',
]; ];
public function shipping() public function shipping()
@ -55,6 +60,9 @@ class ShippingPrice extends Model
return $this->belongsTo('App\Models\Shipping', 'shipping_id'); return $this->belongsTo('App\Models\Shipping', 'shipping_id');
} }
public function getShippingForType(){
return isset(self::$shippingForTypes[$this->shipping_for]) ? self::$shippingForTypes[$this->shipping_for] : "";
}
public function setPriceAttribute($value) public function setPriceAttribute($value)
{ {

View file

@ -0,0 +1,105 @@
<?php
namespace App\Services;
use Yard;
use App\Models\Product;
use App\Models\ShippingCountry;
class PromotionCart
{
public static $points = 0;
public static $price = 0;
public static $price_net = 0;
public static $ek_price = 0;
public static $income_price = 0;
public static function initYard(){
$id = 1;
if($ShippingCountry = ShippingCountry::all()->first()){
$id = $ShippingCountry->id;
}
Yard::instance('shopping')->setShippingCountryWithPrice($id, 'shop');
}
public static function getLowestShippingPrice($shipping_for = 2)
{
if($ShippingCountry = ShippingCountry::all()->first()){
if($ShippingCountry->shipping){
if($ShippingPrices = $ShippingCountry->shipping->getShippingPricesBy($shipping_for)->orderBy('price', 'ASC')->first()){
return formatNumber($ShippingPrices->price);
}
}
}
}
public static function clearCart($data, $add=false)
{
Yard::instance('shopping')->destroy();
}
public static function updateProduct($data, $add=false)
{
if($product = Product::find($data['product_id'])){
$image = "";
if($product->images->count()){
$image = $product->images->first()->slug;
}
//get the card item
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, $product->price, $product->tax,
[
'image' => $image,
'slug' => $product->slug,
'weight' => $product->weight,
]);
Yard::setTax($cartItem->rowId, $product->tax);
if(!$add){
if(isset($data['qty']) && $data['qty'] > 0){
Yard::instance('shopping')->update($cartItem->rowId, $data['qty']);
}else{
//if 0 get the item by qty:1 and remove it
Yard::instance('shopping')->remove($cartItem->rowId);
}
}
Yard::instance('shopping')->reCalculate();
return $cartItem->qty;
}
}
public static function updateFeeProduct($data)
{
foreach (Yard::instance('shopping')->content() as $row) {
//wenn kleiner wurde ein produkt entfernt aufgrund der Anzahl
//wenn gleich löschen, da neue Versandkosten
if($row->options->free_product) {
Yard::instance('shopping')->remove($row->rowId);
}
}
if(isset($data['free_poduct_id'])) {
if ($product = Product::find($data['free_poduct_id'])) {
$image = "";
if ($product->images->count()) {
$image = $product->images->first()->slug;
}
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, 0, 0,
[
'image' => $image,
'slug' => $product->slug,
'weight' => 0,
'free_product' => 1,
'product_id' => $product->id
]);
Yard::setTax($cartItem->rowId, 0);
}
}
}
}

View file

@ -323,27 +323,37 @@ class Yard extends Cart
return; return;
} }
$shipping = $shippingCountry->shipping; $shipping = $shippingCountry->shipping;
$shipping_price_for = 1;
if($this->shipping_is_for === 'me' || $this->shipping_is_for === 'ot'){
$shipping_price_for = 1;
}
if($this->shipping_is_for === 'shop'){
$shipping_price_for = 2;
}
if($this->weight() == 0){ if($this->weight() == 0){
$shipping_price = $shipping->shipping_prices->first(); $shipping_price = $shipping->getShippingPricesBy($shipping_price_for)->first();
if(!$shipping_price){
$shipping_price = new \App\Models\ShippingPrice();
}
$shipping_price->price = 0; $shipping_price->price = 0;
$shipping_price->price_comp = 0; $shipping_price->price_comp = 0;
}else{ }else{
//first by price //first by price
$shipping_price = $this->shippingPriceBySubTotal($shipping->shipping_prices, $this->subtotal(2, '.', '')); $shipping_price = $this->shippingPriceBySubTotal($shipping->getShippingPricesBy($shipping_price_for), $this->subtotal(2, '.', ''));
//sec by weight //sec by weight
if(!$shipping_price){ if(!$shipping_price){
$shipping_price = $this->shippingPriceByWeight($shipping->shipping_prices, $this->weight()); $shipping_price = $this->shippingPriceByWeight($shipping->getShippingPricesBy($shipping_price_for), $this->weight());
} }
//default //default
if(!$shipping_price){ if(!$shipping_price){
$shipping_price = $shipping->shipping_prices->first(); $shipping_price = $shipping->getShippingPricesBy($shipping_price_for)->first();
} }
} }
if($shipping_price){ if($shipping_price){
$price = $shipping_price->price; $price = $shipping_price->price;
$this->num_comp = 0; $this->num_comp = 0;
if($this->weight() > 0){
if($this->shipping_is_for === 'me' && \App\Models\Setting::getContentBySlug('order_partner_is_comp_me')){ if($this->shipping_is_for === 'me' && \App\Models\Setting::getContentBySlug('order_partner_is_comp_me')){
$price = $shipping_price->price_comp; $price = $shipping_price->price_comp;
$this->num_comp = $shipping_price->num_comp; $this->num_comp = $shipping_price->num_comp;
@ -352,7 +362,7 @@ class Yard extends Cart
$price = $shipping_price->price_comp; $price = $shipping_price->price_comp;
$this->num_comp = $shipping_price->num_comp; $this->num_comp = $shipping_price->num_comp;
} }
}
$this->shipping_price = $price; $this->shipping_price = $price;
$this->shipping_tax_rate = $shipping_price->tax_rate; $this->shipping_tax_rate = $shipping_price->tax_rate;
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2); $this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
@ -584,7 +594,7 @@ class Yard extends Cart
} }
public function getCartItemByProduct($product_id, $set_price='with'){ public function getCartItemByProduct($product_id, $set_price='with', $commission=true){
if($product = Product::find($product_id)) { if($product = Product::find($product_id)) {
$image = ""; $image = "";
if ($product->images->count()) { if ($product->images->count()) {
@ -594,8 +604,8 @@ class Yard extends Cart
if($set_price === 'with'){ if($set_price === 'with'){
$price = $product->getPriceWith(false, true); $price = $product->getPriceWith(false, true);
} }
$cartItem = $this->getCartItem($product->id, $product->getLang('name'), 1, $price, if($commission){
[ $options = [
'image' => $image, 'image' => $image,
'slug' => $product->slug, 'slug' => $product->slug,
'weight' => $product->weight, 'weight' => $product->weight,
@ -603,8 +613,16 @@ class Yard extends Cart
'amount_commission' => $product->amount_commission, 'amount_commission' => $product->amount_commission,
'value_commission' => $product->value_commission, 'value_commission' => $product->value_commission,
'partner_commission' => $product->partner_commission, 'partner_commission' => $product->partner_commission,
] ];
); }else{
$options = [
'image' => $image,
'slug' => $product->slug,
'weight' => $product->weight,
];
}
$cartItem = $this->getCartItem($product->id, $product->getLang('name'), 1, $price, $options);
$content = $this->getContent(); $content = $this->getContent();
if ($content->has($cartItem->rowId)){ if ($content->has($cartItem->rowId)){
@ -635,11 +653,19 @@ class Yard extends Cart
} }
public function rowPrice(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
return $this->numberFormat($row->price, $decimals, $decimalPoint, $thousandSeperator);
}
public function rowPriceNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){ public function rowPriceNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
$price = round($row->price / ((100 + $row->taxRate) /100), 4); $price = round($row->price / ((100 + $row->taxRate) /100), 4);
return $this->numberFormat($price, $decimals, $decimalPoint, $thousandSeperator); return $this->numberFormat($price, $decimals, $decimalPoint, $thousandSeperator);
} }
public function rowSubtotal(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
return $this->numberFormat(($row->price * $row->qty), $decimals, $decimalPoint, $thousandSeperator);
}
public function rowSubtotalNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){ public function rowSubtotalNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
$price = round($row->price / ((100 + $row->taxRate) /100), 4); $price = round($row->price / ((100 + $row->taxRate) /100), 4);
return $this->numberFormat(($price * $row->qty), $decimals, $decimalPoint, $thousandSeperator); return $this->numberFormat(($price * $row->qty), $decimals, $decimalPoint, $thousandSeperator);
@ -658,6 +684,15 @@ class Yard extends Cart
return false; return false;
} }
public function getFreeProductId(){
foreach ($this->content() as $row) {
if($row->options->free_product) {
return $row->options->product_id;
}
}
return false;
}
public function getContentByOrder(){ public function getContentByOrder(){
$ret = []; $ret = [];
$comp = []; $comp = [];

View file

@ -30,6 +30,7 @@ class CreateShippingPricesTable extends Migration
$table->unsignedInteger('weight_from')->nullable(); $table->unsignedInteger('weight_from')->nullable();
$table->unsignedInteger('weight_to')->nullable(); $table->unsignedInteger('weight_to')->nullable();
$table->unsignedTinyInteger('shipping_for')->default(1);
$table->timestamps(); $table->timestamps();

View file

@ -122,6 +122,10 @@ h4.product-title {
font-size: 1.2rem; font-size: 1.2rem;
font-weight: bold; font-weight: bold;
color: rgb(64, 65, 66); color: rgb(64, 65, 66);
line-height: 1.5rem;
}
.product-item-price .small{
font-size: 0.85rem;
} }
.badge-cart { .badge-cart {
background: #659a87 !important; background: #659a87 !important;
@ -163,13 +167,31 @@ h4.product-title {
text-align: center; text-align: center;
} }
.swiper-button-next, .swiper-button-prev { .swiper-button-next, .swiper-button-prev {
background-color: #fff;
height: 100%;
padding: 15px;
top:0;
color: rgb(119, 111, 95); color: rgb(119, 111, 95);
outline: 0; outline: 0;
opacity: 0.75;
}
@media (min-width: 992px) {
.swiper-button-next, .swiper-button-prev {
padding: 25px;
}
}
.swiper-button-next, .swiper-rtl .swiper-button-prev{
right: 0;
}
.swiper-button-prev, .swiper-rtl .swiper-button-next {
left: 0;
} }
.swiper-button-next:hover, .swiper-button-prev:hover { .swiper-button-next:hover, .swiper-button-prev:hover {
color: rgb(58, 61, 70); color: rgb(58, 61, 70);
opacity: 0.9;
} }
.swiper-pagination-bullet { .pagination-bullet {
outline: 0; outline: 0;
} }
.swiper-pagination-bullet:hover { .swiper-pagination-bullet:hover {

View file

@ -0,0 +1,153 @@
function _log(msg){
console.log(msg);
}
var IqPromotionShopCart = {
btn_add_free: '.btn-add-free-product',
input_free: '.switcher-input',
btn_shop_add: '.btn-add-product-shop',
//btn_add: '.add-product-shop',
btn_remove: '.remove-product-shop',
//input_event: '.input-event-promotion-onchange',
btn_clear: '#clear-products-basket',
cart_input: '.cart-input-event-onchange',
remove_item: '.remove_item_form_cart',
url: null,
action: null,
cart_holder: '#promotion_cart_holder',
free_poduct_id: null,
shipping_option: null,
init: function () {
var _self = this;
_self.url = $('input[name=load_url]').val();
_self.initElements();
return _self;
},
initElements: function (){
var _self = this;
//_log('init');
$(_self.btn_add_free).on('click', function(event) {
event.preventDefault();
$(this).find(_self.input_free).prop('checked', true);
_self.switchFreeProduct($(this).find(_self.input_free));
});
$(_self.btn_shop_add).on('click', function(event){
event.preventDefault();
_self.addShopProduct($(this));
});
$('input[name=switchers_shipping]').on('change', function(event){
event.preventDefault();
_self.switchShipping($(this));
});
_self.showInit();
/*$_self.update_poduct_price();*/
},
showInit: function (){
var _self = this;
$(_self.btn_clear).on('click', function (event){
event.preventDefault();
_self.performRequest({action: 'clear-cart'})
.done(_self.refreshItemsAndView)
});
$(_self.cart_input).on('change', function(event){
event.preventDefault();
_self.updateInputCart($(this));
});
$(_self.remove_item).on('click', function(event){
event.preventDefault();
_self.performRequest({product_id: $(this).data('product-id'), qty: 0, action: 'remove-shop-product'})
.done(_self.refreshItemsAndView);
});
},
switchShipping: function(_ele){
var _self = this;
_self.shipping_option = _ele.val();
_self.performRequest({shipping_option: _self.shipping_option, action: 'switch-shipping'})
.done(_self.refreshItemsAndView);
},
switchFreeProduct: function(_ele){
var _self = this;
if(_ele.prop('checked')){
if(_self.free_poduct_id != _ele.val()){
_self.free_poduct_id = _ele.val();
_self.performRequest({free_poduct_id: _self.free_poduct_id, action: 'switch-free-product'})
.done(_self.refreshItemsAndView);
}
}
},
addShopProduct: function(_ele){
var _self = this;
if(_ele.data('product_id')){
_self.performRequest({product_id: _ele.data('product_id'), action: 'add-shop-product'})
.done(_self.refreshItemsAndView);
}
},
updateInputCart: function (_ele){
var _self = this;
var qty = parseInt(_ele.val());
qty = _self.checkNumber(qty);
_ele.val(qty);
_self.performRequest({product_id: _ele.data('product_id'), qty: qty, action: 'update-shop-product'})
.done(_self.refreshItemsAndView);
},
checkNumber : function(number){
if(number < 0 || isNaN(number)){
return 0;
}
if(number >= 100){
return 100;
}
return number;
},
refreshItemsAndView: function (data){
var _self = IqPromotionShopCart;
//_log(data);
if(data.response.action == 'clear-cart'){
location.reload();
}
if(data.response.action == 'add-shop-product' || data.response.action == 'update-shop-product' || data.response.action == 'remove-shop-product'){
var qty = data.response.qty > 0 ? "x"+data.response.qty : 0;
$('#badge_cart_indicator_'+data.response.product_id).html(qty);
}
$(_self.cart_holder).html(data.html);
_self.showInit();
},
performRequest : function(data) {
var _self = this;
var url = _self.url;
_log(data);
// _log(url);
return $.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
})
.done(function (data) {
_log('performRequest');
_log(data);
}).fail(function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(jqXHR.responseText);
console.log(textStatus);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
});
}
};

View file

@ -37,4 +37,7 @@
{!! Form::close() !!} {!! Form::close() !!}
@include('admin.product.images')
@endsection @endsection

View file

@ -74,6 +74,7 @@
<th>{{__('Tax')}}</th> <th>{{__('Tax')}}</th>
<th>{{__('Preis von - bis')}}</th> <th>{{__('Preis von - bis')}}</th>
<th>{{__('Gewicht von - bis')}}</th> <th>{{__('Gewicht von - bis')}}</th>
<th>{{__('Preis für') }}</th>
<th></th> <th></th>
</tr> </tr>
@ -92,7 +93,8 @@
data-total_from="{{ $price->getFormatTotalFrom() }}" data-total_from="{{ $price->getFormatTotalFrom() }}"
data-total_to="{{ $price->getFormattedTotalTo() }}" data-total_to="{{ $price->getFormattedTotalTo() }}"
data-weight_from="{{ $price->weight_from }}" data-weight_from="{{ $price->weight_from }}"
data-weight_to="{{ $price->weight_to }}"> data-weight_to="{{ $price->weight_to }}"
data-shipping_for="{{ $price->shipping_for }}">
<span class="far fa-edit"></span> <span class="far fa-edit"></span>
</button> </button>
</td> </td>
@ -102,6 +104,7 @@
<td>{{ $price->getFormattedTaxRate() }}</td> <td>{{ $price->getFormattedTaxRate() }}</td>
<td>{{ $price->getFormatTotalFrom() }} - {{ $price->getFormattedTotalTo() }}</td> <td>{{ $price->getFormatTotalFrom() }} - {{ $price->getFormattedTotalTo() }}</td>
<td>{{ $price->weight_from }} - {{ $price->weight_to }}</td> <td>{{ $price->weight_from }} - {{ $price->weight_to }}</td>
<td>{{ $price->getShippingForType() }}</td>
<td><a class="text-danger" href="{{ route('admin_shipping_price_delete', [$price->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a></td> <td><a class="text-danger" href="{{ route('admin_shipping_price_delete', [$price->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a></td>
</tr> </tr>
@ -120,6 +123,7 @@
data-total_to="" data-total_to=""
data-weight_from="" data-weight_from=""
data-weight_to="" data-weight_to=""
data-shipping_for="1"
>{{__('Neuen Preis erstellen')}}</button> >{{__('Neuen Preis erstellen')}}</button>
@ -147,8 +151,8 @@
<input type="text" class="form-control" name="price" placeholder="{{__('Preis in Euro')}}" required> <input type="text" class="form-control" name="price" placeholder="{{__('Preis in Euro')}}" required>
</div> </div>
<div class="form-group col-6"> <div class="form-group col-6">
<label for="price_comp" class="form-label">{{__('Kompensation Preis (brutto)')}}*</label> <label for="price_comp" class="form-label">{{__('Kompensation Preis (brutto)')}}</label>
<input type="text" class="form-control" name="price_comp" placeholder="{{__('Preis in Euro')}}" required> <input type="text" class="form-control" name="price_comp" placeholder="{{__('Preis in Euro')}}">
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
@ -157,8 +161,8 @@
<input type="text" class="form-control" name="tax_rate" placeholder="{{__('Tax in %')}}"> <input type="text" class="form-control" name="tax_rate" placeholder="{{__('Tax in %')}}">
</div> </div>
<div class="form-group col-6"> <div class="form-group col-6">
<label for="num_comp" class="form-label">{{__('Anzahl Kompensationsprodukte')}}*</label> <label for="num_comp" class="form-label">{{__('Anzahl Kompensationsprodukte')}}</label>
<input type="text" class="form-control" name="num_comp" placeholder="{{__('Anzahl Kompensationsprodukte')}}" required> <input type="text" class="form-control" name="num_comp" placeholder="{{__('Anzahl Kompensationsprodukte')}}">
</div> </div>
</div> </div>
@ -183,6 +187,16 @@
<input type="text" class="form-control" name="weight_to" placeholder="{{__('in g')}}"> <input type="text" class="form-control" name="weight_to" placeholder="{{__('in g')}}">
</div> </div>
</div> </div>
<div class="form-row">
<div class="form-group col-12">
<label for="shipping_for" class="form-label">Versandkosten für</label>
<select class="custom-select" name="shipping_for" id="shipping_for">
@foreach(\App\Models\ShippingPrice::$shippingForTypes as $id=>$name)
<option value="{{$id}}" >{{$name}}</option>
@endforeach
</select>
</div>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
@ -277,6 +291,7 @@
$(this).find(".modal-body input[name='total_to']").val(button.data('total_to')); $(this).find(".modal-body input[name='total_to']").val(button.data('total_to'));
$(this).find(".modal-body input[name='weight_from']").val(button.data('weight_from')); $(this).find(".modal-body input[name='weight_from']").val(button.data('weight_from'));
$(this).find(".modal-body input[name='weight_to']").val(button.data('weight_to')); $(this).find(".modal-body input[name='weight_to']").val(button.data('weight_to'));
$(this).find(".modal-body select[name='shipping_for']").val(button.data('shipping_for'));
}); });
$('#modals-country').on('show.bs.modal', function (event) { $('#modals-country').on('show.bs.modal', function (event) {

View file

@ -26,9 +26,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
@foreach($values as $value) @foreach($values as $value)
<div class="card mb-4"> <div class="card mb-4">
<div class="card-body d-flex justify-content-between align-items-start pt-3 pb-1"> <div class="card-body d-flex justify-content-between align-items-start pt-3 pb-1">
<div> <div>
@ -37,9 +35,10 @@
@if ($value->promotion_admin->from) @if ($value->promotion_admin->from)
| vom: {{ $value->promotion_admin->from }} | vom: {{ $value->promotion_admin->from }}
@endif @endif
@if ($value->promotion_admin->from) @if ($value->promotion_admin->to)
| bis: {{ $value->promotion_admin->to }} | bis: {{ $value->promotion_admin->to }}
@endif @endif
| {!! get_active_badge($value->promotion_admin->isActive()) !!}
</a> </a>
</div> </div>
@if($value->canDelete()) @if($value->canDelete())
@ -68,36 +67,29 @@
{{ formatPlural($value->promotion_admin->promotion_admin_products_active->count(), 'Sorte', 'n') }} {{ formatPlural($value->promotion_admin->promotion_admin_products_active->count(), 'Sorte', 'n') }}
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="text-muted small">aktive Produkte</div> <div class="text-muted small">aktive Produkte</div>
<div class="font-weight-bold">{{$value->promotion_user_products_active->count()}} <div class="font-weight-bold">{{$value->promotion_user_products_active->count()}}
{{ formatPlural($value->promotion_user_products_active->count(), 'Sorte', 'n') }} {{ formatPlural($value->promotion_user_products_active->count(), 'Sorte', 'n') }}
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="text-muted small">geplant Produkte</div> <div class="text-muted small">geplant Produkte</div>
<div class="font-weight-bold">{{$value->getCountOpenItems()}} Stk.</div> <div class="font-weight-bold">{{$value->getCountOpenItems()}} Stk.</div>
</div> </div>
<div class="col"> <div class="col">
<div class="text-muted small">geordert Produkte</div> <div class="text-muted small">geordert Produkte</div>
<div class="font-weight-bold">{{$value->getCountSellItems()}} Stk.</div> <div class="font-weight-bold">{{$value->getCountSellItems()}} Stk.</div>
</div> </div>
</div> </div>
<div class="row mt-3"> <div class="row mt-3">
<div class="col"> <div class="col">
<div class="text-muted small">Promotion aktiv</div> <div class="text-muted small">Promotion aktiv</div>
<div class="font-weight-bold">{!! get_active_badge($value->active) !!}</div> <div class="font-weight-bold">{!! get_active_badge($value->active) !!}</div>
</div> </div>
<div class="col"> <div class="col">
<div class="text-muted small">persönliche Abholung</div> <div class="text-muted small">persönliche Abholung</div>
<div class="font-weight-bold">{!! get_active_badge($value->pick_up) !!}</div> <div class="font-weight-bold">{!! get_active_badge($value->pick_up) !!}</div>
</div> </div>
<div class="col"> <div class="col">
<div class="text-muted small">Potentielle Kosten</div> <div class="text-muted small">Potentielle Kosten</div>
@ -109,7 +101,6 @@
@php($user_promotion_sell = $value->calculateSell()) @php($user_promotion_sell = $value->calculateSell())
<div class="font-weight-bold">{{ formatNumber($user_promotion_sell['price']) }} brutto</div> <div class="font-weight-bold">{{ formatNumber($user_promotion_sell['price']) }} brutto</div>
</div> </div>
</div> </div>
</div> </div>
<hr class="m-0"> <hr class="m-0">

View file

@ -45,4 +45,5 @@
<script src="{{ mix('/vendor/libs/bootstrap-select/bootstrap-select.js') }}"></script> <script src="{{ mix('/vendor/libs/bootstrap-select/bootstrap-select.js') }}"></script>
<script src="{{ asset('/vendor/libs/swiper/swiper-bundle.min.js') }}"></script> <script src="{{ asset('/vendor/libs/swiper/swiper-bundle.min.js') }}"></script>
<script src="{{ asset('/js/shop.js') }}?v=1{{ get_file_last_time('/js/shop.js') }}"></script> <script src="{{ asset('/js/shop.js') }}?v=1{{ get_file_last_time('/js/shop.js') }}"></script>
@yield('scripts')
</html> </html>

View file

@ -1,15 +1,13 @@
<!-- Footer --> <!-- Footer -->
<nav class="footer bp-3 pt-4"> <nav class="footer bp-3 pt-4">
<hr class="m-0"> <hr class="m-0">
<div class="container px-3 pt-4"> <div class="container px-3 pt-4">
<div class="row"> <div class="row">
<div class="col-lg-4 col-md-6"> <div class="col-lg-4 col-md-6 text-center text-md-left">
<img src="https://www.gruene-seele.bio/wp-content/uploads/2019/10/gruene-seele-logo_beige.jpg" class="img-brand" alt="Grüne Seele Logo"> <img src="https://www.gruene-seele.bio/wp-content/uploads/2019/10/gruene-seele-logo_beige.jpg" class="img-brand" alt="Grüne Seele Logo">
</div> </div>
<div class="col-lg-4 col-md-6"> <div class="col-lg-4 col-md-6 text-center">
<div class="contact-box mt-4"> <div class="contact-box mt-4 text-left" style="display: inline-block">
<div class="contact-phone-box"> <div class="contact-phone-box">
<div class="contact-phone-icon"> <div class="contact-phone-icon">
<i class="fa fa-phone-volume"></i> <i class="fa fa-phone-volume"></i>
@ -25,17 +23,17 @@
</div> </div>
</div> </div>
<div class="col-lg-4 col-md-12"> <div class="col-lg-4 col-md-12">
<div class="navbar-nav text-md-center text-lg-right ml-auto mt-3"> <div class="navbar-nav text-center text-lg-right ml-auto mt-3">
<a class="anchor-link nav-item nav-link" href="#">Vertriebspartner werden</a> <a class="anchor-link nav-item nav-link" href="https://www.gruene-seele.bio/vertriebspartner/" target="_blank">Vertriebspartner werden</a>
<a class="anchor-link nav-item nav-link" href="#">Impressum</a> <a class="anchor-link nav-item nav-link" href="https://www.gruene-seele.bio/impressum/" target="_blank">Impressum</a>
<a class="anchor-link nav-item nav-link" href="#">Datenschutz</a> <a class="anchor-link nav-item nav-link" href="https://www.gruene-seele.bio/datenschutzerklaerung/" target="_blank">Datenschutz</a>
<a class="anchor-link nav-item nav-link" href="#">AGB</a> <a class="anchor-link nav-item nav-link" href="https://www.gruene-seele.bio/agb/" target="_blank">AGB</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="container py-2 px-2"> <div class="container py-2 px-2">
<div class="text-left pl-2 mt-2">Copyright since 2019 GRÜNE SEELE GbR</div> <hr>
<div class="text-center pl-2 mt-2">Copyright since 2019 GRÜNE SEELE GbR</div>
</div> </div>
</nav> </nav>

View file

@ -1,8 +1,10 @@
<nav class="landing-navbar navbar pt-lg-4"> <nav class="landing-navbar navbar1 pt-md-4">
<div class="container d-flex justify-content-between px-3"> <div class="container px-3 pt-4">
<div class="contact-box d-none d-md-block box-min-width"> <div class="row">
<div class="col-lg-4 col-md-6 text-left d-none d-md-block ">
<div class="contact-box box-min-width">
<div class="contact-phone-box"> <div class="contact-phone-box">
<div class="contact-phone-icon"> <div class="contact-phone-icon">
<i class="fa fa-phone-volume"></i> <i class="fa fa-phone-volume"></i>
@ -16,17 +18,13 @@
MoSa 919 Uhr | <a href="mailto:service@gruene-seele.bio">service@gruene-seele.bio</a> MoSa 919 Uhr | <a href="mailto:service@gruene-seele.bio">service@gruene-seele.bio</a>
</div> </div>
</div> </div>
<div class="">
<a href="https://www.gruene-seele.bio" class="a-brand">
<img src="https://www.gruene-seele.bio/wp-content/uploads/2019/10/gruene-seele-logo_beige.jpg" class="img-brand" alt="Grüne Seele Logo">
</a>
</div> </div>
<div class="box-min-width"> <div class="col-lg-4 col-md-6 text-center text-md-right text-lg-center">
<div class="navbar-nav text-right ml-auto" style=""> <img src="https://www.gruene-seele.bio/wp-content/uploads/2019/10/gruene-seele-logo_beige.jpg" class="img-brand" alt="Grüne Seele Logo">
<a class="anchor-link nav-item nav-link" href="#">Vertriebspartner werden</a> </div>
<a class="anchor-link nav-item nav-link" href="#">Impressum</a> <div class="col-lg-4 col-md-12">
<a class="anchor-link nav-item nav-link" href="#">Datenschutz</a> <div class="navbar-nav text-center text-lg-right ml-auto mt-3">
<a class="anchor-link nav-item nav-link" href="#">AGB</a> <a class="anchor-link nav-item nav-link" href="https://www.gruene-seele.bio/vertriebspartner/" target="_blank">Vertriebspartner werden</a>
</div> </div>
</div> </div>
</div> </div>

View file

@ -134,7 +134,7 @@
</span> </span>
</span> </span>
<span class="switcher-label">Mit Klick auf "Jetzt kaufen" akzeptiere ich die <span class="switcher-label">Mit Klick auf "Jetzt kaufen" akzeptiere ich die
<a href="https://www.gruene-seele.bio/vp-agb/" target="_blank" class="text-secondary">Allgemeinen <a href="https://www.gruene-seele.bio/agb/" target="_blank" class="text-secondary">Allgemeinen
Geschäftsbedingungen</a> und die Geschäftsbedingungen</a> und die
<a href="https://www.gruene-seele.bio/datenschutzerklaerung/" target="_bank" <a href="https://www.gruene-seele.bio/datenschutzerklaerung/" target="_bank"
class="text-secondary">Datenschutzbelehrung</a>, damit für die Bestellung class="text-secondary">Datenschutzbelehrung</a>, damit für die Bestellung

View file

@ -11,7 +11,7 @@
<span class="switcher-no"> <span class="switcher-no">
</span> </span>
</span> </span>
<span class="switcher-label">Ich verstehe und ....</span> <span class="switcher-label">Ich verstehe und akzeptiere, dass ich als Kunde nur einmal an einer Tester-Promotion einer bestimmten Produktgruppe teilnehmen kann, damit auch andere Kunden von dieser Aktion profitieren können.</span>
</label> </label>
<div id="error-switch_fairplay" class="text-left"></div> <div id="error-switch_fairplay" class="text-left"></div>
</div> </div>

View file

@ -1,22 +1,23 @@
<section> <section>
<h2 class="text-center">1 Tester gratis für Dich</h2> <h2 class="text-center">1 Tester gratis für Dich</h2>
<p class="text-center">Wähle nun ...</p> <p class="text-center">Wähle nun eines der aufgeführten Produkte.</p>
<div class="row justify-content-center"> <div class="row justify-content-center">
@php($free_product_id = Yard::instance('shopping')->getFreeProductId())
@foreach ($promotion_user->promotion_user_products_active as $promotion_user_product) @foreach ($promotion_user->promotion_user_products_active as $promotion_user_product)
@if ($promotion_user_product->isShow()) @if ($promotion_user_product->isShow())
<div class="col-md-6 col-lg-4 text-center p-4"> <div class="col-md-6 col-lg-4 text-center">
@if ($promotion_user_product->product->images) @if ($promotion_user_product->product->images)
@if ($image = $promotion_user_product->product->images->first()) @if ($image = $promotion_user_product->product->images->first())
<img src="{{ route('product_image', [$image->slug]) }}" class="mb-2 img-fluid" <img src="{{ route('product_image', [$image->slug]) }}" class="mb-2 img-fluid" alt="">
alt="" style="max-height: 350px">
@endif @endif
@endif @endif
<h4 class="product-title"> <h4 class="product-title">
{{ $promotion_user_product->product->name }} {{ $promotion_user_product->product->name }}
</h4> </h4>
<div class="mb-2 product-description"> <div class="mb-2 product-description">
{{ substr_ellipsis($promotion_user_product->product->description, 110, true) }} {{ $promotion_user_product->product->getShortCopy(true, 110) }}
</div> </div>
<div class="more_details"> <div class="more_details">
<a href="" class="" data-modal="modal-lg" data-toggle="modal" <a href="" class="" data-modal="modal-lg" data-toggle="modal"
@ -27,9 +28,12 @@
<i class="fa fa-search"></i> Mehr Details</a> <i class="fa fa-search"></i> Mehr Details</a>
</div> </div>
<div class="mt-4 mb-3"> <div class="mt-4 mb-3">
<div class="switcher-holder"> <div class="switcher-holder btn-add-free-product">
<label class="switcher switcher-success"> <label class="switcher switcher-success">
<input type="radio" class="switcher-input" name="user_free_product" value="{{ $promotion_user_product->product->id }}" data-error="#error-user_free_product" required> <input type="radio" class="switcher-input" name="user_free_product"
value="{{ $promotion_user_product->product->id }}" data-error="#error-user_free_product"
@if($free_product_id === $promotion_user_product->product->id) checked @endif
required>
<span class="switcher-indicator"> <span class="switcher-indicator">
<span class="switcher-yes"> <span class="switcher-yes">
<span class="ion ion-md-checkmark"></span> <span class="ion ion-md-checkmark"></span>

View file

@ -1,9 +1,21 @@
<div class="container flex-grow-1 container-p-y pb-0"> <div class="container flex-grow-1 container-p-y pb-0">
<div class="media align-items-center py-3 mb-3"> <div class="media align-items-top py-3 mb-3">
{{-- <img src="assets/img/avatars/5-small.png" alt="" class="d-block ui-w-100 rounded-circle"> --}} @if($promotion_user->user->hasProfileImage())
<img src="{{ route('response_file', ['user', $promotion_user->user->getProfileImage()]) }}" alt="" class="d-block ui-w-100 rounded-circle mt-3">
@endif
<div class="media-body ml-4"> <div class="media-body ml-4">
<h1 class="text-center">{{ $promotion_user->name }}</h1> <h1 class="text-left">{{ $promotion_user->name }}</h1>
<p class="text-center">{!! nl2br($promotion_user->description) !!}</p> <p class="text-left">{!! nl2br($promotion_user->description) !!}</p>
<h6 class="card-header bg-light py-2">
<a href="#" class="" style="text-decoration: none" data-toggle="collapse" data-target="#collapsePaymentForm" aria-expanded="false" aria-controls="collapsePaymentForm">
<i class="fa fa-caret-down"></i> mehr über mich
</a>
</h6>
<div class="collapse" id="collapsePaymentForm">
<p class="text-left">{!! nl2br($promotion_user->about_you) !!}</p>
</div> </div>
</div> </div>
</div> </div>
</div>

View file

@ -1,4 +1,3 @@
<section>
<div class="row"> <div class="row">
<div class="col-12 text-left"> <div class="col-12 text-left">
<h2 class="mt-3">Warenkorb</h2> <h2 class="mt-3">Warenkorb</h2>
@ -23,15 +22,12 @@
</div> </div>
</div> </div>
</div> </div>
@foreach ([2, 4, 5] as $id) @foreach(Yard::instance('shopping')->getContentByOrder() as $row)
@php($product = \App\Models\Product::find($id)) @php($product = \App\Models\Product::find($row->id))
<div class="row yard-item"> <div class="row yard-item">
<div class="col-3 col-sm-2"> <div class="col-3 col-sm-2">
@if ($product->images) @if($row->options->has('image'))
@if($image = $product->images->first()) <img src="{{ route('product_image', [$row->options->image]) }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
<img src="{{ route('product_image', [$image->slug]) }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@endif
@else @else
<img src="{{ asset('/assets/images/1x1.png') }}" class="d-block ui-w-80 ui-bordered mr-4" alt=""> <img src="{{ asset('/assets/images/1x1.png') }}" class="d-block ui-w-80 ui-bordered mr-4" alt="">
@endif @endif
@ -42,7 +38,7 @@
<div class="col-12 col-sm-6 col-md-7 description"> <div class="col-12 col-sm-6 col-md-7 description">
<div class="media-body"> <div class="media-body">
<div class="d-block text-body" <div class="d-block text-body"
style="font-size: 15px; font-weight: 500;">{{ $product->name }} style="font-size: 15px; font-weight: 500;">{{ $row->name }}
</div> </div>
<div class="text-body"> <div class="text-body">
<div>Inhalt: {{ $product->contents }}</div> <div>Inhalt: {{ $product->contents }}</div>
@ -50,54 +46,54 @@
</div> </div>
</div> </div>
<div class="options"> <div class="options">
@if(!$row->options->free_product)
<a href="#" <a href="#"
class="auto-delete-product remove_item_form_cart product-tooltip" class="auto-delete-product remove_item_form_cart product-tooltip"
data-row-id="{{ $product->id }}" data-row-id="{{$row->rowId}}"
data-product-id="{{ $product->id }}"><i data-product-id="{{ $product->id }}"><i
class="fa fa-times"></i> Artikel entfernen</a> class="fa fa-times"></i> Artikel entfernen</a>
@else
gratis Produkt
@endif
</div> </div>
</div> </div>
<div class="col-6 col-sm-3 col-md-2 text-left font-semi-bold price-single"> <div class="col-6 col-sm-3 col-md-2 text-left font-semi-bold price-single">
<div class="no-line-break"> <div class="no-line-break">
{{ $product->getFormattedPrice() }} &euro;*</div> {{ Yard::instance('shopping')->rowPrice($row, 2) }} &euro;*</div>
</div> </div>
<div class="col-6 col-sm-3 col-md-3 quantity"> <div class="col-6 col-sm-3 col-md-3 quantity">
@if(!$row->options->free_product)
<div class="quantity-select"> <div class="quantity-select">
<input type="number" <input type="number"
class="form-control text-center cart-input-event-onchange" class="form-control text-center cart-input-event-onchange"
data-row-id="{{ $product->id }}" data-row-id="{{$row->rowId}}"
data-product-id="{{ $product->id }}" value="1" data-product_id="{{ $product->id }}" value="{{ $row->qty }}"
name="quantity[{{ $product->id }}]" maxlength="3" max="999" name="quantity[{{ $row->qty }}]" maxlength="3" max="999"
min="1"> min="1">
</div> </div>
<div class="price-total text-right"> <div class="price-total text-right">
<div class="no-line-break"> <div class="no-line-break">{{ Yard::instance('shopping')->rowSubtotal($row, 2) }} &euro;*</div>
0 &euro;*
</div> </div>
@else
<div class="price-total text-right mt-0">
<div class="no-line-break">1 / 0,00 &euro;*</div>
</div> </div>
@endif
</div> </div>
</div> </div>
</div> </div>
<div class="col-12"> <div class="col-12">
<hr class="mt-2 mb-2 light"> <hr class="mt-2 mb-2 light">
</div> </div>
</div> </div>
@endforeach @endforeach
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>
<div class="mt-2 col-12"> <div class="mt-2 col-12">
<p class="small mb-2">Du hast xx Artikel in Deinem Warenkorb</p> <p class="small mb-2">Du hast {{ Yard::instance('shopping')->count() }} Artikel in Deinem Warenkorb</p>
<button type="button" class="btn btn-default btn-sm" id="clear-products-basket"><i <button type="button" class="btn btn-default btn-sm" id="clear-products-basket"><i
class="ion ion-ios-trash"></i> Warenkorb löschen</button> class="ion ion-ios-trash"></i> Warenkorb löschen</button>
<hr class=""> <hr class="">
</div> </div>
</div> </div>
</section>

View file

@ -1,7 +1,7 @@
<section> <section>
<h2 class="mt-0 text-center">OH Nein ... alle Tester sind bereits vergriffen!</h2> <h2 class="mt-0 text-center">OH Nein ... alle Tester sind bereits vergriffen!</h2>
<p class="text-center">ERINNERUNGS-SERVICE:<br> <p class="text-center mb-4">ERINNERUNGS-SERVICE:<br>
text ...</p> Lass Deine Kontaktdaten da, damit wir Dich informieren können, wenn es Nachschub gibt ...</p>
<div class="row justify-content-md-center"> <div class="row justify-content-md-center">
<div class="col-lg-8"> <div class="col-lg-8">
<div class="row"> <div class="row">
@ -84,7 +84,7 @@
</span> </span>
</span> </span>
<span class="switcher-label">Mit Klick auf "Absenden" akzeptiere ich die <span class="switcher-label">Mit Klick auf "Absenden" akzeptiere ich die
<a href="https://www.gruene-seele.bio/vp-agb/" target="_blank" <a href="https://www.gruene-seele.bio/agb/" target="_blank"
class="text-secondary">Allgemeinen class="text-secondary">Allgemeinen
Geschäftsbedingungen</a> und die Geschäftsbedingungen</a> und die
<a href="https://www.gruene-seele.bio/datenschutzerklaerung/" target="_bank" <a href="https://www.gruene-seele.bio/datenschutzerklaerung/" target="_bank"
@ -96,7 +96,7 @@
<div class="text-center"> <div class="text-center">
{!! Form::hidden("action", "submit-reminder-service") !!} {!! Form::hidden("action", "submit-reminder-service") !!}
<button type="submit" class="btn btn-primary btn-lg mt-4 mb-4 button-prevent-multiple-submits"> <button type="submit" class="btn btn-primary btn-lg mt-4 mb-4 button-prevent-multiple-submits">
<i class="ion ion-ios-share-alt"></i> Absenden <i class="spinner fa fa-spinner fa-spin"></i> <i class="ion ion-ios-paper-plane"></i> Absenden <i class="spinner fa fa-spinner fa-spin"></i>
</button> </button>
</div> </div>
</div> </div>

View file

@ -11,10 +11,9 @@
</span> </span>
<span class="switcher-no"></span> <span class="switcher-no"></span>
</span> </span>
<span class="switcher-label">0,00 &euro; - Ich hole die Ware bei <span class="switcher-label">0,00 &euro; - Ich hole die Ware bei {{ $promotion_user->user->getFullName() }} persönlich ab</span>
{{ $promotion_user->user->getFullName() }} persönlich ab</span>
</label> </label>
<label class="switcher switcher-success"> {{-- <label class="switcher switcher-success">
<input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="dhl_slow"> <input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="dhl_slow">
<span class="switcher-indicator"> <span class="switcher-indicator">
<span class="switcher-yes"> <span class="switcher-yes">
@ -25,15 +24,16 @@
<span class="switcher-label">3,50 &euro; - Bücher-/Warensendung mit Deutsche Post (4-6 <span class="switcher-label">3,50 &euro; - Bücher-/Warensendung mit Deutsche Post (4-6
Werktage)</span> Werktage)</span>
</label> </label>
--}}
<label class="switcher switcher-success"> <label class="switcher switcher-success">
<input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="dhl_fast"> <input type="radio" class="switcher-input" name="switchers_shipping" data-error="#error-switchers_shipping" value="dhl_shipping">
<span class="switcher-indicator"> <span class="switcher-indicator">
<span class="switcher-yes"> <span class="switcher-yes">
<span class="ion ion-md-checkmark"></span> <span class="ion ion-md-checkmark"></span>
</span> </span>
<span class="switcher-no"></span> <span class="switcher-no"></span>
</span> </span>
<span class="switcher-label">4,90 &euro; - DHL Warenpost (1-3 Werktage)</span> <span class="switcher-label">ab {{ \App\Services\PromotionCart::getLowestShippingPrice() }} &euro; - Versand mit DHL (1-3 Werktage)</span>
</label> </label>
</div> </div>
<div id="error-switchers_shipping" class="text-left"></div> <div id="error-switchers_shipping" class="text-left"></div>

View file

@ -1,24 +1,25 @@
<section> <section>
<h2 class="text-center mt-3">zusätzlich Einkaufen</h2> <h2 class="text-center mt-3">zusätzlich Einkaufen</h2>
<p class="text-center">Vielleicht sagt...<br> <p class="text-center">Vielleicht sagt Dir ja jetzt schon ein Produkt zu und Du nimmst es gleich mit ...</p>
* Preis inkl. gesetzl. MwSt. | zzgl. Versandkosten
</p>
<div class="swiper mySwiper"> <div class="swiper mySwiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
@foreach ($shop_products as $product) @foreach ($shop_products as $product)
@php($cartItem = Yard::instance('shopping')->getCartItemByProduct($product->id, false, false))
@php($qty = isset($cartItem->qty) ? "x".$cartItem->qty : 0)
@php($rowId = isset($cartItem->rowId) ? $cartItem->rowId : '')
<div class="swiper-slide"> <div class="swiper-slide">
<div class="text-center p-4"> <div class="text-center">
@if ($product->images) @if ($product->images)
@if ($image = $product->images->first()) @if ($image = $product->images->first())
<img src="{{ route('product_image', [$image->slug]) }}" class="mb-2 img-fluid" <img src="{{ route('product_image', [$image->slug]) }}" class="mb-2 img-fluid" alt="">
alt="" style="max-height: 350px">
@endif @endif
@endif @endif
<h4 class="product-title"> <h4 class="product-title px-4">
{{ $product->name }} {{ $product->name }}
</h4> </h4>
<div class="mb-2 product-description"> <div class="mb-2 product-description px-4">
{{ substr_ellipsis($product->description, 110, true) }} {{ $product->getShortCopy(true, 110) }}
</div> </div>
<div class="more_details"> <div class="more_details">
<a href="" class="" data-modal="modal-lg" data-toggle="modal" <a href="" class="" data-modal="modal-lg" data-toggle="modal"
@ -27,22 +28,18 @@
data-action="web-show-product" data-view="with-price"> data-action="web-show-product" data-view="with-price">
<i class="fa fa-search"></i> Mehr Details</a> <i class="fa fa-search"></i> Mehr Details</a>
</div> </div>
<div class="product-item-price mt-2 mb-2"> <div class="product-item-price mt-2 mt-2">
{{ $product->getFormattedPrice() }} &euro;* {{ $product->getFormattedPrice() }} &euro;*
<br><span class="small text-muted">{{ $product->getBasePriceFormattedFull() }} &euro;</span>
</div> </div>
<div class="mt-2 mb-3"> <div class="mt-2 pb-3">
<button type="button" class="btn btn-primary"> <button type="button" class="btn btn-primary btn-add-product-shop" data-product_id="{{ $product->id }}" data-row-id="{{ $cartItem->rowId }}">
In den Warenkorb &nbsp; <i class="ion ion-md-basket navbar-icon align-middle"></i> In den Warenkorb &nbsp; <i class="ion ion-md-basket navbar-icon align-middle"></i>
<span class="badge badge-cart indicator">3</span> <span class="badge badge-cart indicator" id="badge_cart_indicator_{{ $product->id }}">{{ $qty }}</span>
</button> </button>
<div class="p-4"></div>
</div> </div>
<a class="nav-link dropdown-toggle hide-arrow text-nowrap ml-lg-2" href="#" data-toggle="dropdown">
<span class="d-lg-none align-middle">&nbsp; Cart</span>
</a>
</div> </div>
</div> </div>
@endforeach @endforeach
@ -51,7 +48,8 @@
<div class="swiper-button-prev"></div> <div class="swiper-button-prev"></div>
<div class="swiper-pagination"></div> <div class="swiper-pagination"></div>
</div> </div>
<div class="mt-4"> <div class="m2-4 text-center small">
* Preis inkl. gesetzl. MwSt. | zzgl. Versandkosten
<hr class=""> <hr class="">
</div> </div>
</section> </section>

View file

@ -8,7 +8,7 @@
Bio Deocremes Bio Deocremes
</h3> </h3>
<div class="mb-1 product-description-samll"> <div class="mb-1 product-description-samll">
Nachhaltigkeit ohne Nachhaltig ohne Plastik und in Bio-Qualität
</div> </div>
<div class="mt-4 mb-3"> <div class="mt-4 mb-3">
<a href="" class="btn btn-primary btn-lg"> <a href="" class="btn btn-primary btn-lg">
@ -24,7 +24,7 @@
Bio Aloe Vera Bio Aloe Vera
</h3> </h3>
<div class="mb-2 product-description-samll"> <div class="mb-2 product-description-samll">
Nachhaltigkeit ohne Aus Direktsaft höchster Güte aus Mallorca
</div> </div>
<div class="mt-4 mb-3"> <div class="mt-4 mb-3">
<a href="" class="btn btn-primary btn-lg"> <a href="" class="btn btn-primary btn-lg">
@ -39,7 +39,7 @@
Verantwortung Verantwortung
</h3> </h3>
<div class="mb-2 product-description-samll"> <div class="mb-2 product-description-samll">
Nachhaltigkeit ohne Refill-System, CO2 und Mithelfen
</div> </div>
<div class="mt-4 mb-3"> <div class="mt-4 mb-3">
<a href="" class="btn btn-primary btn-lg"> <a href="" class="btn btn-primary btn-lg">

View file

@ -18,6 +18,7 @@
{!! Form::open(['url' => route('web_promotion_store', $promotion_user->id), 'class' => 'form-horizontal form-prevent-multiple-submits', 'id' => 'user-promotion-form-validations']) !!} {!! Form::open(['url' => route('web_promotion_store', $promotion_user->id), 'class' => 'form-horizontal form-prevent-multiple-submits', 'id' => 'user-promotion-form-validations']) !!}
<input type="hidden" name="load_url" value="{{ route('web_promotion_modal_load') }}">
<div class="layout-content"> <div class="layout-content">
@include('web.promotion._intro') @include('web.promotion._intro')
@ -29,8 +30,9 @@
@include('web.promotion._shipping') @include('web.promotion._shipping')
@include('web.promotion._fairplay') @include('web.promotion._fairplay')
<section id="promotion_cart_holder">
@include('web.promotion._promotion_cart') @include('web.promotion._promotion_cart')
</section>
<section> <section>
<div class="row"> <div class="row">
@ -52,6 +54,8 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
var iqShoppingShopCart = IqPromotionShopCart.init();
var validator = $("#user-promotion-form-validations").validate({ var validator = $("#user-promotion-form-validations").validate({
submitHandler: function(form) { submitHandler: function(form) {
$('.button-prevent-multiple-submits').attr('disabled', true); $('.button-prevent-multiple-submits').attr('disabled', true);
@ -102,10 +106,6 @@
validator.element($(this)); validator.element($(this));
}); });
$('.switcher-holder').on('click', function() {
$(this).find('.switcher-input').prop('checked', true);
});
var swiper = new Swiper(".mySwiper", { var swiper = new Swiper(".mySwiper", {
slidesPerView: 1, slidesPerView: 1,
spaceBetween: 10, spaceBetween: 10,
@ -146,7 +146,6 @@
} }
}); });
}); });
if ($('#shipping_address_switch').is(':checked')) { if ($('#shipping_address_switch').is(':checked')) {
$('#shipping_address').show(); $('#shipping_address').show();
} else { } else {
@ -156,3 +155,7 @@
</script> </script>
@endsection @endsection
@section('scripts')
<script src="{{ asset('/js/iq-promotion-shop-cart.js') }}?v=2{{ get_file_last_time('/js/iq-promotion-shop-cart.js') }}"></script>
@endsection

View file

@ -49,9 +49,6 @@
<tr> <tr>
<td colspan="2" class="border-0 text-muted">* inkl. gesetzl. MwSt. | zzgl. Versandkosten</td> <td colspan="2" class="border-0 text-muted">* inkl. gesetzl. MwSt. | zzgl. Versandkosten</td>
</tr> </tr>
@endif @endif
</tbody> </tbody>