[ic] One-click order

Mike Heins interchange-users@icdevgroup.org
Sat Jul 20 16:32:01 2002


Quoting Dan Browning (dbml@kavod.com):
> I think it would be handy for debugging purposes to have the ability to 
> have one link to click that would do the following without further user input:
> 
>   * Add a few products to the cart (at random or by other means)
>   * Populate the standard form variables (name, etc.)
>   * (Optional) Login with a specific username/pass
>   * Populate the credit card number with "4111 1111 1111 1111"
>   * Place the order
> 
> Has anyone already done something similar?

It is pretty easy. Just place this in a test page:

    [tmp itemstuff]
	[loop random=5
		search="
		    ra=yes
			st=db
			fi=products
		"][loop-calc]
		$todo = int( rand(6) ) || 1 if ! defined $todo;
		return if ++$done > $todo;
		my $quan = int rand(10) || 1;
		return qq{
		    mv_order_quantity=$quan
		    mv_order_item=[loop-code]
		};
	[/loop-calc][/loop]
    [/tmp]

    To order:
    <xmp>[scratch itemstuff]</xmp>

	[page
	    form=|
		    mv_username=jking
		    mv_password=king
		    mv_click=Login
		    mv_action=submit
		    mv_order_profile=credit_card
		    mv_shipmode=PERD
		    mv_credit_card_number=4111 1111 1111 1111
		[time adjust="5 weeks"]
		    mv_credit_card_exp_year=%y
		    mv_credit_card_exp_month=%m
		[/time]
		    [scratch itemstuff]
	    |]Order this</A>

Voila! Patent violation!

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

My wife is great.  She doesn't care where I go, just as long as I don't
have any fun.  -- Lee Trevino