PDA

View Full Version : IF THEN based on basket contents


Pat
07-08-06, 03:53 PM
Using OUI, I am looking to figure out how to display a store wide header based on basket contents.

IF 'Basket contents' CIN 'Stock#1234' THEN --Display This ---

Any suggestions

Vic - WolfPaw Computers
07-08-06, 05:24 PM
In your global header add this:

%OUI%
%IF(g.Screen EQ 'INVC')%
%IF(%VAR(ORDER_QUANTITY|1234)% GT 0)%
use this header if the product is in basket....
%ELSE%
use this header if the product IS NOT in the basket...
%IFEND%
%ELSE%
%IF(%VAR(BASKET_QUANTITY|1234)% GT 0)%
use this header if the product is in basket....
%ELSE%
use this header if the product IS NOT in the basket...
%IFEND%
%IFEND%

The IF screen is needed because of the way Merchant handles the basket on the INVC screen. Once the basket is converted to an order, you need to use ORDER_QUANTITY instead of BASKET_QUANTITY.

Pat
07-08-06, 10:59 PM
Great. Thanks .

One last request.

How do I do this for all stock # that begin with '123'

That is,

IF basket contains items who stock numbers begin with '123',

THEN --display this--

Thank yoy for your help.

Vic - WolfPaw Computers
07-08-06, 11:11 PM
That would be much more complicated and slow things down.

You'd have to loop through the basket and scan each item for a match.

If you would really like to do this anyway, please contact me offlist.

PCINET - Andreas
07-10-06, 10:26 PM
I would suggest to write it in MivaScript and not OpenUI. Let me know if you need assistance and contact me directly - e-mail in footer of this message.