Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Arun 141 posts 404 karma points
    Jun 01, 2020 @ 11:40
    Arun
    0

    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 !

    values on initial load

    values on reload

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 01, 2020 @ 11:59
    Matt Brailsford
    0

    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

  • Arun 141 posts 404 karma points
    Jun 01, 2020 @ 12:27
    Arun
    0

    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

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 01, 2020 @ 13:20
    Matt Brailsford
    0

    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

  • Arun 141 posts 404 karma points
    Jun 01, 2020 @ 14:15
    Arun
    0

    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

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 01, 2020 @ 14:26
    Matt Brailsford
    0

    What are you considering the confirmation page? The page before taking payment? Or the page after?

  • Arun 141 posts 404 karma points
    Jun 01, 2020 @ 14:31
    Arun
    0

    The page before taking the payment

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 01, 2020 @ 14:36
    Matt Brailsford
    0

    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

  • Arun 141 posts 404 karma points
    Jun 01, 2020 @ 14:58
    Arun
    0

    Yes, We are using a custom shipping calculator, by TNT Express.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 01, 2020 @ 15:06
    Matt Brailsford
    0

    Ok, and have you debugged into that to make sure it is not malfunctioning and returning 0 under certain conditions?

  • Arun 141 posts 404 karma points
    Jun 01, 2020 @ 15:15
    Arun
    0

    Yes..
    I saw the shipping cost and total price mismatch after reloading, & when i tried debugging i see the ShippingInformation getting cleared on reloading

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 01, 2020 @ 15:37
    Matt Brailsford
    0

    But have you stepped through your shipping calculator code ensuring the right values are being returned on the refresh?

  • Arun 141 posts 404 karma points
    Jun 02, 2020 @ 04:05
    Arun
    0

    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

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 02, 2020 @ 07:27
    Matt Brailsford
    0

    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

  • Arun 141 posts 404 karma points
    Jun 03, 2020 @ 13:02
    Arun
    0

    I use TNT for calculating the shipping cost, once the Shipping Cost is received i use AddOrUpdateOrderProperties to update the order property. (PFA). enter image description here

    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

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 03, 2020 @ 13:50
    Matt Brailsford
    100

    So it's your order property that contains the shipping rate that is going missing that is the problem?

  • Arun 141 posts 404 karma points
    Jun 03, 2020 @ 14:49
    Arun
    0

    Yes.. the order.ShipmentInformation getting cleared from current order
    -Arun

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jun 03, 2020 @ 14:58
    Matt Brailsford
    0

    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?

Please Sign in or register to post replies

Write your reply to:

Draft