View Single Post
  #1  
Old 11-26-2019, 10:39 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Discount on individual order

I would like to make discounts "manually" on individual order in my module, just as one can do in the admin page for order editing. I am aware that
a correct way would be to set up "surcharges/modifiers". However, a quick look at the
xcart table structure reveals that the table xc_order_items have columns
itemNetPrice and discountedSubtotal. So, I thought it would suffice to modify these columns (and of course, the total in xc_order). However, if I change manually the
content of the table

Code:
$item -> getItemNetPrice()
doesn't reflect the change I made. But
Code:
$item ->getDiscountedSubtotal()
gives the value in the table. Is there any way to implement this idea?
When one edits the orders in admin page, one simply modifies the column "price", but I would like to leave that column unchanged.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote