-
Notifications
You must be signed in to change notification settings - Fork 97
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
CC-34932 Add Merchant Promotions & Discount feature IG #2990
Changes from 1 commit
ca32ca1
6ed95d4
a73618b
86c8537
71695a8
f6ebb4f
bdf8b72
2a33ea9
0189a6f
60377b6
b690880
6943b35
8d8a37d
c0c15c8
d86bdfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,85 @@ | ||||||
This document describes how to install the Merchant + Promotions & Discounts feature. | ||||||
|
||||||
## Install feature core | ||||||
|
||||||
Follow the steps below to install the feature core. | ||||||
|
||||||
### Prerequisites | ||||||
|
||||||
Install the required features: | ||||||
|
||||||
| NAME | VERSION | INSTALLATION GUIDE | | ||||||
|------------------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||||||
| Marketplace Merchant | {{page.version}} | [Install the Marketplace Merchant feature](/docs/pbc/all/merchant-management/{{page.version}}/marketplace/install-and-upgrade/install-features/install-the-marketplace-merchant-feature.html) | | ||||||
| Promotions & Discounts | {{page.version}} | [Install the Promotions & Discounts feature](/docs/pbc/all/discount-management/{{page.version}}/base-shop/install-and-upgrade/install-features/install-the-promotions-and-discounts-feature.html) | | ||||||
| Spryker Core | {{page.version}} | [Install the Spryker Core feature](/docs/pbc/all/miscellaneous/{{page.version}}/install-and-upgrade/install-features/install-the-spryker-core-feature.html) | | ||||||
|
||||||
### 1) Install the required modules | ||||||
|
||||||
Install the required modules using Composer: | ||||||
|
||||||
```bash | ||||||
composer require spryker/merchant-discount-connector:"^1.0.0" --update-with-dependencies | ||||||
``` | ||||||
|
||||||
{% info_block warningBox "Verification" %} | ||||||
|
||||||
Make sure the following modules have been installed: | ||||||
|
||||||
| MODULE | EXPECTED DIRECTORY | | ||||||
|---------------------------|--------------------------------------------| | ||||||
| MerchantDiscountConnector | vendor/spryker/merchant-discount-connector | | ||||||
|
||||||
{% endinfo_block %} | ||||||
|
||||||
### 2) Set up behavior | ||||||
|
||||||
Set up the following behaviors: | ||||||
|
||||||
| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE | | ||||||
|--------------------------------------------------|------------------------------------------------------------------------------------------|---------------|---------------------------------------------------------------------| | ||||||
| MerchantReferenceDecisionRulePlugin | Defines if a discount can be applied to a cart item with a merchant reference specified. | | Spryker\Zed\MerchantDiscountConnector\Communication\Plugin\Discount | | ||||||
| MerchantReferenceDiscountableItemCollectorPlugin | Collects the cart items with merchant reference to which a discount should be applied. | | Spryker\Zed\MerchantDiscountConnector\Communication\Plugin\Discount | | ||||||
|
||||||
**src/Pyz/Zed/Discount/DiscountDependencyProvider.php** | ||||||
|
||||||
```php | ||||||
<?php | ||||||
|
||||||
namespace Pyz\Zed\Discount; | ||||||
|
||||||
use Spryker\Zed\Discount\DiscountDependencyProvider as SprykerDiscountDependencyProvider; | ||||||
use Spryker\Zed\MerchantDiscountConnector\Communication\Plugin\Discount\MerchantReferenceDecisionRulePlugin; | ||||||
use Spryker\Zed\MerchantDiscountConnector\Communication\Plugin\Discount\MerchantReferenceDiscountableItemCollectorPlugin; | ||||||
|
||||||
class DiscountDependencyProvider extends SprykerDiscountDependencyProvider | ||||||
{ | ||||||
/** | ||||||
* @return list<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DecisionRulePluginInterface> | ||||||
*/ | ||||||
protected function getDecisionRulePlugins(): array | ||||||
{ | ||||||
return array_merge(parent::getDecisionRulePlugins(), [ | ||||||
new MerchantReferenceDecisionRulePlugin(), | ||||||
]); | ||||||
} | ||||||
|
||||||
/** | ||||||
* @return list<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountableItemCollectorPluginInterface> | ||||||
*/ | ||||||
protected function getCollectorPlugins(): array | ||||||
{ | ||||||
return array_merge(parent::getCollectorPlugins(), [ | ||||||
new MerchantReferenceDiscountableItemCollectorPlugin(), | ||||||
]); | ||||||
} | ||||||
} | ||||||
``` | ||||||
|
||||||
{% info_block warningBox "Verification" %} | ||||||
|
||||||
1. [Create a discount](/docs/pbc/all/discount-management/{{site.version}}/base-shop/manage-in-the-back-office/create-discounts.html) and define its condition as a query string with a `merchant-refernce` field. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
2. Add a product sold by the defined merchant to the cart. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
How about something like this? Now it is not very clear what defined merchant means |
||||||
3. Verify that the discount is applied to the cart. | ||||||
|
||||||
{% endinfo_block %} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,8 @@ | ||||||
--- | ||||||
title: Install the Merchant + Promotions & Discounts feature | ||||||
description: Learn how to integrate the Merchant + Promotions & Discounts feature into a Spryker project. | ||||||
last_updated: Dec 16, 2024 | ||||||
template: feature-integration-guide-template | ||||||
--- | ||||||
|
||||||
{% include pbc/all/install-features/{{page.version}}/install-the-merchant-promotions-and-discounts-feature.md %} <!-- To edit, see /_includes/pbc/all/install-features/202505.0/install-the-merchant-promotions-and-discounts-feature.md --> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
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.
Should this connector be called
Marketplace Merchant + Promotions & Discounts feature
?