cart responsive, Checkout from cart
This commit is contained in:
parent
bde1095014
commit
fb27009339
17 changed files with 501 additions and 319 deletions
|
|
@ -317,4 +317,15 @@ class HTMLHelper
|
|||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function getOptionRange($select, $from=1, $to=50){
|
||||
$values = range($from, $to);
|
||||
$ret = "";
|
||||
foreach ($values as $value){
|
||||
$attr = ($value == $select) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$value.'" '.$attr.'>'.$value.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -181,7 +181,9 @@ class Util
|
|||
|
||||
if(\Session::has('user_shop')){
|
||||
if(\Session::has('user_shop_domain')){
|
||||
|
||||
if(\Session::has('back_link')){
|
||||
return \Session::get('back_link');
|
||||
}
|
||||
if(self::getUserPaymentFor() === 3){
|
||||
return \Session::get('user_shop_domain')."/user/membership";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,25 +21,26 @@ class Yard extends Cart
|
|||
private $shipping_is_for;
|
||||
private $ysession;
|
||||
private $yinstance;
|
||||
private $shopping_data = [];
|
||||
|
||||
public function __construct(SessionManager $session, Dispatcher $events)
|
||||
{
|
||||
$this->ysession = $session;
|
||||
$this->yinstance = sprintf('%s.%s', 'cart', 'shipping_extras');
|
||||
if($this->getShippingExtra('shipping_price')){
|
||||
$this->shipping_price = (float) ($this->getShippingExtra('shipping_price'));
|
||||
if($this->getYardExtra('shipping_price')){
|
||||
$this->shipping_price = (float) ($this->getYardExtra('shipping_price'));
|
||||
}
|
||||
|
||||
if($this->getShippingExtra('shipping_tax')){
|
||||
$this->shipping_tax = (float) ($this->getShippingExtra('shipping_tax'));
|
||||
if($this->getYardExtra('shipping_tax')){
|
||||
$this->shipping_tax = (float) ($this->getYardExtra('shipping_tax'));
|
||||
}
|
||||
|
||||
if($this->getShippingExtra('shipping_country_id')){
|
||||
$this->shipping_country_id = $this->getShippingExtra('shipping_country_id');
|
||||
if($this->getYardExtra('shipping_country_id')){
|
||||
$this->shipping_country_id = $this->getYardExtra('shipping_country_id');
|
||||
}
|
||||
|
||||
if($this->getShippingExtra('shipping_is_for')){
|
||||
$this->shipping_is_for = $this->getShippingExtra('shipping_is_for');
|
||||
if($this->getYardExtra('shipping_is_for')){
|
||||
$this->shipping_is_for = $this->getYardExtra('shipping_is_for');
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -62,14 +63,14 @@ class Yard extends Cart
|
|||
return config('cart.tax');
|
||||
}
|
||||
|
||||
public function putShippingExtra($key, $value){
|
||||
public function putYardExtra($key, $value){
|
||||
|
||||
$content = $this->getYContent();
|
||||
$content->put($key, $value);
|
||||
$this->ysession->put($this->yinstance, $content);
|
||||
}
|
||||
|
||||
public function getShippingExtra($key){
|
||||
public function getYardExtra($key){
|
||||
$content = $this->getYContent();
|
||||
if ($content->has($key)){
|
||||
return $content->get($key);
|
||||
|
|
@ -116,10 +117,10 @@ class Yard extends Cart
|
|||
public function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot')
|
||||
{
|
||||
$this->shipping_country_id = $shipping_country_id;
|
||||
$this->putShippingExtra('shipping_country_id', $shipping_country_id);
|
||||
$this->putYardExtra('shipping_country_id', $shipping_country_id);
|
||||
|
||||
$this->shipping_is_for = $shipping_is_for;
|
||||
$this->putShippingExtra('shipping_is_for', $shipping_is_for);
|
||||
$this->putYardExtra('shipping_is_for', $shipping_is_for);
|
||||
|
||||
$this->calculateShippingPrice();
|
||||
|
||||
|
|
@ -160,10 +161,10 @@ class Yard extends Cart
|
|||
$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->putShippingExtra('shipping_price', $this->shipping_price);
|
||||
$this->putShippingExtra('shipping_tax_rate', $this->shipping_tax_rate);
|
||||
$this->putShippingExtra('shipping_tax', $this->shipping_tax);
|
||||
$this->putShippingExtra('shipping_price_net', $this->shipping_price_net);
|
||||
$this->putYardExtra('shipping_price', $this->shipping_price);
|
||||
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
|
||||
$this->putYardExtra('shipping_tax', $this->shipping_tax);
|
||||
$this->putYardExtra('shipping_price_net', $this->shipping_price_net);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue