コード例 #1
0
        Injected <PricingLoader> rwPriceLoader;         // just to show
                                                        //Injected<ICurrentMarket> currentMarketService;
                                                        //Injected<ReferenceConverter> _refConv;


        // Fund: Pricing Extensions
        private void CheckPrices(VariationContent currentContent)
        {
            // Don't want to see the below lines
            //StoreHelper.GetBasePrice(currentContent.LoadEntry());
            // StoreHelper.GetSalePrice(currentContent.LoadEntry(), 11, theMarket, new Currency("USD")); // Get currency from market or thread... or something

            IMarket theMarket = _currentMarket.GetCurrentMarket();

            var priceRef           = currentContent.PriceReference;    // a ContentReference
            var gotPrices          = currentContent.GetPrices();       // Gets all, recieve "Specialized" Price/ItemCollection
            var defaultPrice       = currentContent.GetDefaultPrice(); // All Cust + qty 0 ... market sensitive
            var custSpecificPrices = currentContent.GetCustomerPrices();

            var PriceCheck = (IPricing)currentContent; // null if not a SKU

            var p1 = roPriceLoader.Service.GetPrices(
                currentContent.ContentLink
                , MarketId.Default
                , new CustomerPricing(CustomerPricing.PriceType.PriceGroup, "VIP"));
            // arbitrary Price-Group, could read
            // ...CustomerContext.Current.CurrentContact.EffectiveCustomerGroup;

            var p2 = roPriceLoader.Service.GetCustomerPrices(
                currentContent.ContentLink
                , theMarket.DefaultCurrency // ...or something
                , 8M
                , true);                    // bool - return customer pricing

            // Loader examples "Infrastructure/PriceCalculator"
        }
コード例 #2
0
        // Fund: Pricing Extensions // more of pricing in /Pricing/PricingService...
        private void CheckPrices(VariationContent currentContent)
        {
            /**/
            //currentContent.getp
            Entry e = CatalogContext.Current.GetCatalogEntry(currentContent.Code);
            var   p = e.PriceValues; // gets 5

            IEnumerable <CatalogEntryDto.SalePriceRow> rows = CatalogContext.Current.GetCatalogEntryDto
                                                                  (currentContent.Code, new CatalogEntryResponseGroup
                                                                      (CatalogEntryResponseGroup.ResponseGroup.CatalogEntryFull)).SalePrice; // zero rows
            /**/

            var salePrice     = StoreHelper.GetSalePrice(currentContent.LoadEntry(), 7);
            var discountPrice = StoreHelper.GetDiscountPrice(currentContent.LoadEntry());

            var priceRef = currentContent.PriceReference; // a ContentReference

            EPiServer.Commerce.SpecializedProperties.ItemCollection <EPiServer.Commerce.SpecializedProperties.Price>
            gotPrices = currentContent.GetPrices();              // Gets all, recieve "Specialized" Price

            var defaultPrice = currentContent.GetDefaultPrice(); // All Cust + qty 0 ... market sensitive

            var custPrices = currentContent.GetCustomerPrices(
                new Currency("USD")
                , 3M
                , true); // for the current user - fourth arg is the PriceLoader - remember EffectivePriceGroup

            // the below includes TaxCategory
            var PriceStuff = (IPricing)currentContent; // null if "a price" is N/A,

            // not extensions, fairly full view of prices
            PricingService myPricing = new PricingService(
                _priceService, _currentMarket, _priceDetailService);

            //myPricing.CheckPrices(currentContent);
            //myPricing.GetPrices(currentContent.Code);
        }