View Single Post
  #4  
Old 12-05-2019, 01:47 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Discount on individual order

Quote:
Originally Posted by Ed B.
It is precisely this kind of details that makes me finding a "shortcut" to "XC way". So,
basically I would need, besides the usual classes (Viewer, Controller, whatever is needed
to get forms), a Model class to decorate /Model/Order/Surcharge.php, and a class extending Logic/Order/Modifier/Discount.php, or am I still missing something?

I certainly was missing Model/OrderItem/Surcharge.php class! But how do I use this? I haven't found a single example.







Quote:
Originally Posted by Ed B.
OK, so let's forget about the netPrice column, although I wonder why it is there if it is the result of calculation. At least for one of the modules I am writing, I don't mind changing the values of "price" column in OrderItem table, which is actually done in XC's stock class.




I realized that in XC5.3, orders couldn't be edited on admin order detail page (admin.php?target=order&order_number=..." whereas in XC5.4 they can. So there must be something new in XC5.4. However, I compared the codes of the classes

Model/OrderItem.php, View/ItemsList/OrderItem.php Controller/Admin/Order.php in two versions to find out why orders are editable in XC5.4 and not in XC5.3. However, I don't really see anything. Does anyone know where the difference comes from?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote