Took me a while to look at it - but I got it now.
> <cfinvoke component="cart2" method="get"
> returnvariable="objCart"></cfinvoke>
>
> <cfif isDefined("URL.AddToCart")>
> <cfset sucess = objCart.AddToCart(URL.idProduct, URL.qty)>
> </cfif>
If you look at this code - returnVariable 'objCart' is the retun out from createCart -
which is just a struct.. and not an instance of the CFC at all.
hence when you call the method on objCart - the error occurs.
Personally - I would have handled the creation/maintenance of the session.cart
instance in the application.cfm, and not had the CFC even look at the session
scope.
Remember - proper OOA/OOD - good cohesion states that an Object should have
a singular task. A shopping cart should only manage the shopping cart. It
shouldn't look at if it exists or not.
JMHO.
Mark
-----------------------------------
[EMAIL PROTECTED]
ICQ: 3094740
Safe From Bees
[www.safefrombees.com]
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/