Login  Register

Re: Promo items

Posted by Adam Heath-2 on Apr 29, 2010; 9:54pm
URL: http://ofbiz.116.s1.nabble.com/Promo-items-tp2073637p2076247.html

Robert Morley wrote:

> On Apr 29, 2010, at 2:31 PM, Adam Heath wrote:
>
>> Robert Morley wrote:
>>> We have not implemented promos to date, but can you comment on how the
>>> promo adjustments would be created for a quantity like 1.542?  I would
>>> agree rhat having a single adjustment for the order item line (per
>>> promo) would make the most sense.
>>
>> You misunderstand.  Add stock for 5000 items for a PROMO_GWP.  Add
>> enough stock for the parent item too.  Then add a quantity of 'two
>> thousand' on the original product.  Watch ofbiz fall over.
>>
>> I think you are interpetting the ',' as a '.'.
>>
>
> I got the impression when Ean said "then the result is both a large
> quantity of promo adjustments" that Ofbiz was creating an adjustment for
> each of the product quantities.  That is to say if you had an item with
> a quantity of 10 with promo it would add 10 individual adjustments ...
> and when you went up really high it caused issues.  Is that not the
> case?  My question was actually, if that is the case what would ofbiz
> due with quantities that were not evenly divisible by 1 (i.e. 1.542).

Well, I don't know about your question, it really should be a separate
thread(or change the subject).

What we are seeing, is that getSurvey is being called on the product,
2000+ times.  It's also hitting the database quite a bit, because of
one missing findByAndCache call on ProductCategoryMember(I'll send a
patch for this one eventually).

There's no reason to call getSurvey over and over with the same
parameters.  However, there's also no way for it to cache that call.
The real fix here is to allow each promo action to 'swallow' as much
quantity as is allowed, instead of the higher code looping once for
each whole number of quantity.

>