main system
This commit is contained in:
parent
0baac018a2
commit
a96d7d5c77
115 changed files with 4589 additions and 557 deletions
|
|
@ -19,7 +19,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 = [];
|
||||
|
|
@ -52,9 +52,9 @@ class Yard extends Cart
|
|||
$this->shipping_is_for = $this->getYardExtra('shipping_is_for');
|
||||
}
|
||||
|
||||
if($this->getYardExtra('num_comp')){
|
||||
/*if($this->getYardExtra('num_comp')){
|
||||
$this->num_comp = $this->getYardExtra('num_comp');
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
parent::__construct($session, $events);
|
||||
|
|
@ -146,12 +146,13 @@ class Yard extends Cart
|
|||
return;
|
||||
}
|
||||
$shipping = $shippingCountry->shipping;
|
||||
|
||||
if($this->weight() == 0){
|
||||
$shipping_price = $shipping->shipping_prices->first();
|
||||
$shipping_price->price = 0;
|
||||
$shipping_price->price_comp = 0;
|
||||
}else{
|
||||
|
||||
|
||||
//first by price
|
||||
$shipping_price = $this->shippingPriceByTotal($shipping->shipping_prices, $this->total(2, '.', ''));
|
||||
//sec by weight
|
||||
|
|
@ -160,23 +161,24 @@ class Yard extends Cart
|
|||
}
|
||||
//default
|
||||
if(!$shipping_price){
|
||||
|
||||
$shipping_price = $shipping->shipping_prices->first();
|
||||
}
|
||||
}
|
||||
if($shipping_price){
|
||||
$price = $shipping_price->price;
|
||||
$this->num_comp = 0;
|
||||
/*$this->num_comp = 0;
|
||||
if($this->shipping_is_for === 'me'){
|
||||
$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);
|
||||
|
|
@ -419,7 +421,7 @@ class Yard extends Cart
|
|||
}
|
||||
|
||||
public function getNumComp(){
|
||||
return $this->num_comp;
|
||||
return 0; //$this->num_comp;
|
||||
}
|
||||
|
||||
public function getCompProductBy($comp, $product_id=false){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue