Total Posts:
7
Karma:
35
Joined:
8/20/2009
Location:
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.
Total Posts:
7
Karma:
35
Joined:
8/20/2009
Location:
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.
Total Posts:
13
Karma:
75
Joined:
3/17/2010
Location:
United States
Do you know of a fix for ver. 1.40?
Total Posts:
7
Karma:
35
Joined:
8/20/2009
Location:
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
Total Posts:
13
Karma:
75
Joined:
3/17/2010
Location:
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.
Total Posts:
13
Karma:
75
Joined:
3/17/2010
Location:
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; } } } }
Total Posts:
195
Karma:
1091
Joined:
2/19/2010
Location:
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.
Total Posts:
16612
Karma:
155815
Joined:
10/22/2008
Location:
Armenia
Tier prices are applied only to product variant price (and not applied to product attributes).