checkout, register, payment,
checkout correction, register wizard, payment packege,
This commit is contained in:
parent
6e3adac4d7
commit
446bc4561b
48 changed files with 2580 additions and 1493 deletions
|
|
@ -12,7 +12,7 @@ use Illuminate\Support\Collection;
|
|||
class Yard extends Cart
|
||||
{
|
||||
private $shipping = 0;
|
||||
private $shipping_country_id = 7; //default de
|
||||
private $shipping_country_id = 0; //default de
|
||||
private $ysession;
|
||||
private $yinstance;
|
||||
|
||||
|
|
@ -30,9 +30,13 @@ class Yard extends Cart
|
|||
|
||||
parent::__construct($session, $events);
|
||||
|
||||
if($this->shipping_country_id == 0){
|
||||
$shippingCountry = ShippingCountry::first();
|
||||
$this->shipping_country_id = $shippingCountry->id;
|
||||
|
||||
}
|
||||
if($this->shipping == 0){
|
||||
self::instance('shopping')->setShippingCountryWithPrice($this->shipping_country_id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -90,10 +94,12 @@ class Yard extends Cart
|
|||
if($shipping_country_id > 0){
|
||||
$shippingCountry = ShippingCountry::find($shipping_country_id);
|
||||
$shipping = $shippingCountry->shipping;
|
||||
if($this->weight()){
|
||||
//blance by weigt
|
||||
if($this->weight() == 0){
|
||||
$price = $shipping->prices->first();
|
||||
$price->price = 0;
|
||||
}else{
|
||||
$price = $shipping->prices->first();
|
||||
}
|
||||
$price = $shipping->prices->first();
|
||||
if($price){
|
||||
$this->shipping = floatval($price->price);
|
||||
$this->putShippingExtra('shipping_price', $this->shipping);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue