Ik heb op http://www.nopdesign.com/freecart/ een gratis werkende Shop gedownload en geinstalleerd.
Alles perfect in de Engelse uitvoering vanaf het bestellen tot het bekijken van de winkelwagen en het toevoegen of verwijderen van artikelen.

Alleen wanneer ik op "CheckOut" klik en de Nederlandse versie installeer dan wordt ik doorverwezen naar een PhP Script die ervoor zorg draagt dat ik automatisch een ordermail ontvang waarbij plotseling de bestelde artikelen en de tarieven er niet meer in staan.

Nu heb ik nog nooit met PhP gewerkt en vraag me dan ook af wat ik fout doe. Gebruikt toevalligiemand dit script en kan iemand mij vertellen wat ik fout doe??

Alvast dank voor de suggesties c.q. oplossing.
Als dit alleen gebeurt na een ander taal-bestand, dan vermoed ik dat de variabelen niet kloppen.

Vergelijk beide bestanden eens met elkaar.
Zou je eens kunnen kijken mocht je tijd hebben. Ik heb namelijk nooit met PhP gewerkt!
We kunnen best kijken, maar dan moeten we toch wel wat globaler weten waar het fout gaat.
Als je dit zo hebt gedownload, zonder eigen aanpassingen dan zou ik het eerder als bug beschouwen die je aan de makers moet doorgeven.
Ik heb een testshop met 1 artikel gemaakt op http://regio.tv/testshop/index.html
Wanneer op het laatste alles is ingevuld, ontvang ik een mail van de order, echter zie ik daar het aantal, de prijs en de verzendkosten niet op terug.

Wanneer ik echter de normale Engelse taal instel dan werkt alles prima.

Onderstaand het PhP script zoals ik het u gebruik :

<?php

$admin_email = '[email protected]';

$admin_subject = 'Nieuwe bestelling';

$customer_subject = 'Uw boek is besteld';

$success_url = 'shop_success.html';

$error_url = 'shop_error.html';

$csv_file = './orders.csv';



if ($_SERVER['REQUEST_METHOD'] == 'POST')

{

   $billing_first = isset($_POST['billing_first']) ? $_POST['billing_first'] : '';

   $billing_last = isset($_POST['billing_last']) ? $_POST['billing_last'] : '';

   $billing_address = isset($_POST['billing_address']) ? $_POST['billing_address'] : '';

   $billing_address2 = isset($_POST['billing_address2']) ? $_POST['billing_address2'] : '';

   $billing_city = isset($_POST['billing_city']) ? $_POST['billing_city'] : '';

   $billing_state = isset($_POST['billing_state']) ? $_POST['billing_state'] : '';

   $billing_zip = isset($_POST['billing_zip']) ? $_POST['billing_zip'] : '';

   $billing_phone = isset($_POST['billing_phone']) ? $_POST['billing_phone'] : '';

   $billing_fax = isset($_POST['billing_fax']) ? $_POST['billing_fax'] : '';

   $billing_email = isset($_POST['billing_email']) ? $_POST['billing_email'] : '';

   $shipping_first = isset($_POST['shipping_first']) ? $_POST['shipping_first'] : '';

   $shipping_last = isset($_POST['shipping_last']) ? $_POST['shipping_last'] : '';

   $shipping_address = isset($_POST['shipping_address']) ? $_POST['shipping_address'] : '';

   $shipping_address2 = isset($_POST['shipping_address2']) ? $_POST['shipping_address2'] : '';

   $shipping_city = isset($_POST['shipping_city']) ? $_POST['shipping_city'] : '';

   $shipping_state = isset($_POST['shipping_state']) ? $_POST['shipping_state'] : '';

   $shipping_zip = isset($_POST['shipping_zip']) ? $_POST['shipping_zip'] : '';

   $shipping_phone = isset($_POST['shipping_phone']) ? $_POST['shipping_phone'] : '';

   $shipping_fax = isset($_POST['shipping_fax']) ? $_POST['shipping_fax'] : '';

   $SUBTOTAL = isset($_POST['SUBTOTAL']) ? $_POST['SUBTOTAL'] : '';

   $TOTAL = isset($_POST['TOTAL']) ? $_POST['TOTAL'] : '';

   $TAX = isset($_POST['TAX']) ? $_POST['TAX'] : '';

   $SHIPPING = isset($_POST['SHIPPING']) ? $_POST['SHIPPING'] : '';

   $comments = isset($_POST['comments']) ? $_POST['comments'] : '';;

   if (($billing_first == '') || ($billing_last == '') || ($billing_address == '') || ($billing_city == '') || ($billing_state == '') || ($billing_zip == '') || ($billing_phone == '') || ($billing_email == ''))

   {

      // invalid input

      header('Location: '. $error_url);

      exit;

   }

   if (!preg_match('/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i', $billing_email))

   {

      // invalid email address

      header('Location: '. $error_url);

      exit;

   }

   $today = date("l, F jS Y");

   $message = "";

   $message .= "U heeft een nieuwe bestelling ontvangen. Onderstand treft u meer gegevens aan over deze bestelling.\n";

   $message .= "\n";

   $message .= "Besteldatum: $today \n";

   $message .= " \n";

   $message .= "Betaalinformatie: \n";

   $message .= "-------- \n";

   $message .= "   $billing_first $billing_last \n";

   $message .= "   $billing_address \n";

   $message .= "   $billing_address2 \n";

   $message .= "   $billing_city, $billing_state  $billing_zip \n";

   $message .= "   $billing_phone \n";

   $message .= "   $billing_fax \n";

   $message .= "   $billing_email \n";

   $message .= " \n";

   $message .= " \n";

   if ($shipping_first != '')

   {

      $message .= "Verzenden naar: \n";

      $message .= "-------- \n";

      $message .= "   $shipping_first $shipping_last \n";

      $message .= "   $shipping_addr \n";

      $message .= "   $shipping_addr2 \n";

      $message .= "   $shipping_city, $shipping_state  $shipping_zip \n";

      $message .= "   $shipping_phone \n";

      $message .= " \n";

      $message .= " \n";

   }

   $message .= "Aantal  Prijs(\€)   Product ID  - Artikel\n";

   $message .= "===================================================================== \n";

   for ($i = 1; $i< 25; $i++)

   {

      if (isset($_POST['NAME_' . $i]))

      {

         $name = $_POST['NAME_' . $i];

         $quantity = $_POST['QUANTITY_' . $i];

         $price = $_POST['PRICE_' . $i];

         $id = $_POST['ID_' . $i];

         $addtlinfo = $_POST['ADDTLINFO_' . $i];

         $message .= "$quantity    \$$price    $id - $name   $addtlinfo  \n";

      }

   }

   $message .= "===================================================================== \n";

   $message .= "SUBTOTAAL: $SUBTOTAL \n";

   $message .= "TOTAAL: $TOTAL \n";

   $message .= "\n";

   $message .= "VERZENDKOSTEN: $SHIPPING \n";

   $message .= "\n\n";

   $message .= "Extra Informatie: \n";

   $message .= "--------- \n";

   $message .= "$comments \n";

   $message .= " \n";



   // write to log

   foreach ($_POST as $key => $value)

   {

      $logdata .= ',';

      $logdata .= str_replace(",", " ", $value);

   }

   $logdata = str_replace("\r", "", $logdata);

   $logdata = str_replace("\n", " ", $logdata);

   $logdata .= "\r\n";

   $handle = fopen($csv_file, 'a') or die("can't open csv file");

   fwrite($handle, date("Y-m-d H:i:s,"));

   fwrite($handle, $_SERVER['REMOTE_ADDR']);

   fwrite($handle, $logdata);

   fclose($handle);



   // send message to admin

   $header  = "From: $billing_email\r\n";

   $header .= "Reply-To: $billing_email\r\n";

   $header .= "MIME-Version: 1.0\r\n";

   $header .= "X-Mailer: PHP Mail generated by: NOP Shopping Cart\r\n";

   mail($admin_email, $admin_subject, $message, $header);



   // send message to customer

   $header  = "From: $admin_email\r\n";

   $header .= "Reply-To: $admin_email\r\n";

   $header .= "MIME-Version: 1.0\r\n";

   $header .= "X-Mailer: PHP Mail generated by: NOP Shopping Cart\r\n";

   mail($billing_email, $customer_subject, $message, $header);



   header('Location: '.$success_url);

   exit;

   }

