Hi..
I'm stuck at a problem,
Im using a Tea Commerce in my project. When i get into a order confirmation page i can see the ShippingInformation fields occupied. but
when i reload the same page, the values became 0 !
What might be the reason ?
Any help will be appreciated !
Do you have some code some place else that is clearing the shipping method at all? I've just tried this on the demo store and the price persists so the only thing I can think of is you have some code that is un-setting this some place else?
Hi Matt
No., I'm calling a view in controller and inside that view i fetch order details with var order = TC.GetCurrentOrder(storeId); This is what I'm doing
-Arun
Hmm, well, first issue I can see is that you are using the wrong method to fetch the order. For the confirmation page you should be using TC.GetCurrentFinalizedOrder(storeId)
Once the order has been captured, it will be moved to the finalized state and will be removed as the current order. Why you have a "Current Order" though initially also suggests there my be something else modifying the order when it's not meant to be modified though. But I'd start with the method above and see where that gets you.
I'm fetching it on the Confirmation page.,
The order is Finalizing as the next step, In current page, i need to show the order details like Product Price, VAT, Shipping information and Total Price.
Due to the missing of Shipping information, the Total price seems incorrect
Ahh, ok, then sorry, you are using the right method to get the current order.
So what else is going in on that page? Can you share you code? And do you have any code occurring in your pages controller? Could something be being called against the javascript API you didn't intend? Have you implemented any custom shipping calculators?
Yes..
I saw the shipping cost and total price mismatch after reloading,
& when i tried debugging i see the ShippingInformation getting cleared on reloading
On my first page, the user needs to enter their address and details. while clicking proceed the shipping calculation is done and user will be redirected to a confirmation page (the page mentioned in our question) where the user can see the inputted details, price distribution, etc, and when the user click Confirm the order will be Finalized.
but in my case the Shipping cost is excluded from the Total price
Sure, I understand the issue at hand but my questions are in order to rule out whether the issue resides in some custom code or in the core product.
I need you to confirm that you’ve debug stepped through your calculator code at all steps in the checkout flow and that this is functioning as expected before I can investigate other options as right now, I’m unable to replicate the issue.
I use TNT for calculating the shipping cost, once the Shipping Cost is received i use AddOrUpdateOrderProperties to update the order property. (PFA).
After the code TC.AddOrUpdateOrderProperties(order.StoreId, orderShippingProperties); is executed i can see the shipping costs reflected in the ShippingInformation of order.
Then I'm redirecting to an view (from a controller) which is the confirmation page for user. There, on first load the order.ShipmentInformation contains values. but on reload or proceeding to the next page the value seems missing and shipping code is deducted from Total Price
Ok, if you look in the database table TeaCommerce_CustomOrderProperty can you see when you set the property that this is persisted to the database? or is it never persisted? Also, can you share the code to your confirmation page so that I can review to see if there is anything that might be resetting the property?
Shipping Cost Getting zero when reloaded
Hi..
I'm stuck at a problem, Im using a Tea Commerce in my project.
When i get into a order confirmation page i can see the
ShippingInformation
fields occupied. but when i reload the same page, the values became 0 !What might be the reason ?
Any help will be appreciated !
Hey Arun,
Do you have some code some place else that is clearing the shipping method at all? I've just tried this on the demo store and the price persists so the only thing I can think of is you have some code that is un-setting this some place else?
/Matt
Hi Matt
No.,
I'm calling a view in controller and inside that view i fetch order details with
var order = TC.GetCurrentOrder(storeId);
This is what I'm doing
-Arun
Hmm, well, first issue I can see is that you are using the wrong method to fetch the order. For the confirmation page you should be using
TC.GetCurrentFinalizedOrder(storeId)
Once the order has been captured, it will be moved to the finalized state and will be removed as the current order. Why you have a "Current Order" though initially also suggests there my be something else modifying the order when it's not meant to be modified though. But I'd start with the method above and see where that gets you.
/Matt
I'm fetching it on the Confirmation page.,
The order is Finalizing as the next step, In current page, i need to show the order details like Product Price, VAT, Shipping information and Total Price.
Due to the missing of Shipping information, the Total price seems incorrect
What are you considering the confirmation page? The page before taking payment? Or the page after?
The page before taking the payment
Ahh, ok, then sorry, you are using the right method to get the current order.
So what else is going in on that page? Can you share you code? And do you have any code occurring in your pages controller? Could something be being called against the javascript API you didn't intend? Have you implemented any custom shipping calculators?
/Matt
Yes, We are using a custom shipping calculator, by TNT Express.
Ok, and have you debugged into that to make sure it is not malfunctioning and returning 0 under certain conditions?
Yes..
I saw the shipping cost and total price mismatch after reloading, & when i tried debugging i see the ShippingInformation getting cleared on reloading
But have you stepped through your shipping calculator code ensuring the right values are being returned on the refresh?
On my first page, the user needs to enter their address and details.
while clicking proceed the shipping calculation is done and user will be redirected to a confirmation page (the page mentioned in our question) where the user can see the inputted details, price distribution, etc,
and when the user click Confirm the order will be Finalized.
but in my case the Shipping cost is excluded from the Total price
Sure, I understand the issue at hand but my questions are in order to rule out whether the issue resides in some custom code or in the core product.
I need you to confirm that you’ve debug stepped through your calculator code at all steps in the checkout flow and that this is functioning as expected before I can investigate other options as right now, I’m unable to replicate the issue.
/Matt
I use TNT for calculating the shipping cost, once the Shipping Cost is received i use
AddOrUpdateOrderProperties
to update the order property. (PFA).After the code
TC.AddOrUpdateOrderProperties(order.StoreId, orderShippingProperties);
is executed i can see the shipping costs reflected in the ShippingInformation of order.Then I'm redirecting to an view (from a controller) which is the confirmation page for user. There, on first load the
order.ShipmentInformation
contains values. but on reload or proceeding to the next page the value seems missing and shipping code is deducted from Total Price-Arun
So it's your order property that contains the shipping rate that is going missing that is the problem?
Yes.. the
order.ShipmentInformation
getting cleared from current order-Arun
Ok, if you look in the database table
TeaCommerce_CustomOrderProperty
can you see when you set the property that this is persisted to the database? or is it never persisted? Also, can you share the code to your confirmation page so that I can review to see if there is anything that might be resetting the property?is working on a reply...