close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Populating forms . . .

Thread began 7/08/2009 2:27 am by wetware | Last modified 7/17/2009 11:14 am by wetware | 8398 views | 29 replies |

wetware

Populating forms . . .

How does one "populate" the Shipping info from the Billing info on the CustomerInfo page using a checkbox ie: "Shipping info same as Billing?" Apparently, there's some JavaScript for the checkbox trigger available from WebAssist?
Plus, I'm having "page-to-page" population problems, as well. Have followed the eCommerce Recipes360 binding instructions (CustomerInfo > Checkout) to no avail . . .
Thanks in advance!

Sign in to reply to this post

CraigRBeta Tester

copy shipping

There is a javascript file called copyShipping.js in the WA_eCart folder.

include the link in your head section like this, (or whatever the correct path is in your case)

<script src="/WA_eCart/Scripts/copyShipping.js" type="text/javascript"></script>

In the table for shipping information, you need to call the script

<tr>
<td><input type="checkbox" name="eC_SameAs" id="eC_SameAs" value="1" onClick="eCart_copyBillingToShipping(this);" /></td>
<td><label for="eC_SameAs">Same as billing address</label></td>
</tr>

If the fields in your address/shipping tables are different from the default, it is quite straightforward to edit the javascript file.

Sign in to reply to this post

wetware

Cross-pollinating fields. . .

. . . thanks CraigR - had the script in place, but not the "call".
We'll see how the field-naming goes in a minute.
Anyone have experience as to why the "CustomerInfo" fields don't populate the "Checkout" page? Is it a failure re: the same theory (field-naming)?
Following the eCommerce Recipes (v3) is semi-confusing while dealing with v4.1.5 . . .
Thanks in advance!

Sign in to reply to this post

CraigRBeta Tester

do you mean the billing and shipping information displayed in the confirm page ?

this comes from data posted from the field names in the checkout form

Sign in to reply to this post

wetware

Not getting it . . .

. . . say hey, CraigR - this is a non-database site.
The page sequence here is:
TWF_Product_Fishshapes01.php (one of a few)
TWF_Artisans_ShoppingCart.php
TWF_Artisans_CustomerInfo.php
TWF_Artisans_Checkout.php

Somehow, the Spry validation hasn't prevented empty fields being OK'd (in "CustomerInfo" pg.) & "Checkout" page then being accessed (Spry since disengaged), that same "CustomerInfo" page isn't passing info from Billing to Shipping sections (within said page), nor is it sending any info to the "Checkout" page . . .

"Checkout" page is receiving the Tax amount from the "Shopping Cart" as a "Total" price addition, but the field label & breakdown for Tax isn't delineated or displayed . . .

The Recipes360 sections on binding info, etc. have been followed, but obviously not followed - Yikes!

Sign in to reply to this post

CraigRBeta Tester

first check your path to the copyshipping.js file as when I looked at the source using firebug, the file couldn't be found.

Sign in to reply to this post

wetware

Path structure . . .

WA eCart directory gets placed one tier above the "main" directory by default (in my world).
Here's the coding WebAssist has placed before the HTML doctype etc. on the "CustomerInfo" page:
<?php
//WA eCart Include
require_once("../WA_eCart/eCart1_PHP.php");
?>
<?php
$eCart1->GetContent();
?>
<?php
//WA eCart Check Out Update
if (isset($_POST["eCart1_Checkout_1"]) || isset($_POST["eCart1_Checkout_1_x"])) {
$eCart1->UpdateCart();
$eCart1->cartAction = "CheckOutUpdate";
}
?>
<?php
//WA eCart Redirect Check Out
if (isset($_POST["eCart1_Checkout_1"]) || isset($_POST["eCart1_Checkout_1_x"])) {
$Redirect_redirStr="TWF_Artisans_Checkout.php";
if ($Redirect_redirStr != "") {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
if (strpos($Redirect_redirStr, "?") === false) {
$Redirect_redirStr .= "?".$_SERVER['QUERY_STRING'];
}
else {
$Redirect_redirStr .= "&".$_SERVER['QUERY_STRING'];
}
}

$eCart1->redirStr = $Redirect_redirStr;
}
$eCart1->cartAction = "Checkout";
}
?>
<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);
}
?>

Sign in to reply to this post

wetware

Related issue?

When the following address:
webscr
is placed into this equation
$Redirect_redirStr="https://www.paypal.com/cgi-bin/webscr"; "
in the //WA eCart Redirect Check Out" area on the "Checkout" page, the "Proceed to Checkout" action of the "CustomerInfo" page results in an immediate transfer to this PayPal website. The "Checkout" page is bypassed altogether. That is, it's bypassed as a visible/actionable page to the person involved in the transaction.
So, I've left that "entry" out so as to troubleshoot the field population issue - but, for you wondrous Sherlock Holmsian folks out there, it might be a clue!

Sign in to reply to this post

CraigRBeta Tester

Ok found it this time.

Don't know what was wrong before, but i can see it now.

in your copyShipping.js file, the field names which are used are different from those on your form.

you have to either change the field name on the js file or on the form.

eg try firstname and shipping_firstname for the relevant tables on your checkout page

Sign in to reply to this post

wetware

Isn't it odd . . .

. . . that a WebAssist binding tutorial, a WebAssist .js file, and a WebAssist snippet collection should have differing field names? The function of tutorials would seem to be one of enlightenment through "correct" examples that would be roadmaps for success . . .
But, paying attention is my job ultimately, so . . .
Thanks, CraigR, for sticking with this quest - I'm sure that there are more pitfalls that I will fail to navigate . . .
Thanks for the clue, I'm eager to see where it leads!

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...