If one of your suppliers (manufacturers) charges a handling fee for orders, you can pass that fee on to your customers.
Order | Type | Name | Expression | Rate Expression | Surcharge Expression |
10 | Reference | HasManufacturer | Product.ProductManufacturers.Any |
|
|
20 | Reference | hasManufacturerX | [@HasManufacturer](Manufacturer.Name = "X") |
|
|
50 | Decimal | SurchargeForX | Items.Any([@hasManufacturerX]) ? 10 : 0 |
|
|
100 | Option | Shipping | true | Shipping.Fedex | [SurchargeForX] |
Additionally, you can show the customer a description explaining that a fee has been added (it appears to customer under the shipping option name). Just include a Description Expression on the Option line:
[SurchargeForX] = 0 ? "" : "A $" + [Surcharge].ToString() + " has been added because your cart contains a product from manufacturer X"
If you only want to charge the fee if the total amount of merchandise from that particular manufacturer is under $250, then we need to calculate the total $ amount of the items for that manufacturer, and then the expression for SurchargeForX would need to check if that total less than $250:
Modify the above - add line 30 for the total $ calculation and change line 50 to use the total:
Order | Type | Name | Expression | Rate Expression | Surcharge Expression |
… |
|
|
|
|
|
30 | Decimal | TotalForX | Items.Where([@hasManufacturerX]) .Sum(Product.Price * Quantity) |
|
|
50 | Decimal | SurchargeForX | [TotalForX] < 250 ? 10 : 0 |
|
|
Note, that the “the total amount of merchandise from that particular manufacturer” is the full price amount – i.e. does not include any discounts.
(Updated Aug. 2014. If using nopCommerce versions prior to 3.00, then use ProductVariant.Product in plasce of just Product, and ProductVariant.Price in place of Product.Price)