close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

GranTotal

Thread began 10/09/2009 4:59 pm by info323054 | Last modified 2/22/2011 12:58 pm by Jason Byrnes | 2617 views | 9 replies |

info323054

GranTotal

I need to pass the value of the GranTotal cart in confirm.php issued by the wizard to the bank in entire form, I mean, without any euro or dollar sign, just entire without dots or commas, for instance, 200 and I have to multiply it by * 100 for the bank system to recognize it. How can I do that? Please help me. Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

To get the grand total with no formatting:
<?php echo $CartName->GrandTotal(); ?>




multiplied by 100:
<?php echo($CartName->GrandTotal() * 100); ?>

Sign in to reply to this post

info323054

GranTotal

Hi Jason,

Thank you so much for your reply. Now, if I had to get the Grand Total on a variable and then write a hidden form element, what would the code be? Thank you again for your support.

Sign in to reply to this post

Jason ByrnesWebAssist

I'm not sure what you mean by grand total on a variable, can you please explain in more detail.

To add the grand total to a hidden form element:

php:
<input type="hidden" name="<Name for the form element>" value="<?php echo $CartName->GrandTotal(); ?>" />
Sign in to reply to this post

info323054

I have to collect the value of the Grand Total of the cart and pass it to the bank site with no formatting and multiplied by 100.
The bankers said that I have to collect the value on a session variable, for example like this:

<?php
if (!session_id()) session_start();
$_SESSION["Amount"] = "".($ShoeCart->GrandTotal() * 100) ."";
?>

and then send the value on a hidden form element like this:

<input name="Amount" type="hidden" id="Amount" value="<?php echo $_SESSION['Amount']; ?>" />

I don't know if I am writting the code properly and if I am doing it well.

Please help me.

Thank you so much.

Sign in to reply to this post

Jason ByrnesWebAssist

The code you pasted looks correct. I would only make a couple of small adjustments to account for a) the grand total being 0 and b) the session variable not being set:


php:
<?php

if (!session_id()) session_start();
if(
$ShoeCart->GrandTotal() > 0) {
  
$_SESSION["Amount"] = "".($ShoeCart->GrandTotal() * 100) ."";
}
?>





php:
<input name="Amount" type="hidden" id="Amount" value="<?php echo(isset($_SESSION['Amount'])?$_SESSION['Amount']:""); ?>" />
Sign in to reply to this post

info323054

Now it works. Thank you so much.

Sign in to reply to this post

jspoerer286380

Adding Ecart GrandTotal to a hidden form element...

To add the grand total to a hidden form element:

php:
<input type="hidden" name="<Name for the form element>" value="<?php echo $CartName->GrandTotal(); ?>" />




Hi Jason, how you would do the same in ASP VBscript ??

I have,
<input type="hidden" name="<Name for the form element>" value="%=$CartName.GrandTotal()%>" />
but doesn´t work...

Best Regards,
Jorge Spoerer

Sign in to reply to this post

jspoerer286380

same as before...

Sorry but it gives me the following error message:

-------------------------
Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'grandTotal'
-------------------------------------

Please help..

Thank You,
Jorge Spoerer

Sign in to reply to this post

Jason ByrnesWebAssist

you can get the correct code for returning the grand total from the Dreamweaver bindings panel


Go to the bindings panel, exapand the eCart object and select the grand total binding and add it to the page, this will give you the correct syntax to use.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...