PHP code example of fond-of-oryx / availability-cart-data-extender
1. Go to this page and download the library: Download fond-of-oryx/availability-cart-data-extender library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
fond-of-oryx / availability-cart-data-extender example snippets
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return \Spryker\Zed\CartExtension\Dependency\Plugin\QuoteChangeObserverPluginInterface[]
*/
protected function getQuoteChangeObserverPlugins(Container $container): array
{
return [
...
new AddAvailabilityDataToQuoteItemQuoteChangeObserverPlugin(),
];
}
/**
* @param \Spryker\Zed\Kernel\Container $container
*
* @return \Spryker\Zed\Cart\Dependency\CartPreCheckPluginInterface[]
*/
protected function getCartPreCheckPlugins(Container $container)
{
return [
...
new CheckAvailabilityPlugin(),
...
];
}