-
-
Notifications
You must be signed in to change notification settings - Fork 16
Add recipes for B2B Kit 3.0 #44
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,20 @@ | ||
| imports: | ||
| - { resource: "@SyliusB2BKitPlugin/config/config.yaml" } | ||
|
|
||
| sylius_addressing: | ||
| resources: | ||
| address: | ||
| classes: | ||
| repository: App\Repository\AddressRepository | ||
|
|
||
| sylius_customer: | ||
| resources: | ||
| customer: | ||
| classes: | ||
| repository: App\Repository\CustomerRepository | ||
|
|
||
| sylius_order: | ||
| resources: | ||
| order: | ||
| classes: | ||
| repository: App\Repository\OrderRepository |
This file contains hidden or 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,2 @@ | ||
| sylius_b2b_suite: | ||
| resource: "@SyliusB2BKitPlugin/config/routes/routes.yaml" |
This file contains hidden or 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,38 @@ | ||
| { | ||
| "aliases": ["b2b-suite", "b2b-kit"], | ||
| "bundles": { | ||
| "OldSound\\RabbitMqBundle\\OldSoundRabbitMqBundle": ["all"], | ||
| "FOS\\ElasticaBundle\\FOSElasticaBundle": ["all"], | ||
| "BitBag\\SyliusElasticsearchPlugin\\BitBagSyliusElasticsearchPlugin": ["all"], | ||
| "Sylius\\B2BKit\\SyliusB2BKitPlugin": ["all"] | ||
| }, | ||
| "copy-from-recipe": { | ||
| "config/": "%CONFIG_DIR%/", | ||
| "src/": "%SRC_DIR%/" | ||
| }, | ||
| "add-lines": [ | ||
| { | ||
| "file": "assets/admin/entrypoint.js", | ||
| "content": "import '@vendor/sylius/b2b-kit/assets/admin/entrypoint';", | ||
| "position": "bottom", | ||
| "warn_if_missing": true | ||
| }, | ||
| { | ||
| "file": "assets/shop/entrypoint.js", | ||
| "content": "import '@vendor/sylius/b2b-kit/assets/shop/entrypoint';", | ||
| "position": "bottom", | ||
| "warn_if_missing": true | ||
| }, | ||
| { | ||
| "file": "config/services.yaml", | ||
| "content": " sylius.repository.product:\n class: App\\Repository\\ProductRepository\n public: true\n arguments:\n - \"@doctrine.orm.entity_manager\"\n - \"@=service('doctrine.orm.entity_manager').getClassMetadata(parameter('sylius.model.product.class'))\"\n - \"@sylius_b2b.checker.product_visibility_filtering\"\n - \"@sylius.context.customer\"", | ||
| "position": "after_target", | ||
| "target": "services:", | ||
| "warn_if_missing": true | ||
| } | ||
| ], | ||
| "env": { | ||
| "CUSTOMER_GROUP_PRICING_PRIORITY": "10", | ||
| "ORGANIZATION_PRICING_PRIORITY": "20" | ||
| } | ||
| } |
This file contains hidden or 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,14 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace App\Repository; | ||
|
|
||
| use Sylius\B2BKit\Organization\Repository\AddressRepositoryInterface as B2BKitAddressRepositoryInterface; | ||
| use Sylius\B2BKit\Organization\Repository\AddressRepositoryTrait as B2BKitAddressRepositoryTrait; | ||
| use Sylius\Bundle\CoreBundle\Doctrine\ORM\AddressRepository as BaseAddressRepository; | ||
|
|
||
| class AddressRepository extends BaseAddressRepository implements B2BKitAddressRepositoryInterface | ||
| { | ||
| use B2BKitAddressRepositoryTrait; | ||
| } |
This file contains hidden or 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,14 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace App\Repository; | ||
|
|
||
| use Sylius\B2BKit\Organization\Repository\CustomerRepositoryInterface as B2BKitCustomerRepositoryInterface; | ||
| use Sylius\B2BKit\Organization\Repository\CustomerRepositoryTrait as B2BKitCustomerRepositoryTrait; | ||
| use Sylius\Bundle\CoreBundle\Doctrine\ORM\CustomerRepository as BaseCustomerRepository; | ||
|
|
||
| class CustomerRepository extends BaseCustomerRepository implements B2BKitCustomerRepositoryInterface | ||
| { | ||
| use B2BKitCustomerRepositoryTrait; | ||
| } | ||
This file contains hidden or 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,34 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace App\Repository; | ||
|
|
||
| use Doctrine\ORM\EntityManagerInterface; | ||
| use Doctrine\ORM\Mapping\ClassMetadata; | ||
| use Doctrine\ORM\QueryBuilder; | ||
| use Sylius\B2BKit\Organization\Checker\ProductVisibilityFilteringCheckerInterface as B2BKitProductVisibilityFilteringCheckerInterface; | ||
| use Sylius\B2BKit\Organization\Doctrine\ORM\CreateProductQueryBuilderTrait as B2BKitCreateProductQueryBuilderTrait; | ||
| use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductRepository as BaseProductRepository; | ||
| use Sylius\Component\Customer\Context\CustomerContextInterface; | ||
|
|
||
| class ProductRepository extends BaseProductRepository | ||
| { | ||
| use B2BKitCreateProductQueryBuilderTrait; | ||
|
|
||
| public function __construct( | ||
| EntityManagerInterface $entityManager, | ||
| ClassMetadata $class, | ||
| protected B2BKitProductVisibilityFilteringCheckerInterface $productVisibilityFilteringChecker, | ||
| protected CustomerContextInterface $customerContext, | ||
| ) { | ||
| parent::__construct($entityManager, $class); | ||
| } | ||
|
|
||
| public function createQueryBuilder($alias, $indexBy = null): QueryBuilder | ||
| { | ||
| return $this->createFilteredQueryBuilder( | ||
| parent::createQueryBuilder($alias, $indexBy), | ||
| ); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.