Skip to content

Commit

Permalink
RATEPLUG-27: fix batch processing (admin) (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy authored Nov 18, 2019
1 parent edf1cc9 commit e6185d8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Bootstrapping/Events/OrderOperationsSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,21 @@ public function onBidirectionalSendOrderOperation(\Enlight_Hook_HookArgs $argume
*/
public function afterOrderBatchProcess(\Enlight_Hook_HookArgs $arguments)
{
$request = $arguments->getSubject()->Request();

$config = Shopware()->Plugins()->Frontend()->RpayRatePay()->Config();

if (!$config->get('RatePayBidirectional')) {
return;
}
$controller = $arguments->getSubject();

$orders = $request->getParam('orders');
$orders = $controller->Request()->getParam('orders', []);
$singleOrderId = $controller->Request()->getParam('id', null);

if (count($orders) < 1 && empty($singleOrderId)) {
return;
}

if (count($orders) < 1) {
throw new \Exception('No order selected');
if (count($orders) == 0) {
$orders = [['id' => $singleOrderId]];
}

foreach ($orders as $order) {
Expand Down

0 comments on commit e6185d8

Please sign in to comment.