Plugin Woocommerce 2.1.2
-
I have 2 problems.
1) Some how the backend of woocommerce got broken:
When a go into product:
The display to edit the product information is all messed up in one long page intead of multiple tabs. Also I can`t delete or add gallery photos.
Here is a screenshot: https://oficina.com.py/wp-content/uploads/2014/02/problem.png
2) After check out, there are errors, so it redirects to the cart (and erases the cart) instead of redirecting to the thank you page.
I know where to look for the fix but my knowledge is not enough
I get the information even after the wrong redirect after errors, so I just need to redirect to a page that says thank you, but I cant even do that with this code:
// Redirect to success/confirmation/payment page if ( $result['result'] == 'success' ) { $result = apply_filters( 'woocommerce_payment_successful_result', $result, $order_id ); if ( is_ajax() ) { echo '<!--WC_START-->' . json_encode( $result ) . '<!--WC_END-->'; exit; } else { wp_redirect( $result['redirect'] ); exit; } } } else { if ( empty( $order ) ) $order = new WC_Order( $order_id ); // No payment was required for order $order->payment_complete(); // Empty the Cart WC()->cart->empty_cart(); // Get redirect $return_url = $order->get_checkout_order_received_url(); // Redirect to success/confirmation/payment page if ( is_ajax() ) { echo '<!--WC_START-->' . json_encode( array( 'result' => 'success', 'redirect' => apply_filters( 'woocommerce_checkout_no_payment_needed_redirect', $return_url, $order ) ) ) . '<!--WC_END-->'; exit; } else { wp_safe_redirect( apply_filters( 'woocommerce_checkout_no_payment_needed_redirect', $return_url, $order ) ); exit; } } } catch ( Exception $e ) { if ( ! empty( $e ) ) wc_add_notice( $e->getMessage(), 'error' ); } } // endif // If we reached this point then there were errors if ( is_ajax() ) { ob_start(); wc_print_notices(); $messages = ob_get_clean(); echo '<!--WC_START-->' . json_encode( array( 'result' => 'failure', 'messages' => $messages, 'refresh' => isset( WC()->session->refresh_totals ) ? 'true' : 'false', 'reload' => isset( WC()->session->reload_checkout ) ? 'true' : 'false' ) ) . '<!--WC_END-->'; unset( WC()->session->refresh_totals, WC()->session->reload_checkout ); exit; } }
Someone knows how to redirect this code to a single page when the result has error (failure)?
- The topic ‘Plugin Woocommerce 2.1.2’ is closed to new replies.