Developer forum

Forum » Development » notify page template of product added to cart

notify page template of product added to cart


Reply

Hi!

 

Is there a way to notify my page template that a product has been added to my cart?

I'd like to use a yellow-fade technique, or something simmilar, to tell the customer that a product has indeed been placed in the cart.

I tried adding a querystring to the buy-link, but it is stripped before returning to the page.

 

Any ideas?


Replies

 
Reply

The problem is the redirect ability, otherwise you could simply use the CartLineAdded notification to set a tag in PageView.TemplatePage. So use the notification to set at session value, and then use a PageTemplateExtender to measure that session value, and when toe proper conditions are fulfilled, generate a tag using the SetTag method of the TemplateV2.Template object.

 

Btw. it's good practice to set the tag to an empty value when the conditions are not fulfilled. That way the tag shows in the list then you use DwTemplateTags:

 

if (condition){

    Template.SetTag("MyTag", "1");

}else{

    Template.SetTag("MyTag", "");

}

 
Reply

hi

 

Does that mean it has to be a custom solution?

I put the yellow-fade trigger on the onclick event of the buy link. It kinda gave the same effect, but of course before the redirect.

 
Reply

Yes, it would be a custom solution.

 

You must be logged in to post in the forum