Anzahl der Beiträge:
7
Karma:
35
Beigetreten:
20.08.2009
Herkunft:
United States
Hello, When setting up a product and assigning tier pricing and having a product variant with price increase, only the Tier pricing is applied when adding to shopping cart. Example: Picture Frame: Tier pricing - 2 or more $15, 5 or more $10 Product Variant - Size 8 x 10 (0 increase), Size 11 x 14 ($10 increase) Selections are displayed for the product detail, but add to cart at a qty of 6 and a selection of 11 x 14 and only the price is reduced for qty and product variant increase is not applied. Any help is appreciated.
Anzahl der Beiträge:
7
Karma:
35
Beigetreten:
20.08.2009
Herkunft:
United States
Reviewing the PriceHelper.cs I found the following in the "GetUnitPrice" method on about line 273 (version 1.30). On about line 286 I replaced the Following: if (productVariant.TierPrices.Count > 0) { decimal tierPrice = GetTierPrice(productVariant, shoppingCartItem.Quantity); finalPrice = Math.Min(finalPrice, tierPrice); } With: if (productVariant.TierPrices.Count > 0) { decimal tierPrice = GetTierPrice(productVariant, shoppingCartItem.Quantity); if (tierPrice < productVariant.Price) { finalPrice = (finalPrice - productVariant.Price) + tierPrice; } //finalPrice = Math.Min(finalPrice, tierPrice); } This takes into consideration any change by Tier pricing and previous final price calculations. Hope this helps anyone with the same scenario.
Anzahl der Beiträge:
13
Karma:
75
Beigetreten:
17.03.2010
Herkunft:
United States
Do you know of a fix for ver. 1.40?
Anzahl der Beiträge:
7
Karma:
35
Beigetreten:
20.08.2009
Herkunft:
United States
Hello Joey, You may just need to search the code for Tierprice and see where it takes you, then walk through the logic to see when and what price is calculated. I haven't looked at 1.4 code yet. Todd
Anzahl der Beiträge:
13
Karma:
75
Beigetreten:
17.03.2010
Herkunft:
United States
Ok, I'll see what I can do. Look's some form of Javascript. I'll try to find the code you specified and edit it.
Anzahl der Beiträge:
13
Karma:
75
Beigetreten:
17.03.2010
Herkunft:
United States
Would this be the right code to change? I have no idea what to change here. namespace NopSolutions.NopCommerce.Web.Modules { public partial class TierPriceControl : BaseNopUserControl { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BindData(); } } private void BindData() { ProductVariant productVariant = ProductManager.GetProductVariantByID(this.ProductVariantID); if (productVariant != null) { TierPriceCollection tierPrices = productVariant.TierPrices; if (tierPrices.Count > 0) { lvTierPrices.DataSource = tierPrices; lvTierPrices.DataBind(); } else this.Visible = false; } else this.Visible = false; } protected void lvTierPrices_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem currentItem = (ListViewDataItem)e.Item; TierPrice tierPrice = currentItem.DataItem as TierPrice; ProductVariant productVariant = tierPrice.ProductVariant; Label lblQuantity = (Label)currentItem.FindControl("lblQuantity"); Label lblPrice = (Label)currentItem.FindControl("lblPrice"); decimal priceBase = TaxManager.GetPrice(productVariant, tierPrice.Price); decimal price = CurrencyManager.ConvertCurrency(priceBase, CurrencyManager.PrimaryStoreCurrency, NopContext.Current.WorkingCurrency); string priceStr = PriceHelper.FormatPrice(price, false, false); lblQuantity.Text = string.Format(GetLocaleResourceString("Products.TierPricesQuantityFormat"), tierPrice.Quantity); lblPrice.Text = priceStr; } } public int ProductVariantID { get { object obj2 = this.ViewState["ProductVariantID"]; if (obj2 != null) return (int)obj2; else return 0; } set { this.ViewState["ProductVariantID"] = value; } } } }
Anzahl der Beiträge:
195
Karma:
1091
Beigetreten:
19.02.2010
Herkunft:
United States
Well I can't tell you were to start to change code to get it to work, but Nop 1.4 does the same thing out of the box.
Anzahl der Beiträge:
16619
Karma:
155940
Beigetreten:
22.10.2008
Herkunft:
Armenia
Tier prices are applied only to product variant price (and not applied to product attributes).