Janar
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] WooCommerce 3.0.1 Update – Error with Custom Post TypeI got same error “Invalid order.” today when updated WooCommerce to version 3.0.1. But not sure it’s related to any custom post types.
PHP Fatal error: Uncaught exception 'Exception' with message 'Invalid order.' in /var/www/projectx/src/wp-content/plugins/woocommerce/includes/data-stores/abstract-wc-order-data-store-cpt.php:86 Stack trace: #0 /var/www/projectx/src/wp-content/plugins/woocommerce/includes/class-wc-data-store.php(143): Abstract_WC_Order_Data_Store_CPT->read(Object(WC_Order)) #1 /var/www/projectx/src/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php(109): WC_Data_Store->read(Object(WC_Order)) #2 /var/www/projectx/src/wp-content/themes/projectx/ProjectXController.php(72): WC_Abstract_Order->__construct(10183)It seems that if I try to get Wc_Order too early- it creates that error.
$order = new WC_Order( $orderId );I tried to get order in hook “after_setup_theme”. I got it working by moving my code to be executed bit later. In hook “wp_loaded” there was no such error anymore. ( https://codex.wordpress.org/Plugin_API/Action_Reference )
Also I discovered that (ups-woocommerce-shipping) made also this error.
- This reply was modified 8 years, 11 months ago by Janar.
I think I have same problem. Did this happened with WooCommerce latest release (3.0.1) or something older?
For user this resulted notice “Error: PayPal Powered by Braintree did not supply a payment nonce. Please try again later or use another means of payment.”
Seems that this problem is very common.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce – Coupon code to include shipping chargesHi JBHorne,
did you find any good solution for that. Have been googling for some time no, but there seems to be no solution for it.
Same problem occurred today- why is it there? Now I have to find work-around or patch fot it. Either way problematic :/
Yes- only problem was “REGISTER_GLOBALS” php flag. After that this problem went away. Waisted hours on it, debugging, trying. Finally it simply works.
An Idea maybe- add some kind of notice on top of admin screen when globals are on. Maybe it could save someones time in future.
Instead of $this->dispatcher use something like this:
$dispatcher = new MvcDispatcher();and later use it like this
if (!method_exists($dispatcher, $method)) {
$dispatcher->{$method} = create_function(”, ‘MvcDispatcher::dispatch(array(“controller” => “‘.$controller.'”, “action” => “list”));’);
}It seems to work that way.