Last active
November 13, 2024 10:07
-
-
Save PhilinTv/599cb09583961b2f3d3e6bf4ebecf855 to your computer and use it in GitHub Desktop.
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
class CheckoutDependencyProvider extends AbstractBundleDependencyProvider | |
{ | |
public function provideBusinessLayerDependencies(Container $container) | |
{ | |
$container->set(static::CHECKOUT_PRE_SAVE_HOOKS, function (Container $container) { | |
return [ | |
new class implements CheckoutPreSaveHookInterface { | |
public function execute(CheckoutResponseTransfer $checkoutResponseTransfer, QuoteTransfer $quoteTransfer): CheckoutResponseTransfer | |
{ | |
return $checkoutResponseTransfer; | |
} | |
}, | |
]; | |
}, 'only on Monday tag'); | |
} | |
} | |
//In the Biz Factory | |
$this->getProvidedDependency(CheckoutDependencyProvider::CHECKOUT_PRE_SAVE_HOOKS); //no tag plugins | |
$this->getProvidedDependency(CheckoutDependencyProvider::CHECKOUT_PRE_SAVE_HOOKS, 'only on Monday tag'); //only tagged | |
//or in the logic | |
$container->get(CheckoutDependencyProvider::CHECKOUT_PRE_SAVE_HOOKS); //no tag plugins | |
$container->get(CheckoutDependencyProvider::CHECKOUT_PRE_SAVE_HOOKS, 'only on Monday tag'); //only tagged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment