Developer forum

Forum » Development » SalesDiscount extensions

SalesDiscount extensions


Reply

Hi


 


We have a website with a shoppingcart included in the page template. Until the recent "application" update the salesdiscounts were invoked on every request to any page including a shoppingcart. After I have updated the system with the newest "Application.zip" file the salesdiscount classes are only called on pages that include a shopping-cart module.


 


Is this a change in the API or a bug?


 


regards

Lars Kohsel


Replies

 
Reply

Do you have an address to where the supposed error is present? There's not much to go after in your posting.


 


If you beleive that this is an error, please report this to our support department. Thanks:)

 
Reply
lars.kohsel@valtech.dk wrote:



Hi




We have a website with a shoppingcart included in the page template. Until the recent "application" update the salesdiscounts were invoked on every request to any page including a shoppingcart. After I have updated the system with the newest "Application.zip" file the salesdiscount classes are only called on pages that include a shopping-cart module.


Is this a change in the API or a bug?






regards




Lars Kohsel





It's not a bug or API change, but an optimization. We've been doing some performance optimization in the latest builds, and this changes the behaviour a bit. The rule (now and before) is that the SaleDiscountProvider gets called everytime the cart needs to be recalculated. The difference in the current build is that we don't recalc the cart as much as we used to (on each request), but instead caches it's values until the cart gets changed. So for you it's feels like we changed the way we call the SaleDiscountProvider, but we really just try to calculate the cart a little smarter. This also means the you're right in that we only call the SaleDiscountProvider when the cart is included on a page. Because you have to go there to change the content of the basket.


 


Hope it make things a little clearer. If it changes you logic in an unexpected way, other that the above. Please write me back, and I'll digg a little deeper.


 


Regards


Klavs Martens







 








 

 

You must be logged in to post in the forum