@fjbern1943, I'm still not getting it. Is this "application" something that gets invoked by your Zen Cart's admin-console after the customer has placed the order?
@fjbern1943, I'm still not getting it. Is this "application" something that gets invoked by your Zen Cart's admin-console after the customer has placed the order?
Hello,
Every product is associated with a particular vendor. When a customer orders a product the information is not only registered in the database as an order in the regular way but is also associated with that particular vendor. After the order and vendor information is written to the database in the backend the order with packing slip is sent to the vendor again either automatically or by sending it manually in the admin by pushing a button.. This can be set in the vendor setup. Everything is drop shipped by the vendor, I do not normally carry any inventory.
This allows me to automate the ordering process with my vendors. Otherwise, I would have to send them an order by email manually. This was setup with the expectation that there would be a lot of orders to enter daily. I hope this helps to clarify what the application does and how it is used.
Frank
Frank, since the code you posted in post#55 starts by loading application_top.php and ends by loading application_bottom.php, I've got to assume that the script either runs under the admin or is stand-alone running from the root of your store-front.
The only thing that I can think of that might work is for that script to have its own auto-load "prefix" so that the one-page checkout doesn't interfere with that after-order script.
First, copy the file /includes/auto_loaders/config.core.php to a file named mvs.core.php in the same folder. Next, modify that script you posted, adding the following statement just prior to the require for the application_top.php script:
That will result in that script processing like the one-page checkout wasn't in the picture since its observer won't be loaded due to the change in that loader-prefix value.Code:$loaderPrefix = 'mvs';
OK it didn't work. It produces an error:
Here is Line 712 to 719 in order.php:Code:[11-Aug-2016 15:36:31 America/Chicago] PHP Warning: Invalid argument supplied for foreach() in /hsphere/local/home/religiousshop/religious-shop.com/includes/classes/order.php on line 713
Code:712 $shipping_array = $_SESSION['cart']->vendor_shipping; 713 foreach ($shipping_array as $vendors_id => $shipping_data) { 714 $vendors = $db->Execute("select vendors_name from " . TABLE_VENDORS . " where vendors_id = '" . (int)$vendors_id . "'"); 715 $vendors_name = 'Unknown'; 716 if ($vendors) { 717 $vendors_name = $vendors->fields['vendors_name']; 718 } 719 $shipping_method_array = explode ('_', $shipping_data['id']);
What do you think?
Frank
Frank, I was thinking last night that there's a better way ... and there is.
Rather than going down the config.core.php replacement, simply place the following define statement just before your script loads application_top.php:
That definition will "preempt" the database setting and will allow your script to run in "normal" checkout mode regardless the configuration of the One-Page Checkout plugin.Code:define ('CHECKOUT_ONE_ENABLED', 'false');
v1.0.1 is now available for download from the Zen Cart plugins. There are a couple of issues (identified in postings above) that are targeted for a v1.0.2 release, which will most likely happen within the next week.
Hello,
Well it took all my brainpower and a very long investigation to figure this out. The file we were looking at in post #55 had absolutely nothing to do with my MVS/Vendor plugin. It was to be used if you wanted to charge freight, not per order but by vendor. In other words if an order went to two different vendors that file would have been used to charge the customer multiple shipping charges. When I was working with the plugin developer I had them change the way the plugin work so that the customer was only charged for one freight charge. Unfortunately they left that file in the distribution but it didn't do anything. The more I looked at the file the more I realized that it made no sense. I removed it from the server and placed an order using the standard multi form check out and the order was processed and the vendor information was posted and vendor email was sent.. Just as it was suppose to, even though that file was removed.
I placed another order using the on-page checkout and it processed the order but it did not produce any vendor information or vendor email.
I looked at the standard modules/pages/header_php.php pages and compared them to modules/pages/checkout_one/header_php.php file.
I ended up adding this code:
$vendor_shipping = $_SESSION['cart']->vendor_shipping(); to the confirmation_one/header_php.php page code, and then ran another test order and guess what it all worked. Problem solved. Sorry for being so winded but I wanted you to know the full story
I want to thank you for all your assistance and certainly going the extra mile to help out a fellow zenner.
P.S. Don't think abut this tonight put your valuable talents to work on something really worth while. Suggestion, a new COWA plugin to go along with the one-page checkout. :-)