eCommerce Plugin - tax type chooser

0 views
Skip to first unread message

Martin Orth

unread,
May 13, 2007, 6:42:35 AM5/13/07
to farcr...@googlegroups.com, mod...@daemon.com.au
Hello,

currently I am working on an eccommerce plugin for farcry 4.0. It will
be made up of a product custom type (visible in tree), a custom rule
to show a products category description and a productlisting of
products beneath a navigation node and a shopping cart with checkout
process. It will also contain custom types for customers, orders,
orderitems, shippingaddress, tax, shopsettings and so on. Handling of
shipping an payment is a little bit complicated and will be attached
later. Maybe I will allow multiple stores in one farcry instance.

Now my questions: How can I join different customtypes within
formtools to show a dynamic selectbox? e.g. show a select control to
choose the tax type/rate of a product.

Thanks

Martin

PS: Is there anybody out there with strong farcry skills who is
willing to help me to develope the ecommerce plugin? Geoff: Is it
possible to get svn access for this?

Matthew Bryant

unread,
May 23, 2007, 8:51:11 PM5/23/07
to farcr...@googlegroups.com
Hi Martin,

There are a number of ways to do this if I understand your question correctly.

Lets say your custom type is called order.cfc and tax.cfc

In order.cfc is a property
<cfproperty name="taxID" type="uuid" ftType="list" ftListData="getTaxOptions" ftListDataTypename="tax" />

In tax.cfm create a function called "getTaxOptions". In that function do your query that returns all tax records and pass back a list of value:name pairs.

The contents will look something like:

-----------------------------------------------------------------------------
<cfset var rTaxList = "" />

<cfquery datasource="#application.dsn#" name="qTaxOptions">
SELECT objectID,Name
FROM tax
ORDER BY Name
</cfquery>

<cfloop query="qTaxOptions">
<cfset rTaxList = listAppend(rTaxList, "#qTaxOptions.objectID#:#qTaxOptions.Name#") />
</cfloop>

<cfreturn rTaxList />
-----------------------------------------------------------------------------

Two things to note here.
1. The type is UUID which is the database type but formtools sees it as ftType="list".
2. It would be nice to be able to return a query from the function to populate the list function but it just doesn't work like that at the moment, so value:name pairs it is.


Kind regards

--
-- Matthew Bryant
Product Development Manager
Daemon Internet Consultants
Adobe Solutions Partner
p. 02 9380 4162
f. 02 9380 4204



David Whiterod

unread,
May 24, 2007, 5:31:07 AM5/24/07
to farcry-beta
Matthew Bryant wrote:
> <cfloop query="qTaxOptions">
> <cfset rTaxList = listAppend(rTaxList,
> "#qTaxOptions.objectID#:#qTaxOptions.Name#") />
> </cfloop>
>
> <cfreturn rTaxList />
> ------------------------------------------------------------------------

> 2. It would be nice to be able to return a query from the function to


> populate the list function but it just doesn't work like that at the
> moment, so value:name pairs it is.

Hi Matt,

I have been thinking it would be a good idea to create a function on
the base FT cfc that would take a query and return the list formatted
as needed by the list FT (as you posted above).

i.e.
Do query
then <cfreturn formatFTList(qTaxOptions,"objectid","name") />
(maybe make the items optional and they could default to some
standard)

This would save the same code having to be duplicated and allow the FT
list format to be changed in the future.

What do you think?

cheers

David

MJB

unread,
May 25, 2007, 6:19:18 PM5/25/07
to farcry-beta
I like that idea. However I was thinking that you could simply pass a
query back (instead of a list) with the columns value|name. The
formtool would then handle it for you.
As long as the query contained those 2 columns your good to go. It
just seems a tiny bit easier.

What do you think? Open to suggestions.

Cheers, Mat.
http://www.daemon.com.au

Matthew Bryant

unread,
May 27, 2007, 6:26:40 PM5/27/07
to farcr...@googlegroups.com
ftType="list" will now accept a query back from the ftListData function.


Kind regards

--
-- Matthew Bryant
Product Development Manager
Daemon Internet Consultants
Adobe Solutions Partner
p. 02 9380 4162
f. 02 9380 4204




David Whiterod

unread,
May 27, 2007, 9:40:16 PM5/27/07
to farcry-beta
Hi Mat,

I like the simpler idea.

