mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
fix the build
This commit is contained in:
parent
d37daa380f
commit
dd39c91755
2 changed files with 8 additions and 4 deletions
|
|
@ -8,7 +8,6 @@ Feature: Receiving discounts with product minimum price specified
|
|||
Given the store operates on a single channel in "United States"
|
||||
And the store ships everywhere for Free
|
||||
And the store allows paying Offline
|
||||
And I am a logged in customer
|
||||
And the store classifies its products as "T-Shirts"
|
||||
And the store has a "T-Shirt" configurable product
|
||||
And this product has "PHP T-Shirt" variant priced at "$50.00"
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ final class OrderAdjustmentsVoter extends Voter
|
|||
|
||||
protected function supports(string $attribute, mixed $subject): bool
|
||||
{
|
||||
return $subject instanceof Collection;
|
||||
return $subject instanceof Collection || $subject instanceof AdjustmentInterface;
|
||||
}
|
||||
|
||||
public function supportsAttribute(string $attribute): bool
|
||||
|
|
@ -48,8 +48,13 @@ final class OrderAdjustmentsVoter extends Voter
|
|||
/** @var OrderInterface $order */
|
||||
$order = $item->getOrder();
|
||||
} else {
|
||||
/** @var OrderInterface $order */
|
||||
$order = $item->getOrderItem()->getOrder();
|
||||
if ($item->getOrderItem()){
|
||||
/** @var OrderInterface $order */
|
||||
$order = $item->getOrderItem()->getOrder();
|
||||
} else {
|
||||
/** @var OrderInterface $order */
|
||||
$order = $item->getOrderItemUnit()->getOrderItem()->getOrder();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$order->isCreatedByGuest() || $order->getUser()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue