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]

Reply via email to