Developer forum

Forum » PIM » Download cart cleared after download link sent

Download cart cleared after download link sent

Justin Sjouw Dynamicweb Employee
Justin Sjouw
Reply

Hi,

On a dw 9 solution I have the situation that in the Digital Asset Portal, after sending a download link to a user via the download cart, the cart is cleared but the page is not refreshed. So when then navigating back to the product overview, the cart is empty. 

I have a few questions:

  • What is the expected behaviour for this function from dw's perspective
  • How can I refresh the page so that you can see the cart items are cleared?
  • Or how can I prevent the cart from being cleared?

Thanks.

Justin

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

What is the expected behaviour for this function from DW's perspective?
In Dynamicweb 9's Digital Asset Portal (DAP), when a download link is sent via the download cart, the expected behavior is that the cart is cleared automatically after sending. This is by design to avoid resending the same assets and to signify that the cart contents have been processed.

How can I refresh the page so that you can see the cart items are cleared?
This depends on how the page is implemented, but typically you can force a page refresh using JavaScript after the download action completes. For example:

location.reload();

Place this after the download link is sent (e.g., in the success callback of the AJAX request that sends the link). If the action is handled via a form postback or server redirect, ensure the redirect lands on a refreshed or reloaded version of the cart page.

Or how can I prevent the cart from being cleared?
There is no public configuration setting in DW9 to prevent the cart from being cleared after sending a download link. This behavior is part of the internal logic of the DAP module and cannot be overridden without customizing the underlying code.

BR Nicolai

 

You must be logged in to post in the forum