Zen Cart Logo
Forums / All Other Contributions/Addons / Admin Simple Create Order [Support Thread]

Admin Simple Create Order [Support Thread]

Views: 26,786

Results 41 to 60 of 122
27 Nov 2010, 8:16 AM
#41
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Admin Simple Create Order [Support Thread]

Thanks for your insight DrByte.. You confirmed what I thought was going to be required to execute this, and with that I am tapping out of doing anything more with this add-on than I've already done..:laugh::laugh:

I've got Create Orders working with Edit Orders 2.xx, and frankly if I am "creating" an order from the admin, I can live with manually entering in the state for those orders/customers which require it..

The name of this add-on is Admin SIMPLE Create Orders.. This title amply describes what I have working on my test store.. a SIMPLE order creation method. So I'll let someone else have a go with building out the rest of this nightmarish add-on with all those other bells and whistles (shipping rates, order confirmation e-mails, etc..) :laugh: I'll steer clear of that and minimize the amount of grey hair I have on my head thank you very much..:laugh:

After I finish up the Super Orders release me and my fellow Zenners have been working diligently on, and a boatload of other REAL work I've got on my plate, I'll probably bundle up my working version of this add-on and submit it to the downloads..

It won't have the bells and whistles in it (shipping rates, order confirmation e-mails, etc..), but IMHO what is currently available right now is only half functioning anyway. AND there are adequate "workarounds" for those bells and whistles.. (shipping rates can be looked up and the existing comments features will work JUST FINE for customer order notification)

IMHO, until someone comes along ('cause I'm done!:laugh:) and wants to build this add-on out with all the PROPERLY WORKING bells and whistles, an add-on which at least serves the basic intent of this add-on is better than one that contains features which are buggy and/or do not work well..

To the community: Please do not PM me about sending over my working version of Create Orders.. I have other projects on my plate, and it will be a minute before I have enough free time to properly bundle this up and submit it..

In the meantime there are PLENTY of good tips in THIS support thread which will help others to get Create Orders to the state I have it in my test store.. All I really did to get it to work was to follow those tips. There is a required correction I discovered for one of the tips posted. I will follow-up this post with a correction to that tip..

DrByte:

As far as the customer address book entries go, it's either/or, not both.
And the same details are carried over to the orders table when an order is created during checkout.

entry_state is only ever to be filled in if there is no zone defined for their state in their country

**entry_zone_id **is set if the customer's country+state matches a zone combination in the zones table. In such cases, entry_state is left blank, because the entry_zone_id points to the zone name which has the correct spelling etc of that state/zone name.

Obviously, to present a list of available states/zones for a given country, you need to provide a pulldown menu such as is seen on the create-account page ... which also has some javascript to auto-update the list of available zones whenever the country pulldown selection is changed. And then, when a selection is made, the corresponding entry_zone_id is set based on the selection made.

27 Nov 2010, 8:23 AM
#42
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

The following change needs to be made this previously posted tip.. I've highlighted in red the changes I made when implementing this in my test store..

DivaVocals:

I implemented this by creating a extra functions folder for Create Orders (versus updating the one for Edit Orders).

I created admin/includes/functions/extra_functions/create_order_functions.php with the the following code:

<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2007 Numinix Technology | // | | // | http://www.zen-cart.com/index.php | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ /* * @version $Id: edit_orders.php, v 1.0.0 12/11/2007 12:08:59 numinix $ * */ //////////////////////////////////////////////////////////////////////////////////////////////// // Function : zen_get_currency_value // Arguments : currency_code currency code string // Return : currency_value // Description : Function to retrieve the currency_value based on the currency's code /////////////////////////////////////////////////////////////////////////////////////////////// function zen_get_currency_value($currency_code) { global $db; $currency_query = $db -> Execute("select * from " . TABLE_CURRENCIES . " where code = '" . $currency_code . "'"); return $currency_query->fields['value']; } ?>
27 Nov 2010, 8:43 AM
#43
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

bluedotted:

Only issue I am really having is that the when adding a product it takes me back to the home page. I have tried all the suggestions and none seemed to work. :(

Any ideas maybe on that issue?The only way that happens is if you are running Zen Cart v1.39 and have not updated Edit Orders to the newest version.. (this was discussed earlier in this support thread -- See pages 3-4)

27 Nov 2010, 8:56 AM
#44
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

Now I KNOW it's time to go to bed.. I just re-read what you posted, and realized that (duh!) I overlooked a KEY part of what you said (I highlighted what I am chirping on about..)

If I am understanding you correctly, while Create Orders and Add Customer's from Admin do work, to capture state information correctly, they probably needs some re-working to reflect the correct usage of entry_state and entry_zone_id.. Do I understand this correctly?? Are there consequences for using these mods if these changes don't make their way into the codebase??

DrByte:

As far as the customer address book entries go, it's either/or, not both.
And the same details are carried over to the orders table when an order is created during checkout.

entry_state is only ever to be filled in if there is no zone defined for their state in their country

**entry_zone_id ** is set if the customer's country+state matches a zone combination in the zones table. In such cases, entry_state is left blank, because the entry_zone_id points to the zone name which has the correct spelling etc of that state/zone name.

Obviously, to present a list of available states/zones for a given country, you need to provide a pulldown menu such as is seen on the create-account page ... which also has some javascript to auto-update the list of available zones whenever the country pulldown selection is changed. And then, when a selection is made, the corresponding entry_zone_id is set based on the selection made.

27 Nov 2010, 8:59 AM
#45
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

One more thing, the blank page issue has been discussed in this thread.. I re-posted a correction to the suggested fix tonight:
http://www.zen-cart.com/forum/showpost.php?p=965240&postcount=42

Dunno if this will fix your specific issue, but this is a required mod to get Create Orders to work correctly..

kalastaja:

Hmmmmm. Done all the colorful things. And so I try to create an order and :frusty: a blank page appears....... Could I perhaps get the Diva-versions of this?

DivaVocals:

I don't have a version of this to share with the community.. All I did in all that chatter I posted is about what would happen if I upgraded Edit Orders from v1.53 to v2.03/2.04. I had attempted to add in the shipping table and the "Send Confirmation E-mail" code that Ivan originally included (was going to share THAT until it failed to work the way I felt it should).. When that code didn't work well, I just left that code out and used Edit Orders 2.03/2.04 unedited..

Did you download Edit orders from the link previously posted??? Does Edit Orders work standalone?? (ie: can you edit an existing order using Edit Orders?)

27 Nov 2010, 9:42 AM
#46
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

DivaVocals:

One more thing, the blank page issue has been discussed in this thread.. I re-posted a correction to the suggested fix tonight:
http://www.zen-cart.com/forum/showpost.php?p=965240&postcount=42

Dunno if this will fix your specific issue, but this is a required mod to get Create Orders to work correctly..

This now causes a 500 internal error using this file you created with the code suggested also the page 3 and 4 fix you posted did not fix the issue, tried it on 4 or 5 different test installs fresh right out of the box still takes me to the admin page when trying to add a product.

Thought I would note that as well.

27 Nov 2010, 10:09 AM
#47
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

bluedotted:

This now causes a 500 internal error using this file you created with the code suggested also the page 3 and 4 fix you posted did not fix the issue, tried it on 4 or 5 different test installs fresh right out of the box still takes me to the admin page when trying to add a product.

Thought I would note that as well.What version of Edit Orders are you running???

What version of Zen Cart are you running??

Did you download this mod from Ivan's site or here in the downloads section??

If you renamed your admin folder, did you make sure that all the files in the "admin" folders of these three add-ons are in YOUR store's admin folder???

You say you've tried "everything" but I don't know what you mean by "everything". So it will be helpful if you can provide some additional information..

I didn't do anything fancy to get it to work.. These are the steps I took to get it to work on a Zen Cart 1.3.9h install:

  1. Downloaded and installed the version of this mod from Ivan's blog (I ONLY installed the Create Orders files, I replaced the Add Customer from Admin and Edit Orders files with ones from the latest versions of those two add-ons)
  2. Downloaded and installed Edit Orders v2.04 (link to this version is posted in this thread)
  3. Downloaded and installed Add Customer from Admin v1.07
  4. Created admin/includes/functions/extra_functions/create_order_functions.php as per my previous post
  5. Made the modifications to orders.php as per the instructions in Edit Orders v2.04 (the instructions Ivan provided do not appear to work correctly)

That's it.. Once I got it all installed it worked PERFECTLY!

27 Nov 2010, 10:39 AM
#48
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

Downloaded both from here http://www.ivankristianto.com/

Using 1.3.9h - All versions tested on

Edit Orders 2.0.4
simple create orders 1.00

Yes folder is renamed in live website but tests sites are not. I assure you they have been placed in their correct locations.

Do not remember saying tried everything just tried everything the readme.txt has in it but failed, also tried the modified files that came with the mod.

Maybe I am missing something but I have used winmerge and all software I can think of and they all seem to be exact but the Add Product Function fails.

27 Nov 2010, 4:59 PM
#49
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

It was late and I left out a few of the steps I took. (all minor changes)

I eliminated 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
    These 3 class files support the admin e-mail and the shipping tables features, but as I previously documented, these features did not work particularly well, and so I deprecated them all.

Made the following change as per step 3 of the readme file:

  1. Make the following changes to admin/includes/functions/general.php:

    Find:

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;

}

