Country Prices | Homeparty | Shop | Order
This commit is contained in:
parent
51d81d8ec6
commit
39d1e93416
284 changed files with 784 additions and 216 deletions
|
|
@ -3,12 +3,13 @@
|
|||
namespace App\Http\Controllers\Web;
|
||||
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Product;
|
||||
use App\Models\ShoppingInstance;
|
||||
use App\Services\Util;
|
||||
use Yard;
|
||||
use Request;
|
||||
use App\Services\Shop;
|
||||
use App\Services\Util;
|
||||
use App\Models\Product;
|
||||
use App\Models\ShoppingInstance;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class CardController extends Controller
|
||||
{
|
||||
|
|
@ -32,8 +33,12 @@ class CardController extends Controller
|
|||
if($product->images->count()){
|
||||
$image = $product->images->first()->slug;
|
||||
}
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->price, ['image' => $image, 'slug' => $product_slug, 'weight' => $product->weight]);
|
||||
Yard::setTax($cartItem->rowId, $product->tax);
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->getPriceWith(Yard::instance('shopping')->getUserTaxFree(), false, Yard::instance('shopping')->getUserCountry()), ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
|
||||
if(Yard::instance('shopping')->getUserTaxFree()){
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
}else{
|
||||
Yard::setTax($cartItem->rowId, $product->getTaxWith(Yard::instance('shopping')->getUserCountry()));
|
||||
}
|
||||
Yard::instance('shopping')->reCalculateShippingPrice();
|
||||
|
||||
\Session()->flash('show-card-after-add', true);
|
||||
|
|
@ -55,7 +60,12 @@ class CardController extends Controller
|
|||
}
|
||||
$quantity = Request::get('quantity') ? Request::get('quantity') : 1;
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
|
||||
Yard::setTax($cartItem->rowId, $product->tax);
|
||||
$cartItem = Yard::instance('shopping')->add($product->id, $product->getLang('name'), $quantity, $product->getPriceWith(Yard::instance('shopping')->getUserTaxFree(), false, Yard::instance('shopping')->getUserCountry()), ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]);
|
||||
if(Yard::instance('shopping')->getUserTaxFree()){
|
||||
Yard::setTax($cartItem->rowId, 0);
|
||||
}else{
|
||||
Yard::setTax($cartItem->rowId, $product->getTaxWith(Yard::instance('shopping')->getUserCountry()));
|
||||
}
|
||||
Yard::instance('shopping')->reCalculateShippingPrice();
|
||||
|
||||
\Session()->flash('show-card-after-add', true);
|
||||
|
|
@ -74,6 +84,8 @@ class CardController extends Controller
|
|||
}
|
||||
$data = [
|
||||
'user_shop' => Util::getUserShop(),
|
||||
'mylangs' => Shop::getLangChange(),
|
||||
|
||||
];
|
||||
return view('web.templates.card', $data);
|
||||
}
|
||||
|
|
@ -103,6 +115,8 @@ class CardController extends Controller
|
|||
|
||||
$data = [];
|
||||
$data['is_from'] = 'shopping';
|
||||
$data['user_price_infos'] = Yard::instance('shopping')->getUserPriceInfos();
|
||||
|
||||
|
||||
ShoppingInstance::create([
|
||||
'identifier' => $identifier,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue