Page 20 of 188 FirstFirst ... 1018192021223070120 ... LastLast
Results 191 to 200 of 1878
  1. #191
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,410
    Plugin Contributions
    94

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lat9 View Post
    Does anyone have a merged version of /YOUR_ADMIN/orders.php that includes the changes for Edit Orders 4.1 and Ty Package Tracker 3.13?
    Never mind on the merge; I finally got that sorted out.

    Running Edit Orders 4.1 w/ Ty Package Tracker on Zen Cart v1.5.1, PHP v5.4.8.

    Whenever I click on the Edit button in the Customers->Orders display, I receive the following debug log:
    Code:
    [06-Jul-2013 14:32:15 Europe/Berlin] PHP Warning:  Illegal string offset 'id' in C:\xampp\htdocs\zc_151\includes\modules\shipping\freeshipper.php on line 32
    
    [06-Jul-2013 14:32:15 Europe/Berlin] PHP Warning:  Illegal string offset 'iso_code_2' in C:\xampp\htdocs\zc_151\includes\modules\shipping\usps.php on line 1248
    
    [06-Jul-2013 14:32:15 Europe/Berlin] PHP Warning:  Illegal string offset 'iso_code_2' in C:\xampp\htdocs\zc_151\includes\modules\shipping\usps.php on line 1262
    
    [06-Jul-2013 14:32:15 Europe/Berlin] PHP Warning:  Illegal string offset 'id' in C:\xampp\htdocs\zc_151\includes\modules\shipping\freeshipper.php on line 32
    
    [06-Jul-2013 14:32:15 Europe/Berlin] PHP Warning:  Illegal string offset 'iso_code_2' in C:\xampp\htdocs\zc_151\includes\modules\shipping\usps.php on line 1248
    
    [06-Jul-2013 14:32:15 Europe/Berlin] PHP Warning:  Illegal string offset 'iso_code_2' in C:\xampp\htdocs\zc_151\includes\modules\shipping\usps.php on line 1262
    The two shipping modules that I've got enabled are (you guessed it), Free Shipping and USPS. The issue is that when the shipping modules are loaded under edit_orders, the global variable $order->delivery['country'] is a string containing the country's name. When the shipping modules are loaded from the store-front, $order->delivery['country'] is an array:
    Code:
    country (array)
        id (string) => 223
        title (string) => United States
        iso_code_2 (string) => US
        iso_code_3 (string) => USA
    I'm not sure if the following is the 'best' way to correct the problem ... but it works! Changes made to \YOUR_ADMIN\includes\functions\extra_functions\edit_orders_functions.php:
    Code:
    function eo_get_available_shipping_modules() {
    	$retval = array();
    	if(defined('MODULE_SHIPPING_INSTALLED') && zen_not_null(MODULE_SHIPPING_INSTALLED)) {
      
    //-bof-a-lat9-illegal-string-offset
        global $order, $db;
        if (!isset($order)) {
          error_log('/includes/functions/extra_functions/edit_orders_functions.php (eo_get_available_shipping_modules()): global $order not set');
          die();
          
        }
        $country_info = $db->Execute('SELECT countries_id as id, countries_name as name, countries_iso_code_2 as iso_code_2, countries_iso_code_3 as iso_code_3 FROM ' . TABLE_COUNTRIES . " WHERE countries_name = '" . $order->delivery['country'] . "'");
        $order->delivery['country'] = $country_info->fields;
        unset($country_info);
    //-eof-a-lat9-illegal-string-offset
    
    		if(!isset($_SESSION['cart'])) {
    			require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'shopping_cart.php');
    			$_SESSION['cart'] = new shoppingCart();
    		}
    
    		// Load the shipping class into the globals
    		require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'shipping.php');
    		$shipping_modules = new shipping();
    
    		for($i=0, $n=count($shipping_modules->modules); $i<$n; $i++) {
    			$class = substr($shipping_modules->modules[$i], 0, strrpos($shipping_modules->modules[$i], '.'));
    			if(isset($GLOBALS[$class])) {
    				$retval[] = array(
    					'id' => $GLOBALS[$class]->code,
    					'text' => $GLOBALS[$class]->title
    				);
    			}
    		}
    		unset($shipping_modules, $class, $i, $n);
        
    //-bof-a-lat9-illegal-string-offset
        $order->delivery['country'] = $order->delivery['country']['name'];
    //-eof-a-lat9-illegal-string-offset
    
    	}
    
    	return $retval;
    }
    Code:
    function eo_get_order_by_id($oID) {
    	global $db, $order;
    
    	// Retrieve the order
    	$order = new order($oID);
    
    	// Add some required customer information for tax calculation
    	// The next method has been modified to add required info to the
    	// session and global variables.
    	zen_get_tax_locations();
    
    	// Cleanup tax_groups in the order (broken code in order.php)
    	// Shipping module will automatically add tax if needed.
    	$order->info['tax_groups'] = array();
    	foreach($order->products as $product) {
    		eo_get_product_taxes($product);
    	}
    
    	// Correctly add the running subtotal (broken code in order.php)
    	if(!array_key_exists('subtotal', $order->info)) {
    		$query = $db->Execute(
    			'SELECT value FROM `' . TABLE_ORDERS_TOTAL . '` ' .
    			'WHERE `orders_id` = \'' . (int)$oID . '\' ' .
    			'AND `class` = \'ot_subtotal\''
    		);
    		if(!$query->EOF) {
    			$order->info['subtotal'] = $query->fields['value'];
    		}
    	}
    
    	// Handle shipping costs (module will automatically handle tax)
    	if(!array_key_exists('shipping_cost', $order->info)) {
    		$query = $db->Execute(
    			'SELECT value FROM `' . TABLE_ORDERS_TOTAL . '` ' .
    			'WHERE `orders_id` = \'' . (int)$oID . '\' ' .
    			'AND `class` = \'ot_shipping\''
    		);
    		if(!$query->EOF) {
    			$order->info['shipping_cost'] = $query->fields['value'];
    
    			$_SESSION['shipping'] = array(
    				'title' => $order->info['shipping_method'],
    				'id' => $order->info['shipping_module_code'] . '_',
    				'cost' => $order->info['shipping_cost']
    			);
    
    			if(!isset($_SESSION['cart'])) {
    				require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'shopping_cart.php');
    				$_SESSION['cart'] = new shoppingCart();
    			}
          
    //-bof-a-lat9-illegal-string-offset
          $country_info = $db->Execute('SELECT countries_id as id, countries_name as name, countries_iso_code_2 as iso_code_2, countries_iso_code_3 as iso_code_3 FROM ' . TABLE_COUNTRIES . " WHERE countries_name = '" . $order->delivery['country'] . "'");
          $order->delivery['country'] = $country_info->fields;
    //-eof-a-lat9-illegal-string-offset
    
    			// Load the shipping class into the globals
    			require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'shipping.php');
    			$shipping_modules = new shipping($_SESSION['shipping']);
    
    //-bof-a-lat9-illegal-string-offset      
          $order->delivery['country'] = $order->delivery['country']['name'];
    //-eof-a-lat9-illegal-string-offset
    		}
    	}
    
    	return $order;
    }

  2. #192
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,410
    Plugin Contributions
    94

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by Gadgit View Post
    Ok - I think I have come up with a solution to this now. I have done as I suggested and added an extra dimension to the front of the id array which is the $orders_products_id value.

    For example - Line 903 in edit_orders.php

    Code:
    echo '<textarea class="attribsTextarea" name="id[' .$optionID[$j] . '][value]" rows="' . $optionInfo['rows'] .
    	'" cols="' . $optionInfo['size'] . '" id="attrib-' .
    	$optionID[$j] . '" >' . $text . '</textarea>' . "\n";
    becomes

    Code:
    echo '<textarea class="attribsTextarea" name="id['.$orders_products_id.'][' .	$optionID[$j] . '][value]" rows="' . $optionInfo['rows'] .
    	'" cols="' . $optionInfo['size'] . '" id="attrib-' .
    	$optionID[$j] . '" >' . $text . '</textarea>' . "\n";
    and then, when this array is read from $_POST on line 276

    Code:
    zen_db_prepare_input($_POST['id']),
    becomes

    Code:
    zen_db_prepare_input($_POST['id'][$orders_products_id]),
    I have had a quick (but not thorough!) test of this, and it seems to work - can anyone see any reasons as to why this might cause problems elsewhere?


    I now seem to have a problem in that the Sub-Total and hence, the Total never update, and they can't be modified manually, so the order totals cannot be changed, only by adding additional total lines (but then these get removed again upon updating the order). Is this expected functionality, have I missed something or is this a bug?

    Cheers,
    Scott
    FWIW, a combination of the changes suggested in the referenced post plus the SQL update provided here (http://www.zen-cart.com/showthread.p...ag-not-working) allowed a client's upgraded site to be able too fully edit the attributes in an order.

  3. #193
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lat9 View Post
    ...
    The two shipping modules that I've got enabled are (you guessed it), Free Shipping and USPS. The issue is that when the shipping modules are loaded under edit_orders, the global variable $order->delivery['country'] is a string containing the country's name. When the shipping modules are loaded from the store-front, $order->delivery['country'] is an array ...
    Quote Originally Posted by lat9 View Post
    FWIW, a combination of the changes suggested in the referenced post plus the SQL update provided here (http://www.zen-cart.com/showthread.p...ag-not-working) allowed a client's upgraded site to be able too fully edit the attributes in an order.
    You may wish to join the BETA testing team (and would be most welcome). A number of bugs have been squashed, new enhancements added, and better interoperability with existing Zen Cart and 3rd party (shipping and order total) modules. Take a peek at the current list of changes (they are listed in the Edit Orders 4.1.1 readme).
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  4. #194
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,410
    Plugin Contributions
    94

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lhungil View Post
    You may wish to join the BETA testing team (and would be most welcome). A number of bugs have been squashed, new enhancements added, and better interoperability with existing Zen Cart and 3rd party (shipping and order total) modules. Take a peek at the current list of changes (they are listed in the Edit Orders 4.1.1 readme).
    Thanks, lhungil, I'll give it a spin!

  5. #195
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    78
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    Zen v1.5.1

    I just did a new installation of edit orders but I'm still having a problem with the sub-total being -0- when I change the quantity. I have made the changes recommended in the previous post but it hasn't fixed my problem.

    I am running only the Tax Exempt plugin in addition to EO.

    Also, my install file did not include anything for SQL, only the uninstall SQL.
    Last edited by Shara; 9 Jul 2013 at 10:41 PM.

  6. #196
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by Shara View Post
    Also, my install file did not include anything for SQL, only the uninstall SQL.
    Because as the readme indicates, the auto installer manages the SQL changes/execution..
    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.

  7. #197
    Join Date
    Jan 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    How about the ability to edit "low order fee" for orders close to the limit?

    Bill

  8. #198
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by Angry Bill View Post
    How about the ability to edit "low order fee" for orders close to the limit?
    Changing the behavior of an order total module in the admin sounds a little too much like bait and switch to me.

    I strongly believe order total modules should act the same for both customers making an order online and when an admin adds / edits an order from the Zen Cart admin. This makes processing orders easier, ensures a seamless customer experience, and ensures anyone editing / adding an order does not "forget" rules imposed by order total modules.

    I do understand a limited number of order total modules currently exist. But if one needs different functionality, one should create a new order total module (or modify the order total module) to fit their needs. New (or modified) order total modules should be posted to (or updated in) the plugin section. This would directly benefit the Zen Cart community in general and not just users of "Edit Orders".

    Note: I see the potential need for an "Onetime Order Discount" order total module. This would provide an easy way to record and audit how many times an order is discounted. Using such an order total module would also ensure invoices, reports, and the customer's order history reflect the customer was given a one time order discount. If anyone else is interested or plans to build such a module... Feel free to send me a PM or email!
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  9. #199
    Join Date
    Jan 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lhungil View Post
    Changing the behavior of an order total module in the admin sounds a little too much like bait and switch to me.
    lol ok. "bait and switch". I appreciate the effort put into this code A LOT and I use it quite a bit real time. I also equally find he responses here equally amusing . I will continue to use my Microsoft access back door to REALLY edit the orders as I need to edit them.

  10. #200
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: Edit Orders v4.0 Support Thread

    Quote Originally Posted by lhungil View Post
    Changing the behavior of an order total module in the admin sounds a little too much like bait and switch to me.

    I strongly believe order total modules should act the same for both customers making an order online and when an admin adds / edits an order from the Zen Cart admin. This makes processing orders easier, ensures a seamless customer experience, and ensures anyone editing / adding an order does not "forget" rules imposed by order total modules.

    I do understand a limited number of order total modules currently exist. But if one needs different functionality, one should create a new order total module (or modify the order total module) to fit their needs. New (or modified) order total modules should be posted to (or updated in) the plugin section. This would directly benefit the Zen Cart community in general and not just users of "Edit Orders".

    Note: I see the potential need for an "Onetime Order Discount" order total module. This would provide an easy way to record and audit how many times an order is discounted. Using such an order total module would also ensure invoices, reports, and the customer's order history reflect the customer was given a one time order discount. If anyone else is interested or plans to build such a module... Feel free to send me a PM or email!
    I agree with the "bait and switch" characterization.. If an order total module has rules associated with it it would see more prudent to adjust the rules than the order total on the back end.. If the rules of say the "low order total" module aren't calculating as the shopowner thinks they should this is the RIGHT solution.. Anything else feels a tad.. ummm... dare I say "shady"...
    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.

 

 

Similar Threads

  1. v150 Super Orders v4.0 Support Thread for ZC v1.5.x
    By DivaVocals in forum Addon Admin Tools
    Replies: 804
    Last Post: 18 Apr 2025, 12:04 AM
  2. v150 Orders Status History -- Updated By [Support Thread]
    By lat9 in forum Addon Admin Tools
    Replies: 34
    Last Post: 29 Jul 2019, 07:05 PM
  3. Edit Orders v3.0 for ZC 1.3.9 [Support Thread]
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 656
    Last Post: 18 Apr 2016, 06:28 PM
  4. v139h Super Orders v3.0 Support Thread (for ZC v1.3.9)
    By DivaVocals in forum All Other Contributions/Addons
    Replies: 1018
    Last Post: 28 Apr 2014, 11:38 PM
  5. RE: Super Orders v3.0 Support Thread
    By Johnnyd in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 22 Jun 2011, 09:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR