Developer forum

Forum » Development » Auto Capture eCom v2

Auto Capture eCom v2


Reply
Hi,

To auto capture orders in DIBS eCom v2 I need to add a parameter called "capturenow" in the checkout formuler.

I was hoping that I could do this on specific products only. But I cant see how?


Any ideas?


Can I by converting the template to xslt include a orderlist loop and then check the product parrent group, or something?

Or even 2 different shops?


/Rasmus






Replies

 
Nicolai Høeg Pedersen
Reply
You have the dibs template in which you can loop through the order lines so thats an option.

Another option would be using OrderIsPassedToCheckoutHandler which is passed the checkouthandler instance (Dibs checkout handler) and the order instance:
http://engage.dynamicweb-cms.com/api/ecommerce/?Dynamicweb~Dynamicweb.Ecom7.Cart.Notifications~OrderIsPassedToCheckoutHandler.html

You can then take a look at the orderlines and change the PostTemplate property runtime if requirements are met, to a version that has that extra parameter.
 
Nicolai Høeg Pedersen
Reply
I can also provide you with the source for the DIBS checkout handler - then you can manipulate it to accomodate your needs.
 
Reply
Hi Nicolai,

Thank you 4 your quick reply.

When I insert the dwtemplatetags on the checkup template "eCom7\CheckoutHandler\DIBS\Post\Post.html" I only see Dibstags.

No loops are available...-
 
Reply
That I wont say no to. :)
 
Nicolai Høeg Pedersen
Reply
Attached all our checkout handlers. You just need the DIBS. Remember to rename namespace and add-in.
 
Reply
Isn't it possible with out making custom code?
You where talking about looping orderlines in the dibs templates?
 
Nicolai Høeg Pedersen
Reply
No - the standard DIBS checkout handler does not render the order.

But you can add it yourself:

case PostModes.Template:
LogEvent(order, "Render template");

// Get template
var formTemplate = new Templatev2.Template(PostTemplate);

// Render tags
foreach (var x in formValues)
{
   formTemplate.SetTag(string.Format("Dibs.{0}", x.Key), x.Value);
}

var r = new eCommerce.Frontend.Renderer(Dynamicweb.Frontend.PageView.Current());
r.RenderOrder(order, formTemplate);

// Render and return
return formTemplate.Output();

I've added it to our version of DIBS checkout handler, but it is not available untill 7.2 release.

 
Reply
What if I wanted to base my check on witch product-group the product was located?

What approach would you recommended?

In the future would it be possible to change the checkout template? And fx. replace it with a xslt-template?
 
Nicolai Høeg Pedersen
Reply
You can change the checkout template from management center where you set up the different gateways. And you can use XSLT as well as HTML.

If you need that specific handling of the checkout you need to either do a custom checkout handler, or handle it on the step just before checkout.

In that step you can do either some code or some template work that makes sure that a proper gateway setup is chosen.

You can setup multiple DIBS checkouts with different templates - one with autocapture and one without. Then in the step just before the payment, you can do some magic choosing the right one...

 

You must be logged in to post in the forum