sarga/packages/Webkul/Shipping/src/Carriers/FlatRate.php

38 lines
790 B
PHP
Raw Normal View History

2018-09-13 11:10:45 +00:00
<?php
2018-09-19 06:58:15 +00:00
namespace Webkul\Shipping\Carriers;
2018-09-13 11:10:45 +00:00
use Config;
2018-09-20 10:01:51 +00:00
use Webkul\Cart\Models\CartShipping;
use Webkul\Shipping\Facades\Shipping;
2018-09-13 11:10:45 +00:00
/**
* Class Rate.
*
*/
class FlatRate extends AbstractShipping
{
2018-09-20 10:01:51 +00:00
/**
* Payment method code
*
* @var string
*/
protected $code = 'flatrate';
2018-09-13 11:10:45 +00:00
public function calculate()
{
if(!$this->isAvailable())
return false;
2018-09-20 10:01:51 +00:00
$object = new CartShipping;
$object->carrier = 'flatrate';
$object->carrier_title = $this->getConfigData('title');
$object->method = 'flatrate_flatrate';
2018-09-20 10:01:51 +00:00
$object->method_title = $this->getConfigData('title');
$object->method_description = $this->getConfigData('description');
$object->price = 10;
return $object;
2018-09-13 11:10:45 +00:00
}
}