Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filter of orders by status #18

Closed
ddattee opened this issue Apr 20, 2018 · 3 comments
Closed

Allow filter of orders by status #18

ddattee opened this issue Apr 20, 2018 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@ddattee
Copy link
Contributor

ddattee commented Apr 20, 2018

I should be able to filter order by status

@ddattee ddattee added the enhancement New feature or request label Apr 20, 2018
@ddattee ddattee added this to the v0.2 milestone Apr 20, 2018
@ddattee ddattee changed the title Allow filter of orders by status Allow filter of orders by order attribute Apr 20, 2018
@ddattee ddattee changed the title Allow filter of orders by order attribute Allow filter of orders by status Apr 20, 2018
@ddattee
Copy link
Contributor Author

ddattee commented May 30, 2018

@ronan-gloo I propose to allow to add filtering that way :

$orderDomain = $store->getOrderApi();
$orderDomain->setfilter(
    [
        'status' => 'shipped'
    ]
);
foreach($orderDomain->getPages() as $order) {
    // Will retrieve filtered items
}

and add easier interface to retrieve filtered orders

foreach($orderDomain->getShippedOrders() as $order) {
    // Will retrieve filtered items
}

@ronan-gloo
Copy link
Contributor

Non, car on a une conservation de l'état entre deux calls, qui va provoquer des effets de bord.
C'est mieux de passer les contraintes en paramètres de fonction

@ddattee
Copy link
Contributor Author

ddattee commented May 30, 2018

Ok directyl like this then :

$criterias = [
   'page'    => 1,
   'limit'   => 5,
   'filters' => [
        'status'    => ['shipped','created'],
        'createdAt' => date_create('now')
    ]
];
foreach($orderDomain->getPages($criterias) as $order) {
    // Will retrieve filtered items
}

ddattee pushed a commit to ddattee/php-sdk that referenced this issue May 31, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue May 31, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue May 31, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue May 31, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue May 31, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue May 31, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 1, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 1, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 1, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 1, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 1, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 1, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 1, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 4, 2018
…ce in constructor, setting $reference as optionnal, better count method, renaming exception method, updating ut
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 4, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee pushed a commit to ddattee/php-sdk that referenced this issue Jun 6, 2018
ddattee added a commit that referenced this issue Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants