close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

cash on collect

Thread began 11/04/2009 10:37 pm by parigiro318823 | Last modified 11/12/2009 10:33 am by Jason Byrnes | 3929 views | 13 replies |

parigiro318823

cash on collect

Some customer here in Italy prefer to pay cash at delivery of goods they don't like use credita card or paypal
how can implement this extra feature ( in addition to paypal?)
roberto

Sign in to reply to this post

Jason ByrnesWebAssist

On the checkout form, add a Cosh On Delivery Check box and set the checked value to 1:
<input type="checkbox" name="cashoncollect" id="cashoncollect" value="1"/>

On the confirm page, create a hidden form element with the same name, and set the value to be captured from the one on the checkout page:
<input type="hidden" name="cashoncollect" id="cashoncollect" value="<?php echo((isset($_POST["cashoncollect"]))?$_POST["cashoncollect"]:"") ?>"/>

Around the paypal local checkout code, add the following if statement:

php:
<?php if(isset($_POST["cashoncollect"]) && $_POST["cashoncollect"] == "1") { ?>
<local checkout code>
<?php 
  
} else { 
       $<
eCart Object Name>->redirStr "checkout_success.php";
  }
?>




where <eCart Object Name> is the name of the eCart object.

Sign in to reply to this post

parigiro318823

paymente on collect

it is possible to store order , cart details and customer data in thedatabase without going to paypal or other external site ? ?
i mean when customer press checkout he is asked to enter his personal data
after that shopping cart and personal data are shown with the option to confirm or delete po or change po

when he press confirm , order , carts detail, and customer details are saved in the proper table and mail of PO confirnation is sent to customer

it is possible to do that ?

thanks

Sign in to reply to this post

Jason ByrnesWebAssist

If you want the option, then use the if statement around the local checkout code.


If not, delete the local checkout server behavior.

Sign in to reply to this post

parigiro318823

cash on delivery

sorry but i don't understand i used checkout wizard exactly the same as per you getting started guide but i don't understand were i need to put the code you show to me above
roberto

Sign in to reply to this post

parigiro318823

cash on collect

sorry can i have an answer ?
it is useless to get just generic answer not quoting a step by step procedures
for example another problem
when i try to enter payment by card i get this message we are sorry.....

i think that having bought many extension a little bit of support should be supplied
thks

Sign in to reply to this post

Jason ByrnesWebAssist

On the confirm page, there will be a local checkout server behavior listed in the server behaviors list.

Select the server behavior, then go to code view, the local checkout server behavior code will be highlighted, place the If statement around the highlighted code.

Sign in to reply to this post

parigiro318823

CAsh on collect

i got this message

"Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\www\WACART1\confirm.php:142) in C:\Inetpub\www\WACART1\confirm.php on line 269
"

Sign in to reply to this post

Jason ByrnesWebAssist

This error happens when there is some sort of output on the page before the header function is used to redirect to another page.

This part of the error:
output started at C:\Inetpub\www\WACART1\confirm.php:142

is saying the output is at line 141 or 142.

It may be a blank space after a closing php tag:
"?> "

or a blank line after a closing php tag before the next opening tag:
?>

<?php...

See the following for more details:
148/

Sign in to reply to this post

parigiro318823

cash on collect

no this is not clear at all


thats the code can do necessary modification ????
thks


?>

