public function sellingPrice()
    {
        $price = $this->BasePrice;
        //TODO: this is not ideal, because prices manipulations will not happen in a known order
        $this->extend('updateSellingPrice', $price);
        //prevent negative values
        $price = $price < 0 ? 0 : $price;

        // NOTE: Ideally, this would be dependent on the locale but as of
        // now the Silverstripe Currency field type has 2 hardcoded all over
        // the place. In the mean time there is an issue where the displayed
        // unit price can not exactly equal the multiplied price on an order
        // (i.e. if the calculated price is 3.145 it will display as 3.15.
        // so if I put 10 of them in my cart I will expect the price to be
        // 31.50 not 31.45).
        return round($price, Order::config()->rounding_precision);
    }
public function sellingPrice()
    {
        $price = $this->BasePrice;
        //TODO: this is not ideal, because prices manipulations will not happen in a known order
        $this->extend('updateSellingPrice', $price);
        //prevent negative values
        $price = $price < 0 ? 0 : $price;

        // NOTE: Ideally, this would be dependent on the locale but as of
        // now the Silverstripe Currency field type has 2 hardcoded all over
        // the place. In the mean time there is an issue where the displayed
        // unit price can not exactly equal the multiplied price on an order
        // (i.e. if the calculated price is 3.145 it will display as 3.15.
        // so if I put 10 of them in my cart I will expect the price to be
        // 31.50 not 31.45).
        return round($price, Order::config()->rounding_precision);
    }
public function sellingPrice ( ) { $ price = $ this -> BasePrice ; //TODO: this is not ideal, because prices manipulations will not happen in a known order $ this -> extend ( 'updateSellingPrice' , $ price ) ; //prevent negative values $ price = $ price < 0 ? 0 : $ price ; // NOTE: Ideally, this would be dependent on the locale but as of // now the Silverstripe Currency field type has 2 hardcoded all over // the place. In the mean time there is an issue where the displayed // unit price can not exactly equal the multiplied price on an order // (i.e. if the calculated price is 3.145 it will display as 3.15. // so if I put 10 of them in my cart I will expect the price to be // 31.50 not 31.45). return round ( $ price , Order :: config ( ) -> rounding_precision ) ; }
The raw retail price the visitor will get when they
add to cart. Can include discounts or markups on the base price.
The raw retail price the visitor will get when they add to cart . Can include discounts or markups on the base price .