public function createProductSaleElement(ConnectionInterface $con, $weight, $basePrice, $salePrice, $currencyId, $isDefault, $isPromo = false, $isNew = false, $quantity = 0, $eanCode = '', $ref = false)
    {
        // Create an empty product sale element
        $saleElements = new ProductSaleElements();

        $saleElements
            ->setProduct($this)
            ->setRef($ref == false ? $this->getRef() : $ref)
            ->setPromo($isPromo)
            ->setNewness($isNew)
            ->setWeight($weight)
            ->setIsDefault($isDefault)
            ->setEanCode($eanCode)
            ->setQuantity($quantity)
            ->save($con)
        ;

        // Create an empty product price in the provided currency
        $productPrice = new ProductPrice();

        $productPrice
            ->setProductSaleElements($saleElements)
            ->setPromoPrice($salePrice)
            ->setPrice($basePrice)
            ->setCurrencyId($currencyId)
            ->setFromDefaultCurrency(false)
            ->save($con)
        ;

        return $saleElements;
    }
public function createProductSaleElement(ConnectionInterface $con, $weight, $basePrice, $salePrice, $currencyId, $isDefault, $isPromo = false, $isNew = false, $quantity = 0, $eanCode = '', $ref = false)
    {
        // Create an empty product sale element
        $saleElements = new ProductSaleElements();

        $saleElements
            ->setProduct($this)
            ->setRef($ref == false ? $this->getRef() : $ref)
            ->setPromo($isPromo)
            ->setNewness($isNew)
            ->setWeight($weight)
            ->setIsDefault($isDefault)
            ->setEanCode($eanCode)
            ->setQuantity($quantity)
            ->save($con)
        ;

        // Create an empty product price in the provided currency
        $productPrice = new ProductPrice();

        $productPrice
            ->setProductSaleElements($saleElements)
            ->setPromoPrice($salePrice)
            ->setPrice($basePrice)
            ->setCurrencyId($currencyId)
            ->setFromDefaultCurrency(false)
            ->save($con)
        ;

        return $saleElements;
    }
public function createProductSaleElement ( ConnectionInterface $ con , $ weight , $ basePrice , $ salePrice , $ currencyId , $ isDefault , $ isPromo = false , $ isNew = false , $ quantity = 0 , $ eanCode = '' , $ ref = false ) { // Create an empty product sale element $ saleElements = new ProductSaleElements ( ) ; $ saleElements -> setProduct ( $ this ) -> setRef ( $ ref == false ? $ this -> getRef ( ) : $ ref ) -> setPromo ( $ isPromo ) -> setNewness ( $ isNew ) -> setWeight ( $ weight ) -> setIsDefault ( $ isDefault ) -> setEanCode ( $ eanCode ) -> setQuantity ( $ quantity ) -> save ( $ con ) ; // Create an empty product price in the provided currency $ productPrice = new ProductPrice ( ) ; $ productPrice -> setProductSaleElements ( $ saleElements ) -> setPromoPrice ( $ salePrice ) -> setPrice ( $ basePrice ) -> setCurrencyId ( $ currencyId ) -> setFromDefaultCurrency ( false ) -> save ( $ con ) ; return $ saleElements ; }
Create a basic product sale element attached to this product.

@param ConnectionInterface $con
@param float $weight
@param float $basePrice
@param float $salePrice
@param int $currencyId
@param int $isDefault
@param bool $isPromo
@param bool $isNew
@param int $quantity
@param string $eanCode
@param bool $ref
@return ProductSaleElements
@throws PropelException
@throws \Exception
Create a basic product sale element attached to this product .