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.

  • Peter Jensen 32 posts 137 karma points
    Feb 09, 2014 @ 13:49
    Peter Jensen
    0

    Adding multiple products to the basket via api

    Hey uCommerce experts 

    I have manage to modify the demo shop to my needs and now i want to add a feature where the user can click a checkbox that says "include screws" and that is a product that is related to the current product, and all that works like a charm thx to sørens nice guide. 

    the problem orcures when i add items via $.uCommerce.addToBasket(); method suddenly the basket total amount and subtotals are not correctly updated, if i only add one product it works, but if i add 2 only the last product added is the one reflected in total amount in the basked, even thoug the orderlines are correct, and when i move to shipping details the order amounts are corrected. and are reflected as they should be. 

    if i investegate the request made from ajax i can see that it calls the add method with all the right data but the getBasket method gets called after the add method only grabs the last product in total amount but has both orderlines. 


  • Morten Skjoldager 440 posts 1499 karma points
    Feb 10, 2014 @ 10:51
    Morten Skjoldager
    0

    Hello Peter,

    It looks like you do not execute the basket pipeline correctly. This should be done every time you modify the basket. And that may be why you experiance that the basket is showed correctly at the next page (the basket pipeline is executed when the page changes if i remember correctly). 

    Can you verify that this is the problem? Otherwise please try to append some code that shows what you're trying to achieve. 

    Best regards

    Morten

Please Sign in or register to post replies

Write your reply to:

Draft