Property | Type | Description | |
---|---|---|---|
$basketElementClass | string | ||
$formFactory | Symfony\Component\Form\FormFactoryInterface | ||
$productPool |
Method | Description | |
---|---|---|
__construct ( |
Constructor. | |
getCheapestEnabledVariation ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductInterface | Return the cheapest variation of the product (or itself if none). | |
getCheapestEnabledVariationPrice ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductInterface | Return the cheapest variation price of the product (or itself if none). | |
getFormAddBasket ( Sonata\Component\Product\ProductInterface $product ) : Symfony\Component\Form\FormView | Returns a "add to basket" form for a specified product. | |
getFunctions ( ) : array | ||
getName ( ) | ||
getProductPrice ( Sonata\Component\Product\ProductInterface $product, Sonata\Component\Currency\CurrencyInterface $currency, boolean $vat = false ) : float | Return the calculated price of the product. | |
getProductProvider ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductProviderInterface | Return the Provider of the given Product. | |
getProductStock ( Sonata\Component\Product\ProductInterface $product ) : integer | Return the available stock of the product. | |
hasEnabledVariations ( Sonata\Component\Product\ProductInterface $product ) : boolean | Check if the product has enabled variations. | |
hasVariations ( Sonata\Component\Product\ProductInterface $product ) : boolean | Check if the product has variations. |
public __construct ( |
||
$productPool | Sonata product pool | |
$formFactory | Symfony\Component\Form\FormFactoryInterface | Symfony form factory |
$basketElementClass | string | Sonata basket element class name |
public getCheapestEnabledVariation ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductInterface | ||
$product | Sonata\Component\Product\ProductInterface | |
return | Sonata\Component\Product\ProductInterface |
public getCheapestEnabledVariationPrice ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductInterface | ||
$product | Sonata\Component\Product\ProductInterface | |
return | Sonata\Component\Product\ProductInterface |
public getFormAddBasket ( Sonata\Component\Product\ProductInterface $product ) : Symfony\Component\Form\FormView | ||
$product | Sonata\Component\Product\ProductInterface | A product instance |
return | Symfony\Component\Form\FormView |
public getProductPrice ( Sonata\Component\Product\ProductInterface $product, Sonata\Component\Currency\CurrencyInterface $currency, boolean $vat = false ) : float | ||
$product | Sonata\Component\Product\ProductInterface | A product instance |
$currency | Sonata\Component\Currency\CurrencyInterface | A currency instance |
$vat | boolean | Returns price including VAT? |
return | float |
public getProductProvider ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Product\ProductProviderInterface | ||
$product | Sonata\Component\Product\ProductInterface | |
return | Sonata\Component\Product\ProductProviderInterface |
public getProductStock ( Sonata\Component\Product\ProductInterface $product ) : integer | ||
$product | Sonata\Component\Product\ProductInterface | A product instance |
return | integer |
public hasEnabledVariations ( Sonata\Component\Product\ProductInterface $product ) : boolean | ||
$product | Sonata\Component\Product\ProductInterface | |
return | boolean |
public hasVariations ( Sonata\Component\Product\ProductInterface $product ) : boolean | ||
$product | Sonata\Component\Product\ProductInterface | |
return | boolean |
protected FormFactoryInterface,Symfony\Component\Form $formFactory | ||
return | Symfony\Component\Form\FormFactoryInterface |