Title: Plugin Woocommerce 2.1.2
Last modified: August 21, 2016

---

# Plugin Woocommerce 2.1.2

 *  [NameRequired](https://wordpress.org/support/users/agustin8_4/)
 * (@agustin8_4)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/)
 * 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: [http://oficina.com.py/wp-content/uploads/2014/02/problem.png](http://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)?

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4620867)
 * You need to get your GATEWAY updated for 2.1 support, don’t hack WC core files!
 *  Thread Starter [NameRequired](https://wordpress.org/support/users/agustin8_4/)
 * (@agustin8_4)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4620873)
 * That´s actually 2.1 Gateway, I just don`t know what is causing the error, so 
   Im trying to patch it until next update.
 * Also, I don`t know what is causing the product informations tabs to display like
   that, is not a plugin nor a theme conflict. I´m thinking that my tables got messed
   up.
 *  [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4620880)
 * What gateway is it? 2.1 or not, its probably not compatible 🙂
 *  Thread Starter [NameRequired](https://wordpress.org/support/users/agustin8_4/)
 * (@agustin8_4)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4620881)
 * Thats part of class-wc-checkout.php woocommerce 2.1.1
 * is not compatible, but do you know how to make the redirect?
 *  [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4620912)
 * I want to know what PAYMENT GATEWAY you are using. Thats what I think is not 
   compatible.
 *  Thread Starter [NameRequired](https://wordpress.org/support/users/agustin8_4/)
 * (@agustin8_4)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4620915)
 * Im using Custom Payment plugin to add more options, but I still think that a 
   readirect would be the easiest solution right now, the problem will take a long
   time to find
 *  [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4620923)
 * Well then you need to edit Custom Payment plugin and replace all instances of“
   get_permalink” with the correct endpoints. And report this to the author or “
   Custom Payment plugin”.
 * the pay page endpoint can be retrieved with:
 *     ```
       $order->get_checkout_payment_url( true );
       ```
   
 * The thanks page endpoint should be retrieved with:
 *     ```
       $this->get_return_url( $order )
       ```
   
 * These changes were announced months ago.
 *  [S R](https://wordpress.org/support/users/the-goshorn-9/)
 * (@the-goshorn-9)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4621158)
 * I’m having a similar problem.
    See my site here: [http://heartspectrum.com/shop](http://heartspectrum.com/shop)
 * My primary source of payment is Paypal. But there isn’t even a Checkout button
   on the Cart page! So how can a person checkout?

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Plugin Woocommerce 2.1.2’ is closed to new replies.

## Tags

 * [woocommerce 2.1](https://wordpress.org/support/topic-tag/woocommerce-2-1/)

 * 8 replies
 * 3 participants
 * Last reply from: [S R](https://wordpress.org/support/users/the-goshorn-9/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/plugin-woocommerce-212/#post-4621158)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
