public buildBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Product\ProductInterface $product = null, array $options = [] ) | ||
$basketElement | Sonata\Component\Basket\BasketElementInterface | |
$product | Sonata\Component\Product\ProductInterface | |
$options | array |
public function buildBasketElement(BasketElementInterface $basketElement, ProductInterface $product = null, array $options = array())
{
if ($product) {
$basketElement->setProduct($this->code, $product);
if (!$basketElement->getQuantity() && 0 !== $basketElement->getQuantity()) {
$basketElement->setQuantity(1);
}
}
$basketElement->setOptions($options);
}