-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PISHPS-311: SubscriptionCartCollector now uses LineItemAttributes to …
…determine if a product is a subscription product
- Loading branch information
1 parent
9e1fa93
commit ac7bb09
Showing
4 changed files
with
42 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Service/Cart/Subscription/SubscriptionProductIdentifier.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Kiener\MolliePayments\Service\Cart\Subscription; | ||
|
||
use Kiener\MolliePayments\Struct\LineItem\LineItemAttributes; | ||
use Shopware\Core\Checkout\Cart\LineItem\LineItem as CheckoutCartLineItem; | ||
|
||
class SubscriptionProductIdentifier | ||
{ | ||
/** | ||
* Checks if a line item is a subscription product. | ||
* | ||
* @param CheckoutCartLineItem $lineItem | ||
* @return bool | ||
*/ | ||
public function isSubscriptionProduct(CheckoutCartLineItem $lineItem): bool | ||
{ | ||
return (new LineItemAttributes($lineItem))->isSubscriptionProduct(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters