View Single Post
  #3  
Old 09-28-2019, 12:04 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: "Fake" orders (or how do a cart become an order ?)

Thank you very much. O.K, I got that
There is a function markAsOrder in the Model/Repo/Cart.php
which is used in Model/Cart.php
Code:
/** * Mark cart as order * * @return void */ public function markAsOrder() { parent::markAsOrder(); if ($this instanceof \XLite\Model\Cart) { $this->assignOrderNumber(); } $this->getRepository()->markAsOrder($this->getOrderId()); }
which in turn is called in Model/Order.php

Code:
public function processSucceed() { $this->markAsOrder(); ....


So I presume I only would have to modify somewhere in the chain the value of is_order, I am done? And probably the simplest thing is to decorate Model/Order.php to have something like
Code:
public function processSucceed() { if (!isFake()) { $this->markAsOrder(); } ....
And maybe to be on the safe side, I can add couple of lines to set is_order=0 when I have a fake order?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote