update total service

This commit is contained in:
Edward Yang 2022-07-27 14:57:14 +08:00
parent a7a8c5c844
commit 72ff8f34bb
4 changed files with 41 additions and 4 deletions

View File

@ -11,10 +11,14 @@
namespace Beike\Shop\Services; namespace Beike\Shop\Services;
use \Beike\Shop\Services\TotalServices;
use Illuminate\Support\Str;
class TotalService class TotalService
{ {
const TOTAL_CODES = [ const TOTAL_CODES = [
'subtotal', 'subtotal',
'tax',
'shipping', 'shipping',
'total' 'total'
]; ];
@ -26,11 +30,11 @@ class TotalService
{ {
$totals = []; $totals = [];
foreach (self::TOTAL_CODES as $code) { foreach (self::TOTAL_CODES as $code) {
$totals[] = 11; $serviceName = Str::studly($code);
$service = "TotalServices\{$serviceName}";
$totals[] = $service::getTotal();
} }
// hook= [subtotal, shipping] return $totals;
return [];
} }
} }

View File

@ -9,7 +9,13 @@
* @created 2022-07-22 17:58:14 * @created 2022-07-22 17:58:14
* @modified 2022-07-22 17:58:14 * @modified 2022-07-22 17:58:14
*/ */
namespace Beike\Shop\Services\TotalServices;
class ShippingService class ShippingService
{ {
public static function getTotal()
{
}
} }

View File

@ -9,7 +9,13 @@
* @created 2022-07-22 17:58:25 * @created 2022-07-22 17:58:25
* @modified 2022-07-22 17:58:25 * @modified 2022-07-22 17:58:25
*/ */
namespace Beike\Shop\Services\TotalServices;
class SubtotalService class SubtotalService
{ {
public static function getTotal()
{
}
} }

View File

@ -0,0 +1,21 @@
<?php
/**
* TaxService.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-07-27 14:24:05
* @modified 2022-07-27 14:24:05
*/
namespace Beike\Shop\Services\TotalServices;
class TaxService
{
public static function getTotal()
{
}
}