Amazon Pay - Support of Bundled Products
![](../../../../resources/images/shoptype/demoshop.png)
Bundled products are optional in the shop, thus support of those should be configured.
First, you have to extend AmazonPayFactory:
namespace Pyz\Yves\AmazonPay;
use Spryker\Yves\ProductBundle\Grouper\ProductBundleGrouper;
use SprykerEco\Yves\AmazonPay\AmazonPayFactory as EcoAmazonPayFactory;
class AmazonPayFactory extends EcoAmazonPayFactory
{
/**
* @return \Spryker\Yves\ProductBundle\Grouper\ProductBundleGrouperInterface
*/
public function createProductBundleGrouper()
{
return new ProductBundleGrouper();
}
}
Second, you have to extend AmazonPay\PaymentController:
namespace Pyz\Yves\AmazonPay\Controller;
use Generated\Shared\Transfer\QuoteTransfer;
use SprykerEco\Yves\AmazonPay\Controller\PaymentController as EcoPaymentController;
/**
* @method \Pyz\Yves\AmazonPay\AmazonPayFactory getFactory()
*/
class PaymentController extends EcoPaymentController
{
/**
* @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
*
* @return \ArrayObject|\Generated\Shared\Transfer\ItemTransfer[]
*/
protected function getCartItems(QuoteTransfer $quoteTransfer)
{
return $this->getFactory()->createProductBundleGrouper()->getGroupedBundleItems(
$quoteTransfer->getItems(),
$quoteTransfer->getBundleItems()
);
}
}
See also:
- Get a general idea about Amazon Pay
- Configure Amazon Pay API
- Configure Amazon Pay
- Obtaining Amazon Order Reference and Shipping Addresses details
- Learn about OMS commands
- Learn how Amazon Pay Refund works
- Rendering the "Pay with Amazon" button on the Cart page
- Learn how Amazon Pay Sandbox Simulations work
- Check out Amazon Pay example email notifications
Last review date: Dec 3, 2018