PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 6/24/2020 11:28 AM by  3ART Technologies
Unable to add shipping in my custom server side module
 2 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Author Messages





Basic Member






--
6/21/2020 2:01 PM
    I tried to add the shipping charges in my custom server-side module but I am not able to get the amount, can any one tell me how can i get the shipping in my custom module.

    it is always returning me empty shipping value

    var HccApp = HccAppHelper.InitHccApp();
    var cart = HccApp.OrderServices.CurrentShoppingCart();
    var shipping = HccApp.OrderServices.FindAvailableShippingRates(cart, HccApp);
    return shipping.ToList();





    Veteran Member






    --
    6/23/2020 1:01 PM
    I'm unclear as to what you're trying to do, so I'd recommend looking at the checkout controller if you're trying to duplicate the checkout process.

    https://github.com/hotcak...utController.cs#L142

    https://github.com/hotcak...utController.cs#L176
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes





    Basic Member






    --
    6/24/2020 11:28 AM
    Thanks for the links but I already found this solution. I am creating my own cart page and checkout custom page, and for this, I need to calculate the shipping with only one country KSA no need to select the country from the dropdown.

    I already achieved it by the following code.

    public List shipping_Charges()
    {
    var HccApp = HccAppHelper.InitHccApp();
    var orders =HccApp.OrderServices;
    var cart = HccApp.OrderServices.CurrentShoppingCart();

    cart.ClearShippingPricesAndMethod();

    var country = HccApp.GlobalizationServices.Countries.FindByISOCode("SA");
    cart.ShippingAddress.CountryBvin = country.Bvin;
    cart.ShippingAddress.RegionBvin = "";

    orders.Orders.Update(cart, true);
    HccApp.CalculateOrderAndSave(cart);

    var shipping = HccApp.OrderServices.FindAvailableShippingRates(cart, HccApp);
    return shipping.ToList();

    }
    You are not authorized to post a reply.


    Loading
    • Sign-up for the Hotcakes Community Newsletter: