|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/globalaudiovideo/shop.globalaudiovideo.co.in/app/Services/ |
Upload File : |
<?php
namespace App\Services;
class OrderDetailsService
{
public function getPOSOrderDetailsData(int|string $orderId, array $item, object $product, float $price, float $tax): array
{
return [
'order_id' => $orderId,
'product_id' => $item['id'],
'product_details' => $product,
'qty' => $item['quantity'],
'price' => $price,
'seller_id' => $product['user_id'],
'tax' => $tax * $item['quantity'],
'tax_model' => $product['tax_model'],
'discount' => $item['discount'] * $item['quantity'],
'discount_type' => 'discount_on_product',
'delivery_status' => 'delivered',
'payment_status' => 'paid',
'variant' => $item['variant'],
'variation' => json_encode($item['variations']),
'created_at' => now(),
'updated_at' => now()
];
}
}