<?php if(isset($_POST["cashoncollect"]) && $_POST["cashoncollect"] == "1") { ?>



<?php
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$PP_DirectPayment_required = array();
$PP_DirectPayment_required[0] = array();
$PP_DirectPayment_required[1] = array();
$PP_DirectPayment_itemized = array();
$PP_DirectPayment_itemized[0] = array();
$PP_DirectPayment_itemized[1] = array();
$PP_DirectPayment_optional = array();
$PP_DirectPayment_optional[0] = array();
$PP_DirectPayment_optional[1] = array();
$cartIndex = 0;
$nextIndex = 0;
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "Username";
$PP_DirectPayment_required[1][$nextIndex] = "########";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "Password";
$PP_DirectPayment_required[1][$nextIndex] = "########";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "Signature";
$PP_DirectPayment_required[1][$nextIndex] = "##############################";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "PaymentAction";
$PP_DirectPayment_required[1][$nextIndex] = "Sale";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "Currency";
$PP_DirectPayment_required[1][$nextIndex] = "USD";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "IPAddress";
$PP_DirectPayment_required[1][$nextIndex] = "".$_SERVER["REMOTE_ADDR"] ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "CreditCardType";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["cc_type"]))?$_POST["cc_type"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "CreditCardNumber";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["cc_number"]))?$_POST["cc_number"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "ExpMonth";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["exp_month"]))?$_POST["exp_month"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "ExpYear";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["exp_year"]))?$_POST["exp_year"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "FirstName";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["firstname"]))?$_POST["firstname"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "LastName";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["lastname"]))?$_POST["lastname"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "Street1";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["street1"]))?$_POST["street1"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "CityName";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["city"]))?$_POST["city"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "StateOrProvince";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["state_province"]))?$_POST["state_province"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "PostalCode";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["postcode"]))?$_POST["postcode"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "Country";
$PP_DirectPayment_required[1][$nextIndex] = "".((isset($_POST["country"]))?$_POST["country"]:"") ."";
$nextIndex = count($PP_DirectPayment_required[0]);
$PP_DirectPayment_required[0][$nextIndex] = "UseSandbox";
$PP_DirectPayment_required[1][$nextIndex] = "true";

$PP_DirectPayment_itemized[0][0] = "OrderTotal";
$PP_DirectPayment_itemized[1][0] = "".$eCart1->GrandTotal() ."";
$PP_DirectPayment_itemized[0][1] = "OrderDescription";
$PP_DirectPayment_itemized[1][1] = "";
while ( !$eCart1->EOF() ) {
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Amount" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("Price") ."";
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Name" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("Name") ."";
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Number" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("ID") ."";
$nextIndex = count($PP_DirectPayment_itemized[0]);
$PP_DirectPayment_itemized[0][$nextIndex] = "Quantity" . strval($cartIndex+1) . "";
$PP_DirectPayment_itemized[1][$nextIndex] = "".$eCart1->DisplayInfo("Quantity") ."";

$eCart1->MoveNext();
$cartIndex ++;
}
$eCart1->MoveFirst();
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "MerchantSessionID";
$PP_DirectPayment_optional[1][$nextIndex] = "".session_id() ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "Payer";
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["email"]))?$_POST["email"]:"") ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "Street2";
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["street2"]))?$_POST["street2"]:"") ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "Phone";
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["phone"]))?$_POST["phone"]:"") ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "CVV2";
$PP_DirectPayment_optional[1][$nextIndex] = "".((isset($_POST["cvv"]))?$_POST["cvv"]:"") ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "ItemTotal";
$PP_DirectPayment_optional[1][$nextIndex] = "".$eCart1->TotalColumn("TotalPrice") ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "ShippingTotal";
$PP_DirectPayment_optional[1][$nextIndex] = "".$eCart1->GetShipping() ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "HandlingTotal";
$PP_DirectPayment_optional[1][$nextIndex] = "".$eCart1->GetCharges() - $eCart1->GetDiscounts() ."";
$nextIndex = count($PP_DirectPayment_optional[0]);
$PP_DirectPayment_optional[0][$nextIndex] = "TaxTotal";
$PP_DirectPayment_optional[1][$nextIndex] = "".$eCart1->GetTax() ."";

$WAGatewayResponse = PP_DirectPayment_Post($PP_DirectPayment_required,$PP_DirectPayment_itemized,$PP_DirectPayment_optional);
if ($WAGatewayResponse) {
$eCart1->redirStr = "checkout_success.php";
}
else if ("checkout_failure.php" != "") {
header("Location: ". "checkout_failure.php");
exit();
}
}
?>

<?php
} else {
$eCart1->redirStr = "checkout_success.php";
}
?>

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