What about another item name other than 'value'. While 'value' matches
the HTML select nicely, MS lists 'value' as a current ODBC reserved
word and future reserved word for SQL Server [1].

... nothing super exciting comes to mind but other options might be:
identifier; lookupvalue.

cheers

David

[1] http://msdn2.microsoft.com/en-us/library/aa238507(SQL.80).aspx

On May 28, 7:26 am, Matthew Bryant <mbry...@daemon.com.au> wrote:
> ftType="list" will now accept a query back from the ftListData function.
>
> For details see:http://docs.farcrycms.org:8080/confluence/display/
> FCDEV40/list
>
> Kind regards
>
> --
> -- Matthew Bryant
> Product Development Manager
> Daemon Internet Consultants

> Adobe Solutions Partnerhttp://www.daemon.com.au/

> > --
> > Message protected by MailGuard: e-mail anti-virus, anti-spam and
> > content filtering.
> >http://www.mailguard.com.au/mg
>
> --
> Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.http://www.mailguard.com.au/mg

Matthew Bryant

unread,
May 28, 2007, 2:55:49 AM5/28/07
to farcr...@googlegroups.com
I can put [] around the [value] field but I think if MS actually went and made this a reserved word, the world could quite possibly come to an end.

I can think of about 5 applications off hand that I have personally used the fieldname value in the database. Bugger...


Kind regards

--
-- Matthew Bryant
Product Development Manager
Daemon Internet Consultants
Adobe Solutions Partner
p. 02 9380 4162
f. 02 9380 4204




Josen Ruiseco

unread,
Aug 8, 2007, 10:46:13 AM8/8/07
to farcr...@googlegroups.com

Martin,

Did anything come of this?
--
View this message in context: http://www.nabble.com/eCommerce-Plugin---tax-type-chooser-tf3734630s621.html#a12054760
Sent from the FarCry - Beta mailing list archive at Nabble.com.

Travis Young

unread,
Aug 9, 2007, 9:57:14 PM8/9/07
to farcr...@googlegroups.com
Is there an easy way to grab a user id from the Session variable?

I want to make sure that a user is logged into FarCry before
accessing sub sites, such as Forum.

Travis Young

unread,
Aug 9, 2007, 11:43:43 PM8/9/07
to farcr...@googlegroups.com
That works... ie:

<cfoutput>
#session.dmProfile.firstname#
</cfoutput>

Unless there is an application.cfm defined (and it can be blank) in the child's directory.  as soon as I create an application.cfm in a child's subdirectory (such as http://myfarcrysite/forum/application.cfm), none of my session.dmProfiles come up from the parent's directory (such as http://myfarcrysite).  

Is it possible that an application.cfm file in a child's directory destroys sessions variables that should come up from a parent?







On Aug 9, 2007, at 9:59 PM, Prasad Mangalagiri wrote:


Here is the code.

#session.dmProfile.Firstname# 
#session.dmProfile.lastname# 
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "farcry-beta" group.
To post to this group, send email to farcr...@googlegroups.com To
unsubscribe from this group, send email to
For more options, visit this group at
-~----------~----~----~----~------~----~------~--~---


----------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
----------------------------------------------------


Travis Young - President
Direct:  (407) 401-7047



Travis Young

unread,
Aug 10, 2007, 1:05:10 PM8/10/07
to farcr...@googlegroups.com
I figured out that if I include the root's application.cfm first its all good...

forum/Application.cfm

<cfinclude template="/Application.cfm">
<cfif NOT StructKeyExists(session, "dmProfile") OR
      NOT StructKeyExists(session.dmProfile,"firstname")>
<cflocation url="/" addtoken="no">
</cfif>




but why?  Does the root application.cfm set the session.dmprofile every page view?  Maybe unsets it in an onRequestEnd?  If it did this wouldnt it kill performance?







On Aug 9, 2007, at 9:59 PM, Prasad Mangalagiri wrote:


Here is the code.

#session.dmProfile.Firstname# 
#session.dmProfile.lastname# 

-----Original Message-----
On Behalf Of Travis Young
Sent: Friday, 10 August 2007 11:57 AM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "farcry-beta" group.
To post to this group, send email to farcr...@googlegroups.com To
unsubscribe from this group, send email to
For more options, visit this group at
-~----------~----~----~----~------~----~------~--~---


----------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
----------------------------------------------------
Reply all
Reply to author
Forward
0 new messages