Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
Hi,
Regarding Passing the calculated customized product price to "add to cart" and "check out" pages:
Scenario: Admin end: Product has been set up using shared modifiers at admin end. Base Price of the product has been set to 1$. Shared modifiers have it's own price too (1$, 2$, 3$, etc.)
Front end: User will select shared modifier -> the price of which will be added to base price of product. Example, Shared modifier 1 with 1$ selected, total base price = base price + shared modifier price >> 1$ + 1$ = 2$
There are few pre-defined formulaes using which the base price of the product is re-calculated. Formula 1 -> A + B * C, where A, B, C are user defined. Example, A =1, B=2, C=4, so the Formula 1 output >> 1 + 2 * 4 = 9
This output of formula is multiplied to total base price -> 9 * 2 = 18$
And if Quantity of product is increased, it multiplies accordingly -> Quantity = 3, Total Product Price = 3 * 18 >> 36$
The scenario here is to pass this 36$ to "add to cart" and "check out" pages. We have tried to set the "Base Price" of the line items in the cart as well as "Base Price" of product in code behind. But, while analysing it has been found that, BVC code/logic internally recalculates price using workflows which resets the 36$ price to internally calculated base price.
Kindly let us know how could we include this customization in BVC set up and pass the calculated price to next pages.
Thank you
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Your custom calculation logic should ideally be implemented as a custom workflow step that you add to the "Calculate Order" workflow. This code can reside in /App_Code (or a separate assembly) and be isolated entirely from the application Core source, making it easier to implement BVC upgrades in the future. This is actually what we do on the BV Commerce website to calculate BV.NEXT renewal pricing since we need to prorate expired plans from their standard price. One other tip is that if you call the SetAdminPrice method of the LineItem object it will set a price that is not recalculated. Think of it as a price override--once it's set it will never be changed unless you call that method again with a different price. If you do this you will likely need to force a recalculation of your order total by calling the UpdateSubTotal and CalculateGrandTotalOnly methods of your Order object. Edited by user Thursday, October 12, 2017 9:09:15 AM(UTC)
| Reason: Not specified |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
Thank you for reply. We will check the suggested solution.
As per our analysis, there is scenario with SetBasePrice() and RecalculateProductPrices() in which Admin product price will be set to line item. If we do not invoke these methods, will there be any impact on BVC calculation?
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Originally Posted by: NP As per our analysis, there is scenario with SetBasePrice() and RecalculateProductPrices() in which Admin product price will be set to line item. Can you provide details of why you believe this is the case? Also, what version of BVC are you using? |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
Hello, I have used SetAdminPrice() method of the LineItem object to set customized price and it seems its working. Even though for this, SetBasePrice() and
RecalculateProductPrices() method it returns customized value. It seems that issue is resolved. If any issue occurs then will let you know.
Thank you.
|
|
|
|
Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
we are using BVC2017 version
|
|
|
|
Rank: Administration
Joined: 4/2/2004(UTC) Posts: 2,393 Location: Hummelstown, PA Thanks: 6 times Was thanked: 163 time(s) in 158 post(s)
|
Great! I'm glad to hear that this resolved your issue. |
Aaron Sherrick BV Commerce Toll-free 888-665-8637 - Int'l +1 717-220-0012 |
|
|
|
Rank: Member
Joined: 2/10/2017(UTC) Posts: 62 Location: Nashik, Maharashtra Thanks: 6 times
|
Thank you for your help !!!
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.