View Single Post
  #6  
Old 10-01-2019, 11:34 PM
 
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, I really should "reread" my codes (well, I did, lots of times). It was a matter of misplaced braces.


So, somehow I can't do things like
Code:
public function markAsOrder() { if (isfake) {parent::markAsCart();} else parent::markAsOrder(); }
, this leading to an error (no such property, function name must start...)


Thus I had to reproduce the entire processSucceed function with the if clause
at the beginning. In any case, it works like a charm. Now my question is, why does this work in the first place? For example, how come we don't see these fake orders in order list page?


The order list page in the admin area uses the widget XLite/View/ItemsList/Model/Order/Admin/Search.php. This class, contains nothing about the property is_order. I also noticed that when is_order=0, there is no orderNumber, but then again, this property is used everywhere to sort orders, but there is no search condition that requires orderNumber not to be null. I saw that in the class Model/Repo/Order.php
"alternativeIdentifier" is defined to be orderNumber, so I deorated in Module/Vendor/Repo/Order.php
Code:
<?php namespace XLite\Module\Vendor\Module\Model\Repo abstract class Order extends \XLite\Model\Repo\Order implements \XLite\Base\IDecorator { protected $alternativeIdentifier = array( array('orderId'), ); }
but no fake orders are shown in the list. So, what is going on?


If I wanted to fake orders in the order list among the real ones, what would I have to do? It is not that I need, but this mystery really bothers me.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote