Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > OnSelectionIndexChanged and UniSelector embedded in PaymentSelector. View modes: 
User avatar
Member
Member
magnus-tenk - 7/7/2012 6:16:15 PM
   
OnSelectionIndexChanged and UniSelector embedded in PaymentSelector.
I would like to bind to this event so that I can trigger recalculation of the shopping cart total price when I change payment method. I would appreciate any ideas.

I have rewritten the entire shoppingcart to a single page step using an update panel. I want the event to trigger in realtime on the client side change of payment method.

The first method I tried was to modify hack the CMSAdminControls_UI_UniSelector_UniSelector to do what I wanted, but the actual Items collection seem to be declared private in the UniSelector and I can't seem to find a way to twist it's arm to do what I want.

What about other methods? I guess it would be possible to write one of them custom queries and then access it through CMS.DataEngine , but that also seem like a terrible hassle for something simple.

Have I overlooked some really simple way to do this?

/Magnus

User avatar
Member
Member
egarrison-wte - 7/8/2012 7:17:56 AM
   
RE:OnSelectionIndexChanged and UniSelector embedded in PaymentSelector.
If you have AutoPostBack True on the Payment Types field, it then will hit your CodeBehind and you should be able to call the recalculation in there. The Recalculation function already exist, so you need to find the reference to it and move just the call to recalculate up where you update the payment type.


User avatar
Member
Member
magnus-tenk - 7/9/2012 10:56:01 AM
   
RE:OnSelectionIndexChanged and UniSelector embedded in PaymentSelector.
Thank you for your reply it put me on the right track. At sometime I started to ignore the fact that AutoPostBack didn't do anything without digging deeper into the problem. It turns out that PaymentSelector doesn't implement the AutoPostBack property + eventhandler, but ShippingSelector does, so it was an easy fix.

I'm running Hotfix version 29 on my machine, so perhaps this have been patched already.

/Magnus

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 7/13/2012 5:16:07 AM
   
RE:OnSelectionIndexChanged and UniSelector embedded in PaymentSelector.
Hi,

Thanks for sharing the solution here.
Should you need any additional details, please feel free to ask.

Regards,
Zdenek