Override / extend events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Override / extend events

greg jocher-2
Hi all

Is there a way to add/change parameters in an event and pass it to
another (the "parent") event?

Eg:
Override addToCart, add a needed parameter and fire the "parent" event.
(controller->response: type=request)

regards
greg







Reply | Threaded
Open this post in threaded view
|

Re: Override / extend events

brajeshpatel
Hi,

Please provide more info for your question:

comment inline:

On Thu, Sep 13, 2012 at 12:47 AM, greg jocher <[hidden email]>wrote:

> Hi all
>
> Is there a way to add/change parameters in an event and pass it to another
> (the "parent") event?
>

Event don't have any definition so need not to define any parameters, if
you are working with service so need override that service in your
customize component.



>
> Eg:
> Override addToCart, add a needed parameter and fire the "parent" event.
> (controller->response: type=request)
>
> regards
> greg
>
>
>
>
>
>
>
>


--
Thanks
Brajesh Patel
Salmonllc.com
http://bigfish.salmonllc.com/bfDemo.html

skype: brajesh.patel11
Cell:- +91 8750709907
Reply | Threaded
Open this post in threaded view
|

Re: Override / extend events

greg jocher
Hi

thank you for your answer, here's a detail by example:

1. The problem:
We have virtual products with more than 2k variants.
The default generated varianttree is way to big (3mb).

2. Our solution:
We list all variants in selects and verify the combination either on
submit or by ajax.
The problem with this solution is the missing productId which is
"needed" by addToCart.
We can get the productId by ajax, but there are clients without js..

My idea was to override addToCart, add the productId to the parameter
and point the response to the overridden event (response type=request)
But then, i have to wrap HttpServletRequest... which is more a hack than
a solution.

So, is there a clean way to do such things with events or do we have to
search for another solution?


On 09/13/2012 09:18 AM, Brajesh Patel wrote:

> Hi,
>
> Please provide more info for your question:
>
> comment inline:
>
> On Thu, Sep 13, 2012 at 12:47 AM, greg jocher <[hidden email]>wrote:
>
>> Hi all
>>
>> Is there a way to add/change parameters in an event and pass it to another
>> (the "parent") event?
>>
> Event don't have any definition so need not to define any parameters, if
> you are working with service so need override that service in your
> customize component.
Yes, i know that - but if productId is not set for addToCart we get
redirected to a form which asks for it.

>
>
>
>> Eg:
>> Override addToCart, add a needed parameter and fire the "parent" event.
>> (controller->response: type=request)
>>
>> regards
>> greg
>>
>>
>>
>>
>>
>>
>>
>>
>
regards
greg
Reply | Threaded
Open this post in threaded view
|

Re: Override / extend events

Awdesh Parihar-2
Hi,

Curious to know alternate best solution for problem.

--
Regards
Awdesh Parihar
Reply | Threaded
Open this post in threaded view
|

Re: Override / extend events

greg jocher
Hi

I've found the solution: setAttribute.. my bad!
addToCart combines parameters and attributes:
UtilHttp.getCombinedMap(request)

Mea culpa!
greg

On 09/13/2012 07:22 PM, Awdesh Parihar wrote:
> Hi,
>
> Curious to know alternate best solution for problem.
>
> --
> Regards
> Awdesh Parihar
>