> 
>    replace with:
> ```
   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;
  }

DivaVocals:

I didn't do anything fancy to get it to work.. These are the steps I took to get it to work on a Zen Cart 1.3.9h install:

  1. Downloaded and installed the version of this mod from Ivan's blog (the version on Ivan's blog is 1.01. I ONLY installed the Create Orders files, I replaced the Add Customer from Admin and Edit Orders files with ones from the latest versions of those two add-ons)
  1. Downloaded and installed Edit Orders v2.04 (link to this version is posted in this thread)
  1. Downloaded and installed Add Customer from Admin v1.07
  1. Created admin/includes/functions/extra_functions/create_order_functions.php as per my previous post
  1. Made the modifications to orders.php as per the instructions in Edit Orders v2.04 (the instructions Ivan provided do not appear to work correctly)

That's it.. Once I got it all installed it worked PERFECTLY!

The version here in the downloads section is v1.00, the version on Ivan's blog is v1.01. Are you sure you have the right version??

You say you used Winmerge, but what files did you modify using Winmerge?? (I only made two changes to core files in my install)

In my install there are only TWO core files I modified. admin/orders.php as per the instructions in Edit Orders for adding the proper "Edit" buttons and admin/includes/functions/general.php as per the instructions in the Create Orders readme.

I made NO EDITS AT ALL to the Edit Order or Add Customer from Admin add-on files. In Ivans package, there are edits made to Edit Orders that are meant to support the shipping rate tables and the order e-mails..

Though I had in my earlier attempts to get this working with Edit Orders v2.03/2.04 tried to add this code in to the latest version of Edit Orders, I eventually opted to incorporated NONE of this code because of the issues I previously documented with these features not working well. (order e-mails are formatted incorrectly, and do not send correctly/consistently, the shipping rate tables do not display the correct rates for all shipping modules). This is also the reason I did NOT include any of the admin class files from Ivan's install package.

bluedotted:

Downloaded both from here http://www.ivankristianto.com/

Using 1.3.9h - All versions tested on

Edit Orders 2.0.4
simple create orders 1.00

Yes folder is renamed in live website but tests sites are not. I assure you they have been placed in their correct locations.

Do not remember saying tried everything just tried everything the readme.txt has in it but failed, also tried the modified files that came with the mod.

Maybe I am missing something but I have used winmerge and all software I can think of and they all seem to be exact but the Add Product Function fails.

27 Nov 2010, 5:02 PM
#50
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

kalastaja:

BTW. If you have multiple tax classes (which is ok by ZenCart) this nice "little" exercise goes haywire.... I do have a (working) suggestion, if someone is interested.
It's a community forum, and all ideas suggestions are always welcome.. No need to wait for permission.. Just post your suggestion..:smile:

27 Nov 2010, 6:22 PM
#51
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

One last thing.. In admin/edit_orders.php find:

**<!-- Begin Order Total Block -->**Post the code that is between
<!-- Begin Order Total Block -->

and

<!-- End Order Total Block -->

bluedotted:

Downloaded both from here http://www.ivankristianto.com/

Using 1.3.9h - All versions tested on

Edit Orders 2.0.4
simple create orders 1.00

Yes folder is renamed in live website but tests sites are not. I assure you they have been placed in their correct locations.

Do not remember saying tried everything just tried everything the readme.txt has in it but failed, also tried the modified files that came with the mod.

Maybe I am missing something but I have used winmerge and all software I can think of and they all seem to be exact but the Add Product Function fails.

27 Nov 2010, 11:36 PM
#52
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

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/

28 Nov 2010, 12:04 AM
#53
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

DivaVocals:

One last thing.. In admin/edit_orders.php find:
Post the code that is between

and

I think this is what you are asking for?

	<!-- 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 -->
28 Nov 2010, 1:12 AM
#54
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

Just double checking that you had the right Create Orders files

bluedotted:

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

bluedotted:

I think this is what you are asking for?

<!-- 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 -->
28 Nov 2010, 1:32 AM
#55
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

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:
   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;
  }

replace with:

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;
  }

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..:smile:)

28 Nov 2010, 1:46 AM
#56
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

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

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.

So is this file or DB based it same exact files that is on the test site as well.

28 Nov 2010, 2:10 AM
#57
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Admin Simple Create Order [Support Thread]

Dunno..:no: 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..

bluedotted:

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

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.

28 Nov 2010, 2:39 AM
#58
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

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

28 Nov 2010, 3:47 AM
#59
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

Seems commenting this out around line 72 did the trick, finally :blink:

Edit code below

'currency_value' => zen_get_currency_value(DEFAULT_CURRENCY),

to

//'currency_value' => zen_get_currency_value(DEFAULT_CURRENCY),
28 Nov 2010, 3:56 AM
#60
bluedotted avatar

bluedotted

New Zenner

Join Date:
Oct 2008
Posts:
64
Plugin Contributions:
0

Re: Admin Simple Create Order [Support Thread]

Now to fix the Default free shipper that automatically entered and this should be good to go.