[ic] Re: Matrix or Simple Options, Require customer to choose?

John Wolgamot john at wolgamot.com
Fri Jan 9 15:33:11 EST 2004


> Quoting Mike Heins (mike at perusion.com):
> > Quoting John Wolgamot (john at wolgamot.com):
> > > I have not posted in this list so I hope I use proper posting
> etiquette.
> > >
> > > When there are simple or matrix options defined and when a
customer
> > > clicks the BuyNow button, is there a way to have interchange
require
> and
> > > notify a customer to choose an option before allowing them to
> continue?
> > >
> > > Up to this point I'm simply making the default option
> > > SELECT COLOR or SELECT SIZE etc. so that when the order comes
through,
> > > if the option in the order states SELECT SIZE then we know the
> customer
> > > forgot to select this option and we have to call to find out what
they
> > > want.
> > >
> > > I looked for a while in the lists however I had no luck locating a
> post
> > > which addresses my question. I hope I didn't give searching too
soon.
> >
> > This is a valid concern. It would be nice if the [item-options ..]
tag
> > had an option to emit a blank setting for each; then all you would
need
> > to do for matrix is add to the form:
> >
> > 	[set check_opt]
> > 		mv_sku=mandatory
> > 	[/set]
> > 	<input type=hidden name=mv_form_profile value=check_opt>
> >
> > For simple options, you could do:
> >
> > 	[set check_opt]
> > 	    [query
> > 		list=1
> > 		sql="select distinct o_group from options where
sku='[item-co
> de]'"
> > 	    ][sql-code]=mandatory
> > 	[/set]
> > 	<input type=hidden name=mv_form_profile value=check_opt>
> >
> > Putting it together:
> >
> >    [if-item-field option_type eq Matrix]
> > 	[set check_opt]
> > 		mv_sku=mandatory
> > 	[/set]
> > 	<input type=hidden name=mv_form_profile value=check_opt>
> >    [/if-item-field]
> >
> >    [if-item-field option_type eq Matrix]
> > 	[set check_opt]
> > 	    [query
> > 		list=1
> > 		sql="select distinct o_group from options where
sku='[item-co
> de]'"
> > 	    ][sql-code]=mandatory
> > 	[/set]
> > 	<input type=hidden name=mv_form_profile value=check_opt>
> >    [/if-item-field]
> >
> > A competent consultant could set up a conditional based on the value
of
> > the above options and make it work with the current code base.
> >
> > This is a good enough point so that I will put it on my todo list
> > to handle in the next release.
> 
> There are some defects to the code above, but I have gotten a changed
> version of Options/Simple.pm with the following changes to the "mike"
> flypage:
> 
> 38c38,39
> <   <FORM ACTION="[area order]" METHOD=POST>
> ---
> >   <FORM ACTION="[area href="[item-code]"]" METHOD=POST>
> >   <INPUT TYPE=hidden  NAME="mv_action"  VALUE="refresh">
> 114a116,138
> >
> >    [error auto=1 show_var=0]
> >
> >    [if-item-field option_type eq Matrix]
> >         [set check_opt]
> > 				&success=ord/basket
> >                 mv_sku=mandatory Need to select an option.
> >         [/set]
> >         <input type=hidden name=mv_form_profile value=check_opt>
> >    [/if-item-field]
> >
> >    [if-item-field option_type eq Simple]
> >         [seti check_opt]
> > 			&success=ord/basket
> >             [query
> >                 list=1
> >                 sql="select o_group,o_label from options where
> sku='[item-code]'"
> >             ]mv_order_[sql-code]=mandatory Need to select [sql-param
> o_label]
> > 			[/query]
> >         [/seti]
> >         <input type=hidden name=mv_form_profile value=check_opt>
> >    [/if-item-field]
> >
> 116c140
> < 			[item-options td=1 label=1 bold=1 price=1]
> ---
> > 			[item-options td=1 label=1 bold=1 price=1
blank_label="-
> -select--"]
> 157c181
> < 	    <input type="submit" value="[L]BUY NOW[/L]" class=button3
> style="background-color: #DDDDBB">
> ---
> > 	    <input type="submit" value="[L]BUY NOW[/L]" class=button3>
> 
> The code is in CVS now. Note that what was added is the
blank-label="--
> select--",
> which automatically puts a blank value with "--select--" as the label
in
> all of the options widgets.
> 
> With the changes above to the flypage, this should do what you need.
> 
I'm no coder but I can "kind of" see the light when the code is there
before my eyes, if I stare at it long enough.

Thanks very much. I could never have figured that out. Thanks to open
source -AND- your help I will be able to get this to work and now this
feature will show up in a future release sooner than close source so
others can benefit from it sooner.

Of course if I can't get it working, there is always perusion.com. I
know I'll be using the perusion online store one of these days. :-)




More information about the interchange-users mailing list