Developer forum

Forum » Development » customer center repeated order

customer center repeated order


Reply

In the listing of orders I need a button so that the customer can add this order to the cart.

How do I do this?

 

The orders in the list have calculated values that need to be sett in custom templateTag.

How do I add templateTags to customerCenter?


Replies

 
Reply

The first question is out-of-the-box functionality. Check it out.

 

The second... Well, you don't, but i think you could work your way around it by merging these tags using the PageTemplateExtender. In your template you provide a custom tag, that doesn't get rendered, and in you PageTemplateExtender you check for this tag and merge it with the data you want.

 
Reply
Sorensen wrote:

The first question is out-of-the-box functionality. Check it out.

 

The second... Well, you don't, but i think you could work your way around it by merging these tags using the PageTemplateExtender. In your template you provide a custom tag, that doesn't get rendered, and in you PageTemplateExtender you check for this tag and merge it with the data you want.


so i create a class with the pageTemplateExtender

should I overide the getContent class and put my tags here?

how do I get my tags to be availabe for the customercenter templtes?

 
Reply

How do you do the merging part?

I can't get the custom tags from my custom page template to the customer center template.

What do you mean by not rendering?

 
Reply

It's a bit tricky, but it can be done. You should, however, be very carefull on how you do it, as it can be very costy in performance.

 

In your list of orderlines, you make a special tag like this.

 

... <!--@MyCustomValueTag:<!--@Ecom:Order:OrderLine.ID-->-->

 

When this is rendered by the module, the HTML will look like this:

 

<!--@MyCustomValueTag:11-->

 

So in you PageView.TemplatePage, which is the old template class, you can use a regular expression to match this against the .Output method.

 

Regex reg = new Regex(@"(<!--@MyCustomValueTag:+)([0-9]+)(-->)+");

 

The for each match the ID will be in .Groups[2].ToString(). Use this to retrieve the value, and finally parse the tag using:

 

Template.SetTag("MyCustomValueTag:11", "The custom value");

 

You must be logged in to post in the forum