Komp / Max Produkt,
This commit is contained in:
parent
a4c76d06fa
commit
78f43169c8
19 changed files with 347 additions and 51 deletions
|
|
@ -22,7 +22,7 @@ class Yard extends Cart
|
|||
private $shipping_tax = 0;
|
||||
private $shipping_country_id = 0; //default de
|
||||
private $shipping_is_for;
|
||||
//private $num_comp;
|
||||
private $num_comp;
|
||||
private $ysession;
|
||||
private $yinstance;
|
||||
private $shopping_data = [];
|
||||
|
|
@ -87,9 +87,9 @@ class Yard extends Cart
|
|||
$this->global_tax_rate = config('cart.tax');
|
||||
}
|
||||
|
||||
/*if($this->getYardExtra('num_comp')){
|
||||
if($this->getYardExtra('num_comp')){
|
||||
$this->num_comp = $this->getYardExtra('num_comp');
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
parent::__construct($session, $events);
|
||||
|
|
@ -164,7 +164,10 @@ class Yard extends Cart
|
|||
return $this->ysession->get($this->yinstance);
|
||||
}
|
||||
|
||||
|
||||
public function reCalculateShippingPrice(){
|
||||
$this->calculateShippingPrice();
|
||||
}
|
||||
|
||||
public function reCalculate(){
|
||||
$this->calculateShippingPrice();
|
||||
}
|
||||
|
|
@ -328,18 +331,23 @@ class Yard extends Cart
|
|||
}
|
||||
if($shipping_price){
|
||||
$price = $shipping_price->price;
|
||||
/*$this->num_comp = 0;
|
||||
if($this->shipping_is_for === 'me'){
|
||||
$this->num_comp = 0;
|
||||
|
||||
if($this->shipping_is_for === 'me' && \App\Models\Setting::getContentBySlug('order_partner_is_comp_me')){
|
||||
$price = $shipping_price->price_comp;
|
||||
$this->num_comp = $shipping_price->num_comp;
|
||||
}
|
||||
if($this->shipping_is_for === 'ot' && \App\Models\Setting::getContentBySlug('order_partner_is_comp_ot')){
|
||||
$price = $shipping_price->price_comp;
|
||||
$this->num_comp = $shipping_price->num_comp;
|
||||
}
|
||||
|
||||
}*/
|
||||
$this->shipping_price = $price;
|
||||
$this->shipping_tax_rate = $shipping_price->tax_rate;
|
||||
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
|
||||
$this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
|
||||
|
||||
//$this->putYardExtra('num_comp', $this->num_comp);
|
||||
$this->putYardExtra('num_comp', $this->num_comp);
|
||||
$this->putYardExtra('shipping_price', $this->shipping_price);
|
||||
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
|
||||
$this->putYardExtra('shipping_tax', $this->shipping_tax);
|
||||
|
|
@ -627,7 +635,7 @@ class Yard extends Cart
|
|||
}
|
||||
|
||||
public function getNumComp(){
|
||||
return 0; //$this->num_comp;
|
||||
return $this->num_comp;
|
||||
}
|
||||
|
||||
public function getCompProductBy($comp, $product_id=false){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue