[docs] docs - danb modified icfaq.sdf
docs@icdevgroup.org
docs@icdevgroup.org
Mon Oct 14 12:53:01 2002
User: danb
Date: 2002-10-14 16:52:20 GMT
Modified: . icfaq.sdf
Log:
* "Save This Cart" & "Set As Recurring Order" documentation.
* mv_pc update
Revision Changes Path
1.18 +87 -4 docs/icfaq.sdf
rev 1.18, prev_rev 1.17
Index: icfaq.sdf
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/docs/icfaq.sdf,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- icfaq.sdf 23 Sep 2002 11:15:19 -0000 1.17
+++ icfaq.sdf 14 Oct 2002 16:52:19 -0000 1.18
@@ -1,10 +1,10 @@
!init OPT_LOOK=3D"akopia"; OPT_STYLE=3D"manual"
-# $Id: icfaq.sdf,v 1.17 2002/09/23 11:15:19 racke Exp $
+# $Id: icfaq.sdf,v 1.18 2002/10/14 16:52:19 danb Exp $
=20
!define DOC_NAME "Frequently Asked Questions"
!define DOC_TYPE ""
!define DOC_CODE "icfaq"
-!define DOC_VERSION substr('$Revision: 1.17 $',11, -2)
+!define DOC_VERSION substr('$Revision: 1.18 $',11, -2)
!define DOC_STATUS "Draft"
!define DOC_PROJECT "Interchange"
!define DOC_URL "http://interchange.redhat.com/doc/icfaq.html"
@@ -1135,7 +1135,90 @@
DBI simply does not support tablename.fieldname in the return value.
=20
You can just refer to them by the fieldname. In the case of field names th=
at are the same but need to be selected from different tables, you can use =
"SELECT orderline.quantity as o_quan,..." and refer to it as [sql-param o_q=
uan].
-=20
+
+H2: How do I modify the Save Cart and Recurring Cart feature? How do they=
work?
+
+The code for these features is in templates/components/cart. The relative=
portion that is executed first when you call the basket page is this:
+
+!block example
+ [button
+ text=3D"Save This Cart"
+ src=3D"__THEME__/savecart.gif"
+ extra=3D"class=3Dcontentbar2"
+ hidetext=3D1
+ form=3Dbasket
+ mv_check=3D"Save This Cart"
+ ]
+ mv_todo=3Dreturn
+ mv_nextpage=3Dord/basket
+ save_cart=3Dcart
+ [/button]
+ [button
+ text=3D"Set As Recurring Order"
+ src=3D"__THEME__/saverecur.gif"
+ extra=3D"class=3Dcontentbar2"
+ hidetext=3D1
+ form=3Dbasket
+ mv_check=3D"Set As Recurring Order"
+ ]
+ [set save_cart]recurring[/set]
+ mv_todo=3Dreturn
+ mv_nextpage=3Dord/basket
+ save_cart=3Drecurring
+ [/button]
+!endblock
+
+This creates two buttons that set save_cart to either 'cart' or 'recurring=
', then go to the ord/basket page (where you are already). When clicked, o=
ne of these two code blocks will be executed:
+
+!block example
+ [if value save_cart eq 'recurring']
+ <FORM ACTION=3D"[process-target]" METHOD=3DPOST>
+ To save this recurring order, give it a nickname, then press 'Sav=
e Cart'.<br>
+ Nickname:
+ <INPUT TYPE=3DTEXT NAME=3D"c_nickname" SIZE=3D11 VALUE=3D"[scratc=
h just_nickname]">
+ <input type=3Dhidden name=3Dmv_session_id value=3D"[data session =
id]">
+ <INPUT TYPE=3DHIDDEN NAME=3D"c_recurring" VALUE=3D"1">
+ <INPUT TYPE=3DHIDDEN NAME=3D"save_cart" VALUE=3D"recurring">
+ <INPUT TYPE=3DHIDDEN NAME=3D"mv_todo" VALUE=3D"return">
+ <INPUT TYPE=3DHIDDEN NAME=3D"mv_check" VALUE=3D"Save Cart">
+ <INPUT TYPE=3DSUBMIT VALUE=3D"Save Cart">
+ </FORM>
+ [elsif value save_cart eq 'cart']
+ <FORM ACTION=3D"[process-target]" METHOD=3DPOST>
+ To save this cart, give it a nickname, then press 'Save Cart'.<br>
+ Nickname:
+ <INPUT TYPE=3DTEXT NAME=3D"c_nickname" SIZE=3D11 VALUE=3D"[scratc=
h just_nickname]">
+ <INPUT TYPE=3DHIDDEN NAME=3D"c_recurring" VALUE=3D"0">
+ <INPUT TYPE=3DHIDDEN NAME=3D"save_cart" VALUE=3D"cart">
+ <INPUT TYPE=3DHIDDEN NAME=3D"mv_todo" VALUE=3D"return">
+ <INPUT TYPE=3DHIDDEN NAME=3D"mv_check" VALUE=3D"Save Cart">
+ <input type=3Dhidden name=3Dmv_session_id vlaue=3D"[data session id]">
+ <INPUT TYPE=3DSUBMIT VALUE=3D"Save Cart">
+ </FORM>
+ [/elsif]
+!endblock=20=20
+
+The "nickname" for the cart is set earlier via:
+
+!block example
+[if !scratch just_nickname]
+ [seti just_nickname][tag time]%b-%d-%Y[/tag][/seti]
+[/if]
+!endblock
+
+The real work is done because of this: {{EX:<INPUT TYPE=3DHIDDEN NAME=3D"=
mv_check" VALUE=3D"Save Cart">}} which calls the following code after the t=
he user clicks "Save Cart":
+
+!block example
+ [set Save Cart]
+ mv_todo=3Dreturn
+ mv_nextpage=3Dord/basket
+ save_cart=3Dnone
+ [save_cart nickname=3D"[value c_nickname]" recurring=3D"[value c_recurr=
ing]"]
+ [/set]
+!endblock
+
+Which in turn calls the usertag "save_cart" with a nickname parameter and =
a recurring parameter. Depending on which button was clicked, recurring wi=
ll either be 0 (for "Save This Cart") or 1 (for "Set As Recurring Order"). =
The save_cart usertag adds the cart to the userdb.carts field as a Perl da=
ta structure (hashes, arrays, etc.).
+
H1: Errors
=20
H2: Sorting doesn't work across multiple pages.
@@ -1987,7 +2070,7 @@
=20
H2: What does the "mv_pc" variable added to every URL mean?
=20
-Its purpose is to make each link unique so that users behind a proxy (e.g.=
AOL) will not have dynamic content cached.=20
+It can be used to prevent the users' browser from caching dynamic content,=
or, combined with the session 'id', it can make every link unique so that =
the users behind a proxy (e.g. AOL) will not have dynamic content cached.=
=20
=20
H2: Where is process.html?
=20