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.

  • Rick 92 posts 278 karma points
    Jun 26, 2015 @ 15:03
    Rick
    0

    Remove item from basket

    Hi,

    I'm having some issues with removing an item from the basket.

    I'm using the demo store and can see that it appears to be falling over when I click the remove button next to the product on cart.aspx

    The offending script is _Actions.Cart.cshtml which is referenced before the closing...

    </head>
    

    ...on the masterpage

    It breaks on the line...

    var basket = TransactionLibrary.GetBasket(true).PurchaseOrder;
    

    ...and I really don't know why!

    var request = HttpContext.Current.Request;
    
    var basket = TransactionLibrary.GetBasket(true).PurchaseOrder;
    
    if (request.HttpMethod == "POST")
    {
        @* For these helper functions refer to /App_Code/uCommerce/Functions/Basket.cshtml *@
        uCommerce.Functions.Basket.RemoveItem("basket-remove-item");
        uCommerce.Functions.Basket.AddVoucher("add-voucher", "voucher-code");
        uCommerce.Functions.Basket.UpdateCartLines("update-basket", "quantity-input-", basket);
    }
    

    I get the error:

    "PipelineException was unhandled by user code"

    Exception occoured while processing pipeline 'UCommerce.Pipelines.Transactions.Baskets.GetBasket.GetBasketPipeline'

    Inner Exception: {"Server cannot append cookies after HTTP headers have been sent."}

    Thanks very much for the continued work/support on the package - really appreciate it :-)

    Thanks,

    Rick

  • Martin 181 posts 740 karma points
    Jun 26, 2015 @ 18:23
    Martin
    0

    Hi Rick,

    First of all which version of Umbraco, uCommerce and demo store are you using? Have you modified the GetBasketPipeline?

    My guess right now is that you need to move the code for removing your line item earlier in the call stack (move it to be called before any HTML is output).

    If I get the time I can try to reproduce this error but I can't promise I get the time :)

    Best regards Martin

  • Rick 92 posts 278 karma points
    Jun 29, 2015 @ 08:28
    Rick
    0

    Hi Martin,

    Thanks for replying back, I'm using:

    • Umbraco v7.2.6
    • uCommerce 6.7.2.15167
    • Demo Store 3.0.2.14195

    I haven't modified the GetBasketPipeline.

    I've also got the code for removing the line item referenced between the tag in my RazorStore.master

    Thanks,

    Rick

  • Rick 92 posts 278 karma points
    Jul 02, 2015 @ 13:06
    Rick
    1

    I've finally figured it out ... it seemed to be the Response.Redirect that is used everywhere in the site that caused the errors above.

    I've changed the call from this...

    HttpContext.Current.Response.Redirect("/address.aspx");
    

    ...to this and now seems to work:

    HttpContext.Current.Response.Redirect("/address.aspx", false);
    

    Hope this helps someone.

    Rick

  • Martin 181 posts 740 karma points
    Jul 02, 2015 @ 18:20
    Martin
    0

    Hi Rick,

    Glad you found a solution and for posting it :)

    Best regards Martin

Please Sign in or register to post replies

Write your reply to:

Draft