my code
catalog/controller/checkout/confirm.php
Code: Select all
//-----------------------------------------------------Custom Code
$total_owner_profit = 0;
$total_customer_profit = 0;
//-----------------------------------------------------custom Code
//-----------------------------------------------------Custom Code
$this->load->model('catalog/product');
$product_info = $this->model_catalog_product->getProduct($product['product_id']);
$this->load->model('account/customer');
$customer_info = $this->model_account_customer->getCustomer($this->customer->getId());
$owner_profit = 0;
$customer_profit = 0;
if($product_info['base_price'])
{
if($customer_info['parent_id'] || $customer_info['customer_group_id']==2 || $customer_info['customer_group_id']==3 || $customer_info['customer_group_id']==4)
{
$retailer_profit = ($product['price']-$product_info['base_price'])*$product['quantity'];
$customer_profit = ($retailer_profit*70/100);
$owner_profit = ($retailer_profit*30/100);
}
}
$total_owner_profit+= $owner_profit;
$total_customer_profit+= $customer_profit;
$total_shipping_price+= $shipping_price;
//-----------------------------------------------------Custom Code
//-----------------------------------------------------Custom Code
'base_price' => $product_info['base_price'],
'shipping_price' => $product_info['shipping_price'],
'owner_profit' => $owner_profit,
'customer_profit' => $customer_profit,
//-----------------------------------------------------Custom Code
//-----------------------------------------------------Custom Code
$order_data['total_owner_profit'] = $total_owner_profit;
$order_data['total_customer_profit'] = $total_customer_profit;
$order_data['total_shipping_price'] = $total_shipping_price;
//-----------------------------------------------------Custom Code