-
Notifications
You must be signed in to change notification settings - Fork 53
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
PISHPS-311: added custom event and cart collector for subscriptions #801
Conversation
@BlackScorp can be tested with this patch Index: src/Subscriber/OrderDeliverySubscriber.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Subscriber/OrderDeliverySubscriber.php b/src/Subscriber/OrderDeliverySubscriber.php
--- a/src/Subscriber/OrderDeliverySubscriber.php (revision 9e1fa93e083290440433789acf788843ef0cf41a)
+++ b/src/Subscriber/OrderDeliverySubscriber.php (date 1723028422423)
@@ -3,6 +3,7 @@
namespace Kiener\MolliePayments\Subscriber;
use Kiener\MolliePayments\Components\ShipmentManager\ShipmentManager;
+use Kiener\MolliePayments\Event\MollieSubscriptionCartItemAddedEvent;
use Kiener\MolliePayments\Repository\OrderTransaction\OrderTransactionRepositoryInterface;
use Kiener\MolliePayments\Service\OrderService;
use Kiener\MolliePayments\Service\SettingsService;
@@ -64,6 +65,7 @@
{
return [
'state_machine.order_delivery.state_changed' => 'onOrderDeliveryChanged',
+ MollieSubscriptionCartItemAddedEvent::class => 'test'
];
}
@@ -123,4 +125,9 @@
return;
}
}
+
+ public function test(MollieSubscriptionCartItemAddedEvent $event)
+ {
+ $a = 1;
+ }
} |
*/ | ||
private function lineItemIsSubscriptionProduct(CheckoutCartLineItem $lineItem): bool | ||
{ | ||
$customFields = $lineItem->getPayloadValue('customFields'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use here LineItemAttributes the class accepts lineItem as constructor parameter and has a method to define if the line item is subscription
…determine if a product is a subscription product
use Kiener\MolliePayments\Struct\LineItem\LineItemAttributes; | ||
use Shopware\Core\Checkout\Cart\LineItem\LineItem as CheckoutCartLineItem; | ||
|
||
class SubscriptionProductIdentifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we dont need the interface here, just use the attribute class
No description provided.