Question on how to do this in Product Promo

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

Question on how to do this in Product Promo

ian tabangay
Hi.
I would like to ask for suggestions on how I could define the following
product promotions on ofbiz:

  Give product A to every nth customer. Otherwise, give them product B

Examples:
 - Give a free gallon of ice cream for every 10th customer and a box of
cones for the others
 - Give a 20% discount for every 20th customer and a raffle coupon for the
others for every $100 worth of sales

Another variation of this type of promo would be:

  Give product A to the nth customer every x hours

Example:
 - Give a free ice cream for the first customer after every hour

Thanks in advance.


~ ian
Reply | Threaded
Open this post in threaded view
|

Re: Question on how to do this in Product Promo

cjhorton
This post was updated on .
I am sure others have done something similar to this so hopefully someone with more knowledge responds.

This is just off the top of my head, but Take a look at the following entities:

visit, visitor, userLoginHistory, RecurrenceRule, and RecurrenceInfo, and the other price/promo entities

Perhaps you will need an EECA on the userLoginHistory or visitor entity with a service that determines the uniqueness of a userLogin(looks at a window of logins...don't want the same customer logging in and out over and over to get the promo).  This attribute is stored in the session. You can customize the promo java events so that this attribute is used at if the productpromorule and related entities require it.

-CJ


ian tabangay-2 wrote
Hi.
I would like to ask for suggestions on how I could define the following
product promotions on ofbiz:

  Give product A to every nth customer. Otherwise, give them product B

Examples:
 - Give a free gallon of ice cream for every 10th customer and a box of
cones for the others
 - Give a 20% discount for every 20th customer and a raffle coupon for the
others for every $100 worth of sales

Another variation of this type of promo would be:

  Give product A to the nth customer every x hours

Example:
 - Give a free ice cream for the first customer after every hour

Thanks in advance.


~ ian
Reply | Threaded
Open this post in threaded view
|

Re: Question on how to do this in Product Promo

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What are you trying to accomplish?

cjhorton sent the following on 3/15/2009 12:19 PM:

> I am sure others have done something similar to this so hopefully someone
> with more knowledge responds.
>
> This is just off the top of my head, but Take a look at the following
> entities:
>
> visit, visitor, userLoginHistory, RecurrenceRule, and RecurrenceInfo, and
> the other price/promo entities
>
> Perhaps you will need an EECA on the userLoginHistory or visitor entity with
> a service that determines the uniqueness of a userLogin(looks at a window of
> logins...don't want the same customer logging in and out over and over to
> get the promo).  This attribute is stored in the session. You can customize
> the promo java events so that this attribute is used at if the
> productpromorule and related entities require it.
>
> -CJ
>
>
>
>
>  that looks in the  qualifies(unique userLogin per X amount of visits or
> userLogins...etc..don't want the same customer logging in and out over and
> over to get the promo) to receive the promotion.  Then you would have to
> customize the promotion event code/etc.
>
> It actually sounds like a really good promo feature to have.
>
>
> ian tabangay-2 wrote:
>> Hi.
>> I would like to ask for suggestions on how I could define the following
>> product promotions on ofbiz:
>>
>>   Give product A to every nth customer. Otherwise, give them product B
>>
>> Examples:
>>  - Give a free gallon of ice cream for every 10th customer and a box of
>> cones for the others
>>  - Give a 20% discount for every 20th customer and a raffle coupon for the
>> others for every $100 worth of sales
>>
>> Another variation of this type of promo would be:
>>
>>   Give product A to the nth customer every x hours
>>
>> Example:
>>  - Give a free ice cream for the first customer after every hour
>>
>> Thanks in advance.
>>
>>
>> ~ ian
>>
>>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJvXkzrP3NbaWWqE4RAq6iAKC6vm4VIjMd7tZjTQ0K3B5KH8Q/jwCgruoi
AJ6qbD+104uL8kGJmsNGJ1M=
=FMV9
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: Question on how to do this in Product Promo

cjhorton
It sounds like he is wanting to create a virtual "doorbuster".

I guess what I was trying to get at is that he is going to have to have some
sort of check on userLoginHistory or visits.  I was thinking of having an
EECA so that when the appropriate entity has a create then a service is ran
that goes through the entity and looks at a window of entries and gathers
statistics on it.  This information will need to be stored somehow so he can
use those in his promo rules. Information like this visitor is the nth
unique visitor in the the x time frame.

He will need to make entries in the enumeration entity mimicking something
like PPIP_PARTY_ID, but instead something like PPIP_VISIT_ATT.  Then, in
ProductpromoCond he could have an entry inputParamEnumId=PPIP_VISIT_ATT,
operatorEnumId=PPC_EQ, and condValue=whatever.

He will have to look at ProductPromoWorker.java and see how the framework
utilizes all of this stuff.

I haven't had time to trace out the code to see if this is logical, but
perhaps it will give him a little guidance.

-CJ