Jump to content

Shruthi

Members
  • Posts

    1
  • Joined

  • Last visited

5 Followers

Profile Information

  • First Name
    Shruthi
  • Last Name
    S M

Shruthi's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. First I will create a voucher which gives 10% discount on the final amount of the product We are giving 5000 credit cash for each registered customer in our website...The customer can use the voucher until 5000 rupees got over. when the order got placed using the above mentioned voucher I want to display the discount amount deducted from the 5000 example for first order discount is 500(5000-500=4500 I should get ) for the first time of the voucher used For the second order using the same voucher if the customer get 10% discount suppose the discount amount is 400 amount should be (4500-400(discont amount of the second order)= 4100) likewise 4100-.... To achieve this I tried in classes/PaymentModule.php $order->total_paid_tax_excl = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(false, Cart::BOTH, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_); $order->total_paid_tax_incl = (float)Tools::ps_round((float)$this->context->cart->getOrderTotal(true, Cart::BOTH, $order->product_list, $id_carrier), _PS_PRICE_COMPUTE_PRECISION_); $order->total_paid = $order->total_paid_tax_incl; $order->round_mode = Configuration::get('PS_PRICE_ROUND_MODE'); $order->round_type = Configuration::get('PS_ROUND_TYPE'); $order->gcash_dis=5000-$order->total_discounts; $order->invoice_date = '0000-00-00 00:00:00'; But I am not getting any data in ps_orders table and I tried to get the discount amount by joining two tables cart_rule table with the order_cart_rule table $query = ' SELECT ocr.value AS discount,cr.code FROM `'._DB_PREFIX_.'order_cart_rule` ocr LEFT JOIN `'._DB_PREFIX_.'cart_rule ` cr ON (ocr.id_cart_rule = cr.id_cart_rule)'; return Db::getInstance()->executeS($query); not geting the way So how to do this
×
×
  • Create New...