Skip to content

Commit

Permalink
Avoid DB requests if no products are in the basket
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Oct 6, 2021
1 parent 1be6ca3 commit 6766e82
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public function register( \Aimeos\MW\Observer\Publisher\Iface $p ) : \Aimeos\MW\
*/
public function update( \Aimeos\MW\Observer\Publisher\Iface $order, string $action, $value = null )
{
if( ( is_int( $value ) && ( $value & \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT ) ) === 0 ) {
if( ( is_int( $value ) && ( $value & \Aimeos\MShop\Order\Item\Base\Base::PARTS_PRODUCT ) ) === 0
|| $order->getProducts() === []
) {
return $value;
}

Expand Down

0 comments on commit 6766e82

Please sign in to comment.