Hi I wonder if someone could help me... I have added an additional field on my checkout page using this
http://www.zen-cart.com/showthread.p...ld-to-Checkout. I have the field showing on the form but when I go to submit the order it comes up with the processing, then goes to WARNING: An Error occurred, please refresh the page and try again. Now I have altered the tpl_checkout_stacked.php and put the original file back on to see if it is this causing the problem and its still the same. I have also altered includes/classes/order.php and put the original back which fixed the problem. can anyone see from the below code what could be causing the issue. Obviously I know that the line numbers are slightly out.
Next, alter the order.php class file, found in includes/classes/order.php
There are a fair number of bits to add, but bare with me:
Line 43, add order_frequent_code, to the sql statement.
Line 114, before 'ip_address' insert the following line:
'frequent_code' => $order->fields['order_frequent_code'],
Line 343, before 'ip_address' insert the following line:
'frequent_code' => $_SESSION['frequent_code'],
Line 587, before 'ip_address', insert the following line:
'order_frequent_code' => $this->info['frequent_code'],
Ok, nearly there. So far, we've added the field to the template, added the column to the database, and editted the order class to record the value. We now need to get the input and pass it to the order class.
the only other file I have edited is includes/modules/pages/checkout_shipping/header_php.php
After line 116 add:
if (isset($_SESSION['frequent_code'])) {
$frequent_code = $_SESSION['frequent_code'];
}
After line 124, which starts $comments = $_SESS........ add
if (zen_not_null($_POST['frequent_code'])) {
$_SESSION['frequent_code'] = zen_db_prepare_input($_POST['frequent_code']);
}
$frequent_code = $_SESSION['frequent_code'];
Would really appreciate some help as I think this is more a FEC issue. I am a complete noob to this type of coding!
Many thanks
Bookmarks