My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
Just for the record I downloaded from this page 3 times to ensure I have the right files
ivankristianto.com/web-development/ecommerce/simple-create-order-module-zen-cart/69/
I think this is what you are asking for?
Code:<!-- Begin Order Total Block --> <tr> <td align="right" colspan="6"> <table border="0" cellspacing="0" cellpadding="2" width="100%"> <tr> <td align='center' valign='top'><br><a href="<?php echo $PHP_SELF . "?oID=$oID&action=add_product&step=1"; ?>"><u><b><font size='3'><?php echo TEXT_DATE_ORDER_ADDNEW; ?> </font></b></u></a></td> <td align='right'> <table border="0" cellspacing="0" cellpadding="2"> <?php // Override order.php Class's Field Limitations $totals_query = $db -> Execute("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' order by sort_order"); $order->totals = array(); #while ($totals = zen_db_fetch_array($totals_query)) { while (!$totals_query -> EOF){ $order->totals[] = array('title' => $totals_query->fields['title'], 'text' => $totals_query->fields['text'], 'class' => $totals_query->fields['class'], 'value' => $totals_query->fields['value'], 'orders_total_id' => $totals_query->fields['orders_total_id']); $totals_query -> MoveNext(); } $TotalsArray = array(); for ($i=0; $i<sizeof($order->totals); $i++) { $TotalsArray[] = array("Name" => $order->totals[$i]['title'], "Price" => number_format($order->totals[$i]['value'], 2, '.', ''), "Class" => $order->totals[$i]['class'], "TotalID" => $order->totals[$i]['orders_total_id']); $TotalsArray[] = array("Name" => " ", "Price" => "", "Class" => "ot_custom", "TotalID" => "0"); } array_pop($TotalsArray); foreach($TotalsArray as $TotalIndex => $TotalDetails) { $TotalStyle = "smallText"; if(($TotalDetails["Class"] == "ot_subtotal") || ($TotalDetails["Class"] == "ot_total") ) { echo ' <tr>' . "\n" . ' <td class="main" align="right"><b>' . $TotalDetails["Name"] . '</b></td>' . ' <td class="main"><b>' . $TotalDetails["Price"] . "<input name='update_totals[$TotalIndex][title]' type='hidden' value='" . trim($TotalDetails["Name"]) . "' size='" . strlen($TotalDetails["Name"]) . "' >" . "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" . "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" . "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' . ' </tr>' . "\n"; } elseif($TotalDetails["Class"] == "ot_tax") { echo ' <tr>' . "\n" . ' <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][title]' size='" . strlen(trim($TotalDetails["Name"])) . "' value='" . trim($TotalDetails["Name"]) . "'>" . '</td>' . "\n" . ' <td class="main"><b>' . $TotalDetails["Price"] . "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"] . "' size='6' >" . "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" . "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' . ' </tr>' . "\n"; } elseif($TotalDetails["Class"] == "ot_group_pricing") { echo ' <tr>' . "\n" . ' <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][title]' size='" . strlen(trim($TotalDetails["Name"])) . "' value='" . trim($TotalDetails["Name"]) . "'>" . '</td>' . "\n" . ' <td class="main"><b>' . $TotalDetails["Price"]*-1 . "<input name='update_totals[$TotalIndex][value]' type='hidden' value='" . $TotalDetails["Price"]*-1 . "' size='6' >" . "<input name='update_totals[$TotalIndex][class]' type='hidden' value='" . $TotalDetails["Class"] . "'>\n" . "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</b></td>' . ' </tr>' . "\n"; } else { echo ' <tr>' . "\n" . ' <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][title]' size='" . strlen(trim($TotalDetails["Name"])) . "' value='" . trim($TotalDetails["Name"]) . "'>" . '</td>' . "\n" . ' <td align="right" class="' . $TotalStyle . '">' . "<input name='update_totals[$TotalIndex][value]' size='6' value='" . $TotalDetails["Price"] . "'>" . "<input type='hidden' name='update_totals[$TotalIndex][class]' value='" . $TotalDetails["Class"] . "'>" . "<input type='hidden' name='update_totals[$TotalIndex][total_id]' value='" . $TotalDetails["TotalID"] . "'>" . '</td>' . "\n" . ' </tr>' . "\n"; } } echo ' <tr>' . "\n" . ' <td align="right" >Resend Invoice to Customers (Note: Please update order before resend invoice)</td>' . "\n" . ' <td align="right">' . '<a href="' . zen_href_link("edit_orders.php", zen_get_all_get_params(array('resend')) . 'resend=1') . '">' . zen_image_button('button_send_mail.gif', IMAGE_SEND_EMAIL) . '</a>' . '</td>' . "\n" . ' </tr>' . "\n"; ?> </table> </td> </tr> </table> </td> </tr> <!-- End Order Total Block -->
Just double checking that you had the right Create Orders files
I can tell by looking at this code sample that you DO NOT have Edit Orders v2.04 installed. The link to get this version of Edit Orders is posted on page 4 of this thread.
Download v2.04 of Edit Orders and REPLACE the Edit Orders files you are using.. NO Winmerging.. Simply UPGRADE Edit Orders. The blank page issue you are describing when adding product is corrected in v2.04 of Edit Orders. You also MUST create that function file I posted the code for earlier.. Do this and you should find that this will work..
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
I hope this will help folks with troubleshooting..
Issue - When adding products you are redirected to the admin home page
Solution - UPDATE Edit Orders to v2.04 (the link to get this version is on page 4 of this support thread) This issue was SPECIFICALLY FIXED in this version.
Issue - I get a blank page after clicking on the "Create Order" button
Solution - There is a missing function file in the Create Order fileset. You need to create a function file for Create Orders as per the instructions on page 5 of this support thread.
Other tips:
- Replace the Add Customers from Admin with the latest version available in the Zen Cart downloads section (currently this is v1.07)
- Download the latest version of Create Orders from Ivan's blog: ivankristianto.com/web-development/ecommerce/simple-create-order-module-zen-cart/69/
- Update admin/orders.php as per the instructions in the Edit Orders readme for adding the proper "Edit" buttons. (the instructions in Ivan's readme has met with mixed results..)
- DELETE the following files from Ivan's install package: * admin/includes/classes/order.php
* admin/includes/classes/shipping_admin.php
* admin/includes/classes/shipping_cart_admin.php
(the purpose of these files is to support the shipping rates and order confirmation e-mails -- this code doesn't work particularly well and IMHO isn't entirely necessary to get the overall general benefit of Create Orders)- Make the following changes to admin/includes/functions/general.php as per the instructions in the Create Orders readme:
Find:
replace with:Code:function zen_get_countries($default = '') { global $db; $countries_array = array(); if ($default) { $countries_array[] = array('id' => '', 'text' => $default); } $countries = $db->Execute("select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name"); while (!$countries->EOF) { $countries_array[] = array('id' => $countries->fields['countries_id'], 'text' => $countries->fields['countries_name']); $countries->MoveNext(); } return $countries_array; }
When I have time I will bundle up my install files and submit to the downloads.. (don't PM and ask me to send them out now.. I don't have ANYTHING ready to send ANYONE..Code:function zen_get_countries($countries_id = '', $with_iso_codes = false) { global $db; $countries_array = array(); if (zen_not_null($countries_id)) { if ($with_iso_codes == true) { $countries = "select countries_name, countries_iso_code_2, countries_iso_code_3 from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "' order by countries_name"; $countries_values = $db->Execute($countries); $countries_array = array('countries_name' => $countries_values->fields['countries_name'], 'countries_iso_code_2' => $countries_values->fields['countries_iso_code_2'], 'countries_iso_code_3' => $countries_values->fields['countries_iso_code_3']); } else { $countries = "select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . (int)$countries_id . "'"; $countries_values = $db->Execute($countries); $countries_array = array('countries_name' => $countries_values->fields['countries_name']); } } else { $countries = "select countries_id, countries_name from " . TABLE_COUNTRIES . " order by countries_name"; $countries_values = $db->Execute($countries); while (!$countries_values->EOF) { /*$countries_array[] = array('countries_id' => $countries_values->fields['countries_id'], 'countries_name' => $countries_values->fields['countries_name']);*/ $countries_array[] = array('id' => $countries_values->fields['countries_id'], 'text' => $countries_values->fields['countries_name']); $countries_values->MoveNext(); } } return $countries_array; })
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
This just gets more weird by the minute
Okay got it to work on the test site and transferred the same exact files over to the live site.
Click on Create Order and goes to a 500 Internal Error page when I refresh this page I get
So is this file or DB based it same exact files that is on the test site as well.Code:1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 in: [SELECT c.`customers_firstname` , c.`customers_lastname` , c.`customers_email_address` , c.`customers_telephone`, ab.`entry_company` , ab.`entry_street_address` , ab.`entry_suburb` , ab.`entry_postcode` , ab.`entry_city` , ab.`entry_state` , ab.`entry_country_id` , ab.`entry_zone_id` FROM zen_customers c JOIN zen_address_book ab ON ( c.`customers_default_address_id` = ab.`address_book_id` ) WHERE c.`customers_id` = ] If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Dunno..Based on the error I would say that this is a DB error if it is indeed working on your test site.. However I'd look first at what is different between your test store and your live store.. If there are other variances, any one of them could be causing the errors you are getting..
My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.
According to the debugger this shows in it
[27-Nov-2010 20:50:23] PHP Fatal error: Call to undefined function zen_get_currency_value() in /home/xxxxxxx/public_html/xxxxxx/create_order.php on line 84
Seems commenting this out around line 72 did the trick, finally
Edit code below
toCode:'currency_value' => zen_get_currency_value(DEFAULT_CURRENCY),
Code://'currency_value' => zen_get_currency_value(DEFAULT_CURRENCY),
Now to fix the Default free shipper that automatically entered and this should be good to go.