Forums Index > Mewsoft Products > Auctionawy > need some help w/variable
conuremom First Post Posted on: 08-07-09 07:29 PM
need some help w/variable

I'm having trouble with a variable created in a custom field. \ I hope this is something simple that I'm just missing because I've been working on it too long.\ \ I enter the info in an input text field on the sell.htm page, and use the entered data on the preview.htm & view.htm pages. That part works fine.\ \ But--I also want to use this variable in the email sent to the winning bidder. I can't seem to get it to appear. Here's how I have it set up in Custom Fields Ad2:\ \ Name=ShippingFee\ Type=Text Box\ Data= Text\ active x\ required x\ searchable x\ \ Listing Form:\ < tr > < td bgcolor="#c2d6c2" VALIGN="top" >< b >< font size="4" >SHIPPING FEE:< /td >< td >< FONT SIZE="4" >< B >< INP*T TYPE="text" N*ME="< !--Name-- >" $ \ VALUE=" " size="10" >< /b >< /font >< /td > < /tr >
\ \ Preview Form:\ < tr >< td VALIGN="top" bgcolor="#afcaaf" NOWRAP >< b >< font size="4" >Shipping Fee: < /td >< td >< b > $\ < !--Value-- >< /b >< /font > < /td >< /tr >
\ \ View Form:\ < tr >< td VALIGN="top" nowrap >< b < font size="2" >Shipping Fee:< b >< font size="4" > $ < !--Value-- >< /b >< /font >< /td >< /tr >

\ \ I have tried inserting both "< !--Name-- >" and "< !--Value-- >" in the e-mail set up in bidding.pm. But the value of the variable doesn't appear in the e-mail when it's sent to the winner.\ \ To complicate matters, if I change the Name= in the listing form to anything but < !--Name-- > any data entered in that field on sell.htm does not appear on preview.htm and view.htm.\ \ What am I doing wrong?

mewsoft Reply #: 1 Posted on: 08-07-09 10:20 PM
Re: need some help w/variable

Actually the names for the custom fields are Ad1 ... to Ad20 or more and Ads1 .. to Ads20 or more ( as you created when creating the sql tables, defaults to 20). so as you see their classes in the Sell page and preview page, use the same classes in the emails like <! --Ad1-- > (No Spaces)etc.

Mewsoft Support
www.mewsoft.com

conuremom Reply #: 2 Posted on: 08-08-09 08:56 AM
variable help

OK, that worked as far as getting the shipping fee to appear in the e-mail. But now I can't seem to get it formatted to match the rest of the e-mail. The e-mail is in a table, and < !--Ad2-- > seems to be inserted pre-formatted to add another table row which I do not want.

In my letter below you see that the shipping fee is on a white line, and left justified. It's supposed to be on the green line above it, right justified to line up with the total. The HTML code that is in my e-mail has it in a < td > in the same row as the green background above it. For some reason when it's inserted, it adds another table row and ignores my formatting. Any idea why?.

It is also inserting the words "Shipping Fee:" with the total. Where exactly does it get the text it uses--from the view form or the preview form? I had wanted the word "Shipping" to appear in the cell above the word "Total" in the letter. I hadn't expected < !--Ad2-- > to bring text along with the fee amount.

(and you can see where this is going, can't you? The next thing I will need to do is figure out how to add < !--current_bid-- > and < !--Ad2-- > together somehow. )

Item #Link to Auction Price

1138717288

TEST THING

$  10.00

 
Shipping Fee: $ 987.65
 Total$

wannauseit Reply #: 3 Posted on: 08-08-09 09:09 AM
need some help w/variable

View Form:\ < tr >< td VALIGN="top" nowrap >< b < font size="2" >Shipping Fee:< b >< font size="4" > $ < !--Value-- >< /b >< /font >< /td >< /tr >

\ \ I think this is because you have written it out to be a table row < tr > in the View Form section of your setup for < !--Ads2-- >.\ \ Try removing < tr > and < /tr > from that section and see what happens.

wannauseit Reply #: 4 Posted on: 08-08-09 09:13 AM
Re: need some help w/variable

Also,\ \ You put the text "Shipping Price" in your < !--Ad2-- > form, that's why it "brought it along".
conuremom Reply #: 5 Posted on: 08-08-09 10:06 AM
variable help

Well that was an "OH DUH!" moment. Thank you for pointing out that I had formatted Ad2 as a table row. I definitely spent too long looking at this thing the past few days, I just wasn't seeing it anymore.

Now--does anybody know how to do math with variables?

wannauseit Reply #: 6 Posted on: 08-08-09 10:30 AM
Re: need some help w/variable

Calculate shipping and current bid together?
conuremom Reply #: 7 Posted on: 08-08-09 10:32 AM
variables

I haven't tried any calculations--where do you do that in the Admin area? I have all the fee calculations on my auction shut off because I'm the only seller.

wannauseit Reply #: 8 Posted on: 08-08-09 10:40 AM
Re: need some help w/variable

No, I'm sorry.\ \ I was asking if that's what you were wanting to accomplish.\ \ That would require custom programming I believe since none of the other users would have their site setup that way.
conuremom Reply #: 9 Posted on: 08-08-09 10:53 AM
Variables

Oh, yes, I do want to add current bid and shipping fee together and show the total at the bottom of the e-mail.\ \ I *think* I might be able to do it in Javascript. Not sure yet. I'm currently looking into that.
wannauseit Reply #: 10 Posted on: 08-08-09 11:00 AM
Re: need some help w/variable

Great!\ \ I hope you can get it to work that way.
conuremom Reply #: 11 Posted on: 08-08-09 11:21 AM
Variables

I'm SURE there's a way to do this. I just need a bit of information first. (I'm teaching myself all of this as I go...)\ \ Custom Fields Manager produces variables formatted as\ < !--variable-- >\ \ What language is that variable formatted for when it comes out of there? HTML? PERL? Something else? \ \ I need to know how to translate the format "< !--variable-- >" into something Javascript can use.
wannauseit Reply #: 12 Posted on: 08-08-09 12:32 PM
Re: need some help w/variable

A variables output is produced in many different forms and depends on the output you have chosen.\ \ Look at it this way.\ \ Say you have chosen < !--Ad2-- > to output the shipping price, but it's in those < td > Shipping Price $300.00 < /td > format.\ \ The TD's make it HTML format.\ \ If the output was only "Shipping Price $300", that would be considered Text.
conuremom Reply #: 13 Posted on: 08-08-09 03:06 PM
variables

I think that I've determined that < !--Ad2-- > is a server side include comment. (Ahmed, am I right?)\ \ I need to find a way to add together the resulting data from current_bid and Ad2.\ \ I cannot seem to find whether the data included in SSI variables can be acted upon once produced. \ \ If someone knows how, please tell me! I'm really close to finishing this project so I can start using the software.