Well, I can't really give you a definitive answer-- only the
AbleCommerce people can.

Try removing
#set( $shipment = $shipments )

and see what happens.  If the application is providing you with
$shipment as a reference, then you don't need to set it.

WILL

On 1/26/07, Robert Reil <[EMAIL PROTECTED]> wrote:
Will!

How would you call this item then?
Please don't give up on me I am so close to figuring this out but cant quite
get the right combination.


Robert P. Reil
Managing Director,
Motorcyclecarbs.com, Inc.
4292 Country Garden Walk NW
Kennesaw, Ga. 30152
Office 770-974-8851
Fax 770-974-8852
www.motorcyclecarbs.com

-----Original Message-----
From: Will Glass-Husain [mailto:[EMAIL PROTECTED]
Sent: Monday, January 22, 2007 12:54 AM
To: Velocity Users List
Subject: Re: HELP!!!! Able Commerce Email Problem in Velocity Programming

Why do you keep putting in the #set:
#set( $shipment = $shipments )

That sets $shipment to something entirely new.  If your docs tell you that
$shipment is provided, just use it.

WILL

On 1/21/07, Robert Reil <[EMAIL PROTECTED]> wrote:
> I am starting to feel stupid here....
> I just ran
> *****
> <html>
> <head>
> </head>
> <body>
> #set( $shipment = $shipments )
>
> <p><strong>Bill To</strong>:<br>
>   #set ($billAddress = $user.getBillAddr())
> $billAddress.getFirstName()
> $billAddress.getLastName() <br>
>   $LocaleUtils.formatAddress($token,$billAddress,true) </p>
>
> <strong>Ship To</strong>:<br>
>   $shipment.getShipAddr().getFirstName()
> $shipment.getShipAddr().getLastName()<br>
>   $LocaleUtils.formatAddress($token,$shipment.getShipAddr(),true)
>   <p><strong>$shipment.getShipMsg()</strong>             </body>
> </html>
> *****
>
> And it still returns the Ship To stings as text.
> If I ignore the #set( $shipment = $shipments ) I still get just a list
> of stings...
> What am I missing?
>
> If I read your previous replies it insinuates that if I take
> "$shipment.getShipAddr().getFirstName()
> $shipment.getShipAddr().getLastName()"
> And change it to
> "$shipment.ShipAddr.FirstName $shipment.ShipAddr.LastName"
> It should return the same result. That is without the #set.
>
> But it still did not and I am clueless as to which way to tackle this
> thing according to what you are telling me..
>
> What am I missing?
>
> Robert
>
> -----Original Message-----
> From: Will Glass-Husain [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 21, 2007 10:45 PM
> To: Carbs Sales&Service
> Subject: Re: HELP!!!! Able Commerce Email Problem in Velocity
> Programming
>
> Well, if $shipment is a Shipment object, and that object has method
> getShipAddr()
>
> then
> $shipment.ShipAddr
>
> will presumably return the shipping address.  No #set needed.
>
> WILL
>
> On 1/21/07, Robert Reil <[EMAIL PROTECTED]> wrote:
> > I found this in the Documentation!
> > Here to be specific.
> >
> http://help.ablecommerce.com/faqs/ablecommerce_55_cfmx/developer/email
> _templ
> > ates.htm
> > *************
> > Object: $shipment
> >
> >
> > Type: com.ablecommerce.ac5.shipping.Shipment
> >
> >
> > Available To:
> > ORDER_SHIPPED_FULL
> > ORDER_SHIPPED_PARTIAL
> > SHIPMENT_CREATED
> > *************
> > But now again..
> > How to make it just show the Ship To: address?
> > Again the JavaDocs are at
> > http://motorcyclecarbs.com/remove.me/javadoc/index.html
> >
> > The code I am trying to make work again is:
> >
> > <html>
> > <body>
> > <p><strong>Bill To</strong>:<br>
> >         #set ($billAddress = $user.getBillAddr())
> >         $billAddress.getFirstName() $billAddress.getLastName() <br>
> >         $LocaleUtils.formatAddress($token,$billAddress,true) </p>
> >         <br>
> > <p><strong>Ship To</strong>:<br>
> >         $shipment.getShipAddr().getFirstName()
> >           $shipment.getShipAddr().getLastName()<br>
> >
> >
$LocaleUtils.formatAddress($token,$shipment.getShipAddr(),true)
> >         <p><strong>Shipping Message:</strong>
> > $shipment.getShipMsg()</p> <br> </body> </html>
> >
> > So there should be a:
> > #set ($shipment = $?????.????????())
> >
> > How to find the ?
> >
> > Robert
> >
> > -----Original Message-----
> > From: Will Glass-Husain [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, January 21, 2007 10:03 PM
> > To: Carbs Sales&Service
> > Subject: Re: HELP!!!! Able Commerce Email Problem in Velocity
> > Programming
> >
> > Robert,
> >
> > Your problem sounds pretty specific to AbleCommerce.  Just to be
> > clear, (you probably know this) the Velocity project has no
> > connection to AbleCommerce.  Velocity is just a library they use.
> >
> > All I can tell you is that when Velocity is used in an application,
> > the developer puts a number of "references" into the context.  These
> > references, which look like $something, are available for use in the
> > template.  Generally, the developer gives a list of those references
> > to the template writer (e.g. you).  Is there such a list in the
> > documentation?
> >
> > I'd guess $shipments is probably something provided by the
> > AbleCommerce application and $shipment is not, but there's no way
> > for me to tell.  If you have specific questions on Velocity syntax I
> > might be able to offer tips, but otherwise I'll have to refer you
> > back to the authors of AbleCommerce.
> >
> > WILL
> >
> > On 1/21/07, Robert Reil <[EMAIL PROTECTED]> wrote:
> > > Well....
> > >
> > > Here is the short story:
> > > -------------
> > > <html>
> > > <body>
> > > <p><strong>Bill To</strong>:<br>
> > >         #set ($billAddress = $user.getBillAddr())
> > >         $billAddress.getFirstName() $billAddress.getLastName() <br>
> > >         $LocaleUtils.formatAddress($token,$billAddress,true) </p>
> > >         <br>
> > > <p><strong>Ship To</strong>:<br>
> > > #*
> > >         #set ($shipment = $user.getShipAddr())
> > >         $shipment.getShipAddr().getFirstName()
> > > $shipment.getShipAddr().getLastName()<br>
> > >
> > > $LocaleUtils.formatAddress($token,$shipment.getShipAddr(),true)
> > >         <p><strong>Shipping Message:</strong>
> > > $shipment.getShipMsg()</p> *#
> > >                                 </li><br> </body> </html>
> > > -------------
> > > And removing these does not.    #* *#
> > > ------------
> > > And this does not
> > >
> > > Maybe I am having trouble finding my way through the JavaDocs.
> > > What is funny is that this DOES work.
> > >
> > > ------------
> > > <html>
> > > <head>
> > > </head>
> > > <body>
> > > #foreach( $shipment in $shipments ) #foreach( $payment in
> > > $payments ) <p><strong>Bill To</strong>:<br>
> > >   #set ($billAddress = $user.getBillAddr())
> > > $billAddress.getFirstName()
> > > $billAddress.getLastName() <br>
> > >   $LocaleUtils.formatAddress($token,$billAddress,true) </p>
> > >
> > > <strong>Ship To</strong>:<br>
> > >   $shipment.getShipAddr().getFirstName()
> > > $shipment.getShipAddr().getLastName()<br>
> > >   $LocaleUtils.formatAddress($token,$shipment.getShipAddr(),true)
> > >   <p><strong>$shipment.getShipMsg()</strong>
> > > #end
> > > #end
> > > </body>
> > > </html>
> > > ------------
> > >
> > > You say good if it works but the whole problem is the #foreach
> > > creates a problem elsewhere. All I want to do is to get the Ship
> > > To info to post
> and
> > > it just wont do anything but return:
> > >
> > > Ship To:
> > > $shipment.getShipAddr().getFirstName()
> > > $shipment.getShipAddr().getLastName()
> > >
> > > $shipment.getShipMsg()
> > >
> > > Note: It was my attempt in the first example to assign the variable
> > >         #set ($shipment = $user.getShipAddr())
> > >
> > > If it is the variable itself that is the problem I can not find in
> > > www.motorcyclecarbs.com/remove.me/javadoc/index.html
> > > where to find the right item to assign it.
> > > It makes sence to me that it should be user.getShipAddr but
> > > obviously it's not working.
> > >
> > > Again I don't want to use #foreach to make a loop.
> > > I want to fill in the ship to address just one time.
> > > The #foreach makes it work without the #set variable of $shipment.
> > > Why I don't know. Doesn't make sence.
> > >
> > > I do not see also how #foreach ($shipment in $shipments()) would
> > > work as there is no reference to "shipments" in the code anywhere.
> > > Im stuck and confused.....
> > >
> > > Robert
> > >
> > > -----Original Message-----
> > > From: Will Glass-Husain [mailto:[EMAIL PROTECTED]
> > > Sent: Sunday, January 21, 2007 1:38 PM
> > > To: Carbs Sales&Service
> > > Subject: Re: HELP!!!! Able Commerce Email Problem in Velocity
> Programming
> > >
> > > Hi Robert,
> > >
> > > Hard to offer help with such a complex example... perhaps you
> > > could distill the problem into a few lines of code?  That's a good
> > > approach to debugging problems in almost any situation.
> > >
> > > A couple notes:
> > >
> > > (1)
> > > Note that this syntax is unnecessarily complex:
> > >
> > > $shipment.getShipAddr()
> > >
> > > Anytime you have a getter (e.g.   getXXXX()   )  you can change it to
> > > this syntax
> > > $shipment.XXXX
> > >
> > > e.g.
> > > $shipment.ShipAddr.FirstName
> > >
> > > (2) With a multi-step reference like this, when you see the
> > > reference in the final text, it means that some part of it is
> > > invalid.  Check each part $shipment $shipment.ShipAddr
> > > $shipment.ShipAddr.FirstName
> > >
> > >
> > > (3)
> > > I suspect that $shipment itself is invalid.  It's hard to read
> > > your complex example, but it appears to be above the #foreach.  In
> > > other words, this will probably not work
> > >
> > > $shipment.ShipAddr.FirstName
> > > #foreach($shipment in $shipments)
> > >
> > > something
> > > #end
> > >
> > > but this might.  (assuming all the references and property names
> > > are
> > valid)
> > >
> > > #foreach($shipment in $shipments)
> > >
> > >     $shipment.ShipAddr.FirstName
> > >
> > > #end
> > >
> > > WILL
> > >
> > > On 1/20/07, Robert Reil <[EMAIL PROTECTED]> wrote:
> > > > Hello:
> > > >
> > > > I am new to programming and am having trouble with a line of
> > > > code not executing. I have been advised that it is a loop issue.
> > > > But I dont understand the logic behind looping or how to read into
it.
> > > > I have a VERY detailed description well documented and trouble
> > > > shot,
> and
> > > one
> > > > of you programmers could see the problem in about 30 seconds. Me
> > > > I
> have
> > > > spent about 14 hours on it to get to this point in diagnostics.
> > > > At
> this
> > > > point I am stuck...
> > > >
> > > > HELP PLEASE!!!!
> > > >
> > > > http://forums.ablecommerce.com/viewtopic.php?t=4577
> > > > <http://forums.ablecommerce.com/viewtopic.php?t=4577>
> > > >
> > > > Robert P. Reil
> > > >
> > > > Managing Director,
> > > >
> > > > Motorcyclecarbs.com, Inc.
> > > >
> > > > 4292 Country Garden Walk NW
> > > >
> > > > Kennesaw, Ga. 30152
> > > >
> > > > Office 770-974-8851
> > > >
> > > > Fax 770-974-8852
> > > >
> > > > www.motorcyclecarbs.com <http://www.motorcyclecarbs.com/>
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Forio Business Simulations
> > >
> > > Will Glass-Husain
> > > [EMAIL PROTECTED]
> > > www.forio.com
> > >
> > > ------------------------------------------------------------------
> > > --- To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > > ------------------------------------------------------------------
> > > --- To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Forio Business Simulations
> >
> > Will Glass-Husain
> > [EMAIL PROTECTED]
> > www.forio.com
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> [EMAIL PROTECTED]
> www.forio.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Forio Business Simulations

Will Glass-Husain
[EMAIL PROTECTED]
www.forio.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to