?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Winkelwagen</title>

<style type="text/css">

body

{

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #000000;

   text-align: center;

}

div#container

{

   margin-left: auto;

   margin-right: auto;

   width: 50em;

   text-align: left;

}

}

input

{

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #000000;

}

.title

{

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #006600;

}

.blacktext

{

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #000000;

}

.nobr

{

   white-space: nowrap;

}

.nopcart

{

   background: #464444;

   border: 1px;

   font-family: Verdana, Arial, Helvetica, sans-serif; 

   font-size: 12px;

   color: #ffffff;

}

.nopheader

{

   background: #464444;

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #FFFFFF;

}

.nopentry

{

   background: #FFFFFF;

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #000000;

}

.noptotal

{

   background: #FFFFFF;

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #000000;

}

.nopbutton

{

   background: #FFFFFF;

   font-family: Verdana, Arial, Helvetica, sans-serif;

   font-size: 12px;

   color: #000000;

}

</style>

<script type="text/javascript" src="./language-en.js"></script>

<script type="text/javascript" src="./nopcart.js"></script>

<script type="text/javascript">

function CheckForm(theform)

{

   var bMissingFields = false;

   var strFields = "";

   if (theform.billing_first.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: First Name\n";

   }

   if (theform.billing_last.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: Last Name\n";

   }

   if (theform.billing_address.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: Address\n";

   }

   if (theform.billing_city.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: City\n";

   }

   if (theform.billing_state.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: State\n";

   }

   if (theform.billing_zip.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: Zipcode\n";

   }

   if (theform.billing_phone.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: Phone\n";

   }

   if (theform.billing_email.value == '')

   {

      bMissingFields = true;

      strFields += "     Billing: Email\n";

   }

   if (bMissingFields)

   {

      alert("We're sorry, but you must provide the following field(s) before continuing:\n" + strFields);

      return false;

   }

   return true;

}

</script>

</head>

<body>

<div id="container">

<blockquote>

<form method="post" action="<?php echo basename(__FILE__); ?>" onsubmit="return CheckForm(this)">

<span class="nobr">

<script type="text/javascript">

   CheckoutCart();

</script>

</span>

<br>

<p><span class="blacktext"><b>Voer onderstaand uw gegevens in om uw order te kunnen verzenden.</b></span></p>

<p><span class="title"><b>Betaal Informatie:</b></span></p>

<table class="blacktext">

<tr><td>Naam:    </td><td><input type="text" size="18" name="billing_first"> <input type="text" size="15" name="billing_last"></td></tr>

<tr><td>Adres: </td><td><input type="text" size="37" name="billing_address"></td></tr>

<tr><td>Plaats:    </td><td><input type="text" size="21" name="billing_city"></td></tr>

<tr><td>Provincie:   </td><td><input type="text" size="1"  name="billing_state"></td></tr>

<tr><td>Postcode:     </td><td><input type="text" size="5"  name="billing_zip"></td></tr>

<tr><td>Telefoon:   </td><td><input type="text" size="37" name="billing_phone"></td></tr>

<tr><td>Email:   </td><td><input type="text" size="37" name="billing_email"></td></tr>

</table>

<p><input type="submit" value="Bestellen"> <input type="reset" value="Annuleren"></p>

</form>

</blockquote>

</div>

</body>

</html>



Als je het zo gedownload hebt, zonder zelf het script te hebben gewijzigd, dan zou ik eerder een bug-melding doen bij de makers.
Begin bij nopdesign.com:
Nederlandse versie door Ron A.J. Hartendorp van Computer Network Services

evt. '3rd Party Payment Processor Support'
- Authorize.net
- WorldPay
- LinkPoint

Regel 159 zegt dat $_POST[NAME_1] -> $_POST[NAME_25] gezet moet worden om het bedrag, etc, uit te printen.
Dat zie ik niet in dit script gebeuren
Dank voor de reacties maar ik heb het script door een ervaren PhP deskundige laten nakijken en nu werkt alles goed!
Mooi, dat is ook de beste oplossing.
Programmaonderhoud van een programma is niet direct handig voor op een forum, je moet toch bij allerlei dingen kunnen om ze na te lopen en te testen met andere componenten.

Reageren