shoppingflux / shoppingfluxexport

7 stars 7 forks source link

Orders duplicated when forcing order replay from debug.php #367

Open ghost opened 6 years ago

ghost commented 6 years ago

Expected behaviour

When replaying an order from debug.php only a single order should be created

Actual behaviour

The order is duplicated. The reason is linked to the loop on tokens. An order is being created for each token. In order to change this behavior we should for example select the token linked to the order in debug.php. This way the order will be created only for the token matching the one in the loop.

Steps to reproduce the behaviour

Replay an order from debug.php

ghost commented 6 years ago

Possible code. To be tested:

if (! $forcedOrder) {
    [...]
} else {
    if($currentToken['token'] !== $this->getTokenValue()){
        continue;
    }
    $orders = array($forcedOrder);
}