Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Lee 1130 posts 3088 karma points
    Apr 16, 2013 @ 10:51
    Lee
    0

    Double Shipment Issue

    We have a weird problem that only occurs in specific scenarios, but we cannot seem to find out why its happening.

    Scenario

    Customer adds product to cart, goes through checkout process (Billling Address > Shipping address > Shipment Cost) and then chooses paypal. They are redirected to paypal, but paypal has an error or they decide at the last minute this is not the right product.

    So they click back to go back to the site. The basket still has their order/purchase order in it. They clear the basket (Our code below, please ignore the _eCommerceService as we have wrapped all the uCommerce stuff up in our own class, so its just the UCommerce library in it)

    var basket = _eCommerceService.Basket.PurchaseOrder;
    foreach (var orderLineId in basket.OrderLines.Select(x => x.OrderLineId).ToList())
    {
        _eCommerceService.Basket.UpdateLineItem(orderLineId, 0);
    }
    
    var shipments = new List<Shipment>();
    shipments.AddRange(basket.Shipments);
    shipments.ForEach(x => basket.UPurchaseOrder.RemoveShipment(x));
    _eCommerceService.Basket.ExecuteBasketPipeline();

    Once they have emptied their basket they decide they want something else, add that to cart and go through the checkout again. This time when they get to PayPal, it seems to have added the previous shipment amount to the new shipment amount they have selected (Basically they get charged shipping twice?).

    What we can't figure out is how/where the previous shipment is appearing from? As you can see we clear the shipments on emptying the cart? As soon as they order is successfully completed, its all reset and works correctly?

    Hope that makes sense... As I say its a specific scenario, but an annoying one as we have no idea why its doubling up the shipment. 

  • Tim 174 posts 398 karma points
    Apr 16, 2013 @ 12:32
    Tim
    0

    The shipment is created against their order and will remain in place even if you empty the basket (as a basket is just a state of the purchase order).

    Is there any reason you're not using the built in Shipment methods which you can use to replace any existing shipments?

  • Lee 1130 posts 3088 karma points
    Apr 16, 2013 @ 12:34
    Lee
    0

    I thought I had deleted this! lol

    Please ignore, figured out why it was behaving this way in the end. Thanks for replaying though :)

  • Tim 174 posts 398 karma points
    Apr 16, 2013 @ 13:41
    Tim
    0

    :) no worries although I would still recommend using the build in API methods where possible as it does a fair amount of work for you.

  • Lee 1130 posts 3088 karma points
    Apr 16, 2013 @ 14:29
    Lee
    0

    We are using the build in API method chap? We have just wrapped up all the UCommerce objects into our domain objects, and wrapped up the API methods into our own interfaced service/repos.

    This way, in theory we could rip out uCommerce and replace it with a different ecommerce platform or our own custom one.

Please Sign in or register to post replies

Write your reply to:

Draft