08 2024
This commit is contained in:
parent
04d677d37a
commit
bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
namespace App\Services;
|
||||
|
||||
use App\Services\Shop;
|
||||
use App\Models\Country;
|
||||
use App\Models\Product;
|
||||
use App\Models\ShippingCountry;
|
||||
|
|
@ -136,6 +137,12 @@ class Yard extends Cart
|
|||
}
|
||||
|
||||
|
||||
public function getShippingPrice()
|
||||
{
|
||||
return $this->shipping_price;
|
||||
}
|
||||
|
||||
|
||||
public function getYContent()
|
||||
{
|
||||
if (is_null($this->ysession->get($this->yinstance))) {
|
||||
|
|
@ -149,7 +156,7 @@ class Yard extends Cart
|
|||
$this->calculateShippingPrice();
|
||||
}
|
||||
|
||||
public function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot')
|
||||
public function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot-member')
|
||||
{
|
||||
$this->shipping_country_id = $shipping_country_id;
|
||||
$this->putYardExtra('shipping_country_id', $shipping_country_id);
|
||||
|
|
@ -208,6 +215,15 @@ class Yard extends Cart
|
|||
return $this->shipping_free;
|
||||
}
|
||||
|
||||
public function getShippingFreeMissingValue()
|
||||
{
|
||||
if($this->shipping_free && $this->total(2, '.', '') < $this->shipping_free){
|
||||
return $this->shipping_free - $this->total(2, '.', '');
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
private function calculateShippingPrice(){
|
||||
|
||||
$shippingCountry = ShippingCountry::find($this->shipping_country_id);
|
||||
|
|
@ -246,8 +262,8 @@ 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; //compensation is checked in Settings
|
||||
if(Shop::isCompProducts($this->shipping_is_for)){
|
||||
$price = $shipping_price->price_comp;
|
||||
$this->num_comp = $shipping_price->num_comp;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue