Fixed trashed products.

This commit is contained in:
Edward Yang 2023-03-17 11:30:16 +08:00
parent 439be0068e
commit 5831ea962d
2 changed files with 7 additions and 5 deletions

View File

@ -45,12 +45,14 @@ class ProductController extends Controller
$requestData = $request->all();
$requestData['trashed'] = true;
$productList = ProductRepo::list($requestData);
$products = ProductResource::collection($productList)->resource;
$products = ProductResource::collection($productList);
$productsFormat = $products->jsonSerialize();
$data = [
'categories' => CategoryRepo::flatten(locale()),
'products' => $products,
'type' => 'trashed',
'categories' => CategoryRepo::flatten(locale()),
'products_format' => $productsFormat,
'products' => $products,
'type' => 'trashed',
];
$data = hook_filter('admin.product.trashed.data', $data);

View File

@ -64,7 +64,7 @@ class TotalService
{
$addressInfo = [
'shipping_address' => $this->currentCart->shippingAddress ?? $this->currentCart->guest_shipping_address,
'payment_address' => $this->currentCart->paymentAddress ?? $this->currentCart->guest_payment_address,
'payment_address' => $this->currentCart->paymentAddress ?? $this->currentCart->guest_payment_address,
];
$taxLib = Tax::getInstance($addressInfo);