Developer forum

Forum » Development » Add to cart Querystring?

Add to cart Querystring?


Reply
Hi guys!

I have a bunch of questions.

1)
I see the way eCommerce handles "add to cart" is via a lot of forms with hidden inputs. What's the point in this, is it it faster? Well anyway, i extracted the id's and values from the hidden forms, and tried just to run the querysting: example "&CartCmd=add&ProductID=PROD698". Added to the address surely adds the product in the cart, nice! But it also takes me from the page im currently on, to the root of the shop. This does not happen when you just submit a form... How can you add via querystring and stay on the same page?

2)
How do i disable the cart on a page?

3)
Where do i change the order of the eCommerce elements on a page. For example if i want the cart to shop under the content, and not above?

3)
I couldn't find any coding documentation. Is there any kind of documentation for coders to eCommerce? For example where is it explained how eCommerce handles adding things to the cart etc, what i found i right now is just from experimenting. It would be easier if could just read about it somewhere, for example see a list of querystrings to add/delete from the cart, that would be great!

Many thanks in advance!





Replies

 
Reply
Here again. Well 2 and 3 i figured out fairly quickly; you can disable modules and shuffle them around when viewing the original page in DW.

Another question though: since i don't know quite how to retrieve anything with Ajax in DynamicWeb i just used a good old iframe to retrieve and update the basket content. But adding a querystring to the iframe src seems to make DW respond with (seen trough firebug>net):
Failed to load source
Is there some kind of security measure that kicks in when trying to update the basket trough an Iframe?

and a bonus question, is there some way to do this this with ajax?

Thanks in advance!

UPDATE:

To clarify.

1)I request a add item trough a querystring in an iframe:
URL+   ?CartCmd=add&ProductID=PROD510

2)the server response is:

Failed to load source for: http://www.digibutik.dk/DiGiDi-712.aspx?CartCmd=add&ProductID=PROD510 the iframe is then relocated to the parent page(the page that contains the iframe) so you have the page, in the page. but what is weird is that the basket _has_ been updated, it just wont show me the page with the basket!?



 
Reply
Hi Aske

1) Yes you can add products to the cart from the QS as you do. I think the problem is that you delete all other querystring values, which may include the product or the product group we look at right now. This is why you are redirected to the main product catalog.

4) All available doc is at http://engage.dynamicweb-cms.com/Development-200.aspx

 - I don't think DW eCom checks if the cart is updated from an iframe.

 - There is no AJAX in DW eCom API

Hope this helps

 - Lasse
 
Antonio Amézquita Ganoza
Reply
Hi there

I am struggling with adding the shipping method from the query string to my cart via Ajax, 
is it possible?

 

You must be logged in to post in the forum