Skip to content

Commit

Permalink
Merge pull request vindi#94 from cedran/master
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
cedran authored Jul 22, 2024
2 parents d735f5f + e45c9c4 commit c01bc38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Plugin/PreventAddProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ private function isSubscriptionProduct($product)
private function checkSubscriptionQuantity($requestInfo)
{
if (isset($requestInfo['qty']) && $requestInfo['qty'] > 1) {
$message = __('Each subscription product can be purchased only in a single unit per transaction.');
$this->messageManager->addWarningMessage(__('You can only purchase one unit of each subscription product per transaction. Please adjust the quantity.'));
$message = __('You can only purchase one unit of each subscription product per transaction. Please adjust the quantity.');
$this->messageManager->addWarningMessage($message);
throw new LocalizedException($message);
}
}
Expand All @@ -111,8 +111,8 @@ private function checkSubscriptionQuantity($requestInfo)
*/
private function preventMultipleSubscriptions()
{
$message = __('Your cart already contains a subscription product. Only one subscription product is allowed per transaction.');
$this->messageManager->addWarningMessage(__('Your cart already contains a subscription product. You can only add one subscription product per transaction. Please complete your current purchase or remove the existing subscription product to add a different one.'));
$message = __('Your cart already contains a subscription product. You can only add one subscription product per transaction. Please complete your current purchase or remove the existing subscription product to add a different one.');
$this->messageManager->addWarningMessage($message);
throw new LocalizedException($message);
}
}
Expand Down
12 changes: 12 additions & 0 deletions etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
<event_handlers>1</event_handlers>
</scripts>
</storefront_checkout_index_index>
<adminhtml_sales_order_create_index>
<scripts>
<inline>1</inline>
<event_handlers>1</event_handlers>
</scripts>
</adminhtml_sales_order_create_index>
<adminhtml_some_other_route>
<scripts>
<inline>1</inline>
<event_handlers>1</event_handlers>
</scripts>
</adminhtml_some_other_route>
</policies>
</csp>
<payment>
Expand Down

0 comments on commit c01bc38

Please sign in to comment.