WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] How can i get my IPN works in woocommerce payment (56 posts)

  1. haleeben
    Member
    Posted 1 year ago #

    Thank you queenielow and Nadun

    Emails notifications are now working for me, hope the guys at Woo read this thread.

  2. DizzyDi
    Member
    Posted 1 year ago #

    Hi guys,

    I too am having a problem.

    I have tried combinations of everything to try and get this to work but I am not having any luck.

    When I set up WC, I changed the Invoice Prefix to FF (instead of the default WC).

    So I tried this:

    global $woocommerce;

    $order = new FF_Order( $order_id );

    $order->payment_complete()

    Note: I changed the CC to FF

    This stsill didn't work.

    I have turned on Auto Redirect in Paypal.

    I have tried this with both Redirect and Forced and I still don't get a complete sale. It stays on pending.

    I also have the "grant access to download after payment" so that it should not rely on being complete.

    I also did as suggested and copied the templates folder into a woocommerce folder in my wordpress child theme. I have made changes to these documents only.

    I am new to WordPress and Woocommerce and am feeling a tad intimidated.

    Does anyone have a suggestion of what I have overlooked.

    Cheers Diamond

  3. queenielow
    Member
    Posted 1 year ago #

    Hi Diamond,

    WC_ is one of woocommerce function in their function files.
    Im not sure why you want to change to FF_ . If u change that , be sure in function files u have to change it too.

    But i would advice u to stick to woocommerce default.
    Have you check on your IPN log files in woocommerce? You can easily see it at plugin---> editor
    Then choose woocommerce then IPN log file.

  4. winexviv
    Member
    Posted 1 year ago #

    Good day!
    I'm a web developer based in Nigeria. I built woocommerce payent plugin based on Cashenvoy and Eyowo but the big issue is changing order status from pending to completed or processing on successful transaction. This has been a challenging issue and i hope someone get assist me in solving this. Thanks

  5. anderson br
    Member
    Posted 1 year ago #

    I looked at my file but do not understand where should I put this part: $ order-> payment_complete ()

    Help me, please.

  6. queenielow
    Member
    Posted 1 year ago #

    Hi anderson,

    Put it in your thankyou template that woocommerce generated.
    Try this:-
    <?php else : ?>
    <?php $order->payment_complete(); ?>
    <p><?php _e('Thank you. Your order has been received.', 'woocommerce'); ?></p>

    Hi winexviv, what was the issue u faced?

  7. winexviv
    Member
    Posted 1 year ago #

    The issue i'm facing is updating my order status from pending to completed or processing on successful payment. I'm suspecting that my gateway is not getting response. Here is my entire source code, please help me review

    [Excessive code outside of backticks moderated. Please post code or markup snippets between backticks or use the code button. Or better still - use a pastebin.]

  8. anderson br
    Member
    Posted 1 year ago #

    Quenielow, I dont find "thank you template".

  9. anderson br
    Member
    Posted 1 year ago #

    just

    [woocommerce_thankyou]

  10. winexviv
    Member
    Posted 1 year ago #

    The issue i'm facing is updating my order status from pending to completed or processing on successful payment. I'm suspecting that my gateway is not getting response. Here is my entire source code, please help me review

    <?php
    session_start();
    /**
     * Plugin Name: Woocommerce cashenvoy WebPay Module
     * Description: A payment gateway plugin for Woocommerce for the cashenvoy WebPay system
     * Author:      Alex Onyia
     * Email:       winexviv@gmail.com
     * Author URI:  http://www.winexviv.com
     * Version:     1.4
     */
    
    function alex_webpay_init() {
    	if (!class_exists('WC_Payment_Gateway')) {
    		return;
    	}
    
    	class WC_WebPay extends WC_Payment_Gateway {	
    
    		public function __construct() {
    			global $woocommerce;
    
    			$this->id		= 'cashenvoy';
    			//$this->icon 		= apply_filters('woocommerce_cashenvoy_icon', 'http://www.cashenvoyng.com/images/logo.gif');
    			$this->has_fields 	= false;
    			$this->liveurl 		= 'https://www.cashenvoy.com/webservice/?cmd=cepay';
    			$this->testurl 		= 'https://www.cashenvoy.com/sandbox/?cmd=cepay';
    			$this->method_title     = __( 'cashenvoy - WebPay', 'woocommerce' );
    
    			// Load the form fields.
    			$this->init_form_fields();
    
    			// Load the settings.
    			$this->init_settings();
    
    			// Define user set variables
    			$this->title 		= $this->settings['title'];
    			$this->description 	= $this->settings['description'];
    			$this->product_id	= $this->settings['product_id'];
    			$this->pay_item_id	= $this->settings['pay_item_id'];
    			$this->testmode		= $this->settings['testmode'];
    			$this->debug		= $this->settings['debug'];
    			$this->debug_email	= $this->settings['debug_email'];
    			$this->thanks_message	= $this->settings['thanks_message'];
    			$this->error_message	= $this->settings['error_message'];
    			$this->feedback_message	= '';
    			$this->response_codes	= $this->get_response_codes();
    
    			// Actions
    			add_action( 'init', array(&$this, 'check_ipn_response') );
    			add_action('valid-cashenvoy-ipn-request', array(&$this, 'successful_request') );
    			add_action('woocommerce_receipt_cashenvoy', array(&$this, 'receipt_page'));
    			add_action('woocommerce_update_options_payment_gateways', array(&$this, 'process_admin_options'));
    			add_action('woocommerce_get_transaction_status', array(&$this, 'get_transaction_status'));
    
    			add_action('woocommerce_thankyou_' . $this->id, array(&$this, 'thankyou_page'));
    
    			//Filters
    			add_filter('woocommerce_currencies', array($this, 'add_ngn_currency'));
    			add_filter('woocommerce_currency_symbol', array($this, 'add_ngn_currency_symbol'), 10, 2);
    
    			// Logs
    			if ($this->debug=='yes') $this->log = $woocommerce->logger();
    
    			if ( !$this->is_valid_for_use() ) $this->enabled = false;
    
    		}
    
    		function add_ngn_currency($currencies) {
    		     $currencies['NGN'] = __( 'Nigerian Naira (NGN)', 'woocommerce' );
    		     return $currencies;
    		}
    
    		function add_ngn_currency_symbol($currency_symbol, $currency) {
    			switch( $currency ) {
    				case 'NGN':
    					$currency_symbol = '?';
    					break;
    			}
    
    			return $currency_symbol;
    		}    
    
    		function is_valid_for_use() {
    			$return = true;
    
    			if (!in_array(get_option('woocommerce_currency'), array('NGN'))) {
    			    $return = false;
    			}
    
    			return $return;
    		}
    
    		function admin_options() {
    
    			echo '<h3>' . __('cashenvoy WebPay', 'woocommerce') . '</h3>';
    			echo '<p>' . __('cashenvoy WebPay works by sending the user to cashenvoy to enter their payment information.', 'woocommerce') . '</p>';
    			echo '<table class="form-table">';
    
    			if ( $this->is_valid_for_use() ) {
    				$this->generate_settings_html();
    			} else {
    				echo '<div class="inline error"><p><strong>' . __( 'Gateway Disabled', 'woocommerce' ) . '</strong>: ' . __( 'cashenvoy does not support your store currency.', 'woocommerce' ) . '</p></div>';
    			}
    
    			echo '</table>';
    
    		}
    
    	       function init_form_fields() {
    			$this->form_fields = array(
    				'enabled' => array(
    								'title' => __( 'Enable/Disable', 'woocommerce' ),
    								'type' => 'checkbox',
    								'label' => __( 'Enable cashenvoy WebPay', 'woocommerce' ),
    								'default' => 'yes'
    							),
    				'title' => array(
    								'title' => __( 'Title', 'woocommerce' ),
    								'type' => 'text',
    								'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),
    								'default' => __( 'cashenvoy WebPay', 'woocommerce' )
    							),
    				'description' => array(
    								'title' => __( 'Description', 'woocommerce' ),
    								'type' => 'textarea',
    								'description' => __( 'This controls the description which the user sees during checkout.', 'woocommerce' ),
    								'default' => __("Pay via cashenvoy WebPay;", 'woocommerce')
    							),
    				'thanks_message' => array(
    								'title' => __( 'Thanks message', 'woocommerce' ),
    								'type' => 'textarea',
    								'description' => __( 'The message to show on a successful payment', 'woocommerce' ),
    								'default' => __("Thank you. Your order has been received", 'woocommerce')
    							),
    				'error_message' => array(
    								'title' => __( 'Failure message', 'woocommerce' ),
    								'type' => 'textarea',
    								'description' => __( 'The message to show when a payment has failed', 'woocommerce' ),
    								'default' => __("Sorry. There was a problem with your order", 'woocommerce')
    							),
    				'product_id' => array(
    								'title' => __( 'Product ID', 'woocommerce' ),
    								'type' => 'text',
    								'description' => __( 'Product Identifier for PAYDirect. Provided to you by cashenvoy', 'woocommerce' ),
    								'default' => ''
    							),
    				'pay_item_id' => array(
    								'title' => __( 'Pay Item ID', 'woocommerce' ),
    								'type' => 'text',
    								'description' => __( 'PAYDirect Payment Item ID', 'woocommerce' ),
    								'default' => ''
    							),
    				'testmode' => array(
    								'title' => __( 'cashenvoy Test Mode', 'woocommerce' ),
    								'type' => 'checkbox',
    								'label' => __( 'Enable cashenvoy Test Mode', 'woocommerce' ),
    								'default' => 'yes'
    							),
    				'debug' => array(
    								'title' => __( 'Debug', 'woocommerce' ),
    								'type' => 'checkbox',
    								'label' => __( 'Enable logging (<code>woocommerce/logs/cashenvoy.txt</code>)', 'woocommerce' ),
    								'default' => 'no'
    							),
    				'debug_email' => array(
    								'title' => __( 'IPN Debug Email', 'woocommerce' ),
    								'type' => 'text',
    								'label' => __( 'Email address to send IPN info to. Used for debugging. Blank for no email', 'woocommerce' ),
    								'default' => ''
    							)
    			);
    
    		}
    
    		function payment_fields() {
    		    if ($this->description) {
    			echo wpautop(wptexturize($this->description));
    		    }
    		}
    
    		function get_cashenvoy_args( $order ) {
    			global $woocommerce;
    
    			$cetxref ="Nj".time().mt_rand(0,9999);
    			$order_id = $order->id . '_' . $this->product_id .'_'. $cetxref;
    			$redirect_url = $this->get_return_url($order);
    			$order_total = round(((number_format($order->get_order_total() + $order->get_order_discount(), 2, '.', ''))*100),0);
    			$cememo = 'New product(s) from Myneria Naturals';
    
    			if ($this->debug=='yes') {
    				$this->log->add( 'cashenvoy', 'Generating payment form for order #' . $order_id . '.');
    			}
    
    			$cashenvoy_args = array(
    				'ce_merchantid' 	    => '629',
    				'ce_transref'           => $cetxref,
    				'ce_amount' 			=> $order_total,
    				'site_name' 			=> site_url(),
    				'ce_memo'			    => $cememo,
    				'ce_notifyurl'		    => $redirect_url,
    				'ce_customerid'			=> trim($order->billing_first_name . ' ' . $order->billing_last_name),
    			);
    
    			if (isset($order->user_id)) {
    				$cashenvoy_args['cust_id'] = $order->user_id;
    			}
    
    			$cashenvoy_args = apply_filters('woocommerce_cashenvoy_args', $cashenvoy_args);
    
    			return $cashenvoy_args;
    		}
    
    		function generate_cashenvoy_form( $order_id ) {
    			global $woocommerce;
    
    			$order = new WC_Order( $order_id );
    			$cashenvoy_args = $this->get_cashenvoy_args( $order );
    			$cashenvoy_args_array = array();
    
    			$cashenvoy_adr = $this->liveurl;
    			if ( $this->testmode == 'yes' ) {
    				$cashenvoy_adr = $this->testurl;
    			}
    
    			foreach ($cashenvoy_args as $key => $value) {
    				$cashenvoy_args_array[] = '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '" />';
    			}
    
    			$woocommerce->add_inline_js('
    				jQuery("body").block({
    					message: "<img src=\"'.esc_url( $woocommerce->plugin_url() ).'/assets/images/ajax-loader.gif\" alt=\"Redirecting...\" style=\"float:left; margin-right: 10px;\" />'.__('Thank you for your order. We are now redirecting you to cashenvoy to make payment.', 'woocommerce').'",
    					overlayCSS: {
    						background: "#fff",
    						opacity: 0.6
    					},
    					css: {
    						padding:        20,
    						textAlign:      "center",
    						color:          "#555",
    						border:         "3px solid #aaa",
    						backgroundColor:"#fff",
    						cursor:         "wait",
    						lineHeight:	"32px"
    					}
    				});
    				jQuery("#submit_cashenvoy_payment_form").click();
    			');
    
    			$form = '<form action="'.esc_url( $cashenvoy_adr ).'" method="post" id="cashenvoy_payment_form">
    					' . implode('', $cashenvoy_args_array) . '
    					<input type="submit" class="button-alt" id="submit_cashenvoy_payment_form" value="'.__('Pay via cashenvoy', 'woocommerce').'" /> <a class="button cancel" href="'.esc_url( $order->get_cancel_order_url() ).'">'.__('Cancel order & restore cart', 'woocommerce').'</a>
    				</form>';
    
    			return $form;
    		}
    
    		function generate_cashenvoy_try_again_form( $order_id ) {
    			global $woocommerce;
    
    			$order = new WC_Order( $order_id );
    			$cashenvoy_args = $this->get_cashenvoy_args( $order );
    			$cashenvoy_args_array = array();
    
    			$cashenvoy_adr = $this->liveurl;
    			if ( $this->testmode == 'yes' ) {
    				$cashenvoy_adr = $this->testurl;
    			}
    
    			foreach ($cashenvoy_args as $key => $value) {
    				$cashenvoy_args_array[] = '<input type="hidden" name="' . esc_attr($key) . '" value="' . esc_attr($value) . '" />';
    			}
    
    			$form = '<form action="'.esc_url( $cashenvoy_adr ).'" method="post" id="cashenvoy_payment_form">
    					' . implode('', $cashenvoy_args_array) . '
    					<input type="submit" class="button-alt" id="submit_cashenvoy_payment_form" value="'.__('Try Again', 'woocommerce').'" />
    				</form>';
    
    			return $form;
    		}
    
    		function successful_request( $posted ) {
    			global $woocommerce;
    
    			$order_ref = $posted['ce_transref'];
    			$order = new WC_Order( (int) $order_ref );
    
    			//fool the thanks page into working?
    			$_GET['key'] = $order->order_key;
    			$_GET['order'] - $order->id;
    
    			if ($this->get_transaction_status($order_ref)) {
    				// Check order not already completed
    				if ($order->status == 'completed') :
    					 if ($this->debug=='yes') {
    						$this->log->add( 'cashenvoy', 'Aborting, Order #' . $order_ref . ' is already complete.' );
    					 }
    					 return false;
    				endif;
    
    				// Payment completed
    				$order->add_order_note( __('IPN payment completed', 'woocommerce') );
    				$order->payment_complete();
    				$woocommerce->cart->empty_cart();
    
    				if ($this->debug=='yes') $this->log->add( 'cashenvoy', 'Payment complete.' );
    
    				foreach ($_GET as $k=>$v) {
    					update_post_meta((int)$order_ref, $k, $v);
    				}
    
    				update_post_meta( (int) $order_ref, 'Payment Method', 'cashenvoy');
    
    				$this->feedback_message = $this->thanks_message;
    			} else {
    				$error_code = '';
    				if (@$_GET['resp']) {
    					$error_code = $this->response_codes[$_GET['resp']];
    				}
    
    				$try_again = $this->generate_cashenvoy_try_again_form($this->parse_txn_ref_order_id($order_ref));
    
    				$order->add_order_note(__('Payment Failed - ' . $error_code, 'woocommerce'));
    				$order->update_status('failed');
    
    				$woocommerce->add_error('Transaction Failed: ' . $error_code . ' ' . $try_again); // Transaction Failed Notice on Checkout
    
    				$this->feedback_message = $this->failed_message . $error_code . ' ' . $try_again;
    
    				if ($this->debug=='yes') $this->log->add( 'cashenvoy', 'Payment error: ' . $error_code . ' raw data: ' . serialize($_GET));
    			}
    		}
    
    		function thankyou_page() {
    			echo wpautop($this->feedback_message);
    		}
    
    		public function get_response_codes() {
    			return array(
    				'C00'=>'CashEnvoy transaction successful. <br>Reference: $order_id'
    				,'C04'=>'CashEnvoy transaction denied. <br>Reason: Insufficient funds. <br>Reference: $order_id'
    				,'C05'=>'CashEnvoy transaction failed. <br>Reason: ".@$a."Error occurred. Contact support@cashenvoy.com <br>Reference: $order_id'
    				,'C03'=>'CashEnvoy transaction failed. <br>Reason: No transaction record. <br>Reference: $order_id'
    
    			);
    		}	
    
    		function cashenvoy_thanks() {
    			echo $this->response_codes(urldecode($_GET['desc']));
    
    			if ($GET['desc'] != 'C00') {
    				//$this->generate_cashenvoy_form($_POST['ce_transref']);
    			}
    		}
    
    		function parse_txn_ref_order_id($txnref) {
    			$txnref = htmlentities($txnref);
    			$txn_details = explode('_', $txnref);
    			$product_id = $txn_details[1];
    			$order_id = $txn_details[0];
    
    			return $order_id;
    		}	
    
    		function process_payment( $order_id ) {
    			$order = new WC_Order( $order_id );
    
    			return array(
    				'result' => 'success',
    				'redirect' => add_query_arg('order', $order->id, add_query_arg('key', $order->order_key, get_permalink(woocommerce_get_page_id('pay'))))
    			);
    		}
    
    		function receipt_page( $order ) {
    			echo '<p>'.__('Thank you for your order, please click the button below to pay with cashenvoy.', 'woocommerce').'</p>';
    
    			echo $this->generate_cashenvoy_form( $order );
    		}
    
    		function check_ipn_response() {
    			if (isset($_POST['retRef'])) {
    				@ob_clean();
    
    				$_POST = stripslashes_deep($_POST);
    
    				header('HTTP/1.1 200 OK');
    				do_action("valid-cashenvoy-ipn-request", $_POST);
    			}
    		}
    
    		function get_transaction_status($transref,$mertid,$type='') {
    			global $woocommerce;
    
    			$cetxref ="Nj".time().mt_rand(0,9999);
    			$_SESSION['cetxref']=$cetxref;
    			$transref = $_SESSION['cetxref'];
    			$mertid = 629;
                $type = '';
    
    			$endpoint = "https://www.cashenvoy.com/webservice/?cmd=requery";
    			if ($this->testmode) {
    				$endpoint = "https://www.cashenvoy.com/sandbox/?cmd=requery";
    			}
    
    			$request = 'mertid='.$mertid.'&transref='.$transref.'&respformat='.$type;
    
    			echo $request;
    
    			$ch = curl_init(); //initialize curl handle
    	curl_setopt($ch, CURLOPT_URL, $endpoint); //set the url
    	curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); //return as a variable
    	curl_setopt($ch, CURLOPT_POST, 1); //set POST method
    	curl_setopt($ch, CURLOPT_POSTFIELDS, $request); //set the POST variables
    	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    	$response = curl_exec($ch); // grab URL and pass it to the browser. Run the whole process and return the response
    	curl_close($ch); //close the curl handle
    	return $response;
    
    		}	
    
     	}
    
    	/**
    	 * Add the gateway to WooCommerce
    	 **/
    	function add_webpay_gateway( $methods ) {
    		$methods[] = 'WC_WebPay'; return $methods;
    	}
    
    	add_filter('woocommerce_payment_gateways', 'add_webpay_gateway' );
    }
    
    add_filter('plugins_loaded', 'alex_webpay_init' );
    
    ?>
  11. queenielow
    Member
    Posted 1 year ago #

    hi anderson,

    yes thats the file. sorry i couldnt remember the filename while i replying to u with my iphone

  12. queenielow
    Member
    Posted 1 year ago #

    hi winexviv,

    you r not using paypal r u?
    could you see any log error when u make payment or when your payment being process?

  13. winexviv
    Member
    Posted 1 year ago #

    Hello Queenielow,
    I'm not using paypal. I'm using a payment gateway based in Nigeria http://www.cashenvoy.com . I'm not seeing any log error and I'm not receiving any response which should change my order status from pending to completed or processing.

  14. queenielow
    Member
    Posted 1 year ago #

    Hi Winexviv,

    After the payment, there's no redirect back to Thank you page?
    if this gateway you purchase it from woocommerce, i suggest u ask them.

    if you created this plugin, you should maybe check with the bank that you are using.

  15. winexviv
    Member
    Posted 1 year ago #

    Here is the line of code that redirects to thank you page 'ce_notifyurl' => $redirect_url,. It recieves response with json decode. Please try and review the code.

  16. sdalby
    Member
    Posted 1 year ago #

    Hi I'm having problems with one of my WordPress E-commerce sites,

    The Template Design I'm using is called 'Verde', I think the last template update would have been in 2012 for this theme.

    I haven't had any problems with customer orders until today. I can go through and select my products, I can add to cart, then when I select to go through to PayPal to make the payment, I receive this error message:
    (This is on the PayPal screen after being redirected)

    This invoice has already been paid. For more information, please contact the merchant.
    Your purchase couldn't be completed
    There's a problem with the merchant's PayPal account. Please try again later.

    I had a similar problem on another website of mine, that also happened to have the same problem as this site but I simply updated the Woocommerce plugin which seemed to fix it.

    Having updated the Woocommerce plugin for this site however, I get this error message at the top of my dashboard in the back-end:

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'woocommerce_price_filter_init' was given in /home/djukok/public_html/pueraria-mirifica.com/wp-includes/plugin.php on line 406

    The site still seems to work fine, however I still can't get the paypal payment gateway to connect and function properly, where as the other site was a simple update to get it fixed.

    Can anyone please offer any advice or help in regards to this problem?

    Many thanks in advance,

    Sam

  17. wutrigy
    Member
    Posted 1 year ago #

    Hello

    I've tried all of this (thankyou.php and order-details.php), but in WC 2.0.12 it doesn't work.
    Order are payed successfully, but order status is still pending.

    Please help us to fix this

  18. spybubblegum
    Member
    Posted 11 months ago #

    Thanks for the solution! Worked for me!

    <?php $order->payment_complete(); ?>

  19. Pitou31
    Member
    Posted 10 months ago #

    Hi,
    Why to modify by ourself the WOO code by putting "<?php $order->payment_complete(); ?>"
    Modifications is still dangerous and I think it is part of WOO support to take care about this bug. Apparently many people, including myself,experiment this problem.
    But I don't know the way to contact the WOO Support to report this problem.
    Except buying something to their Woo Theme shop it seems that there is noway to contact their support.
    Do you confirm ?

  20. queenielow
    Member
    Posted 10 months ago #

    HI Pitou31,

    I dont want to modify it either but because i can't get any support from woocommerce ( same as what you encounter) and with a tight deadline, so i have to.

    I didn't modify their core, i'm just using one of their API to make it what i want.

    This forum is community forum and we help each other as developers.
    Please do appreciate what you see here if you could get support from Woo , please do share with all of us.

  21. Pitou31
    Member
    Posted 10 months ago #

    Hi Queenielow,
    Thank you for your reply.
    You say "I didn't modify their core, i'm just using one of their API to make it what i want." sorry but I don't know the way to use their API.
    Of course if I can get Woo support I will let the community know.
    For the moment this is what I received from the Sale support:

    Maria (WooThemes)

    Sep 05 22:32 (UTC)

    Hi Jacques,

    Thanks for the reply! I am sorry for the trouble you are having but the only way to get help as I mentioned is to have a product on your account. You may find it useful to know that we have a 30-day money back guarantee should you decide to purchase a product this will give you access to our support Ninjas and if you find out that this solution won't work the way you need, we can easily refund your money.

    I hope this helps!
    Cheers!

    Maria
    WooThemes Support

  22. queenielow
    Member
    Posted 10 months ago #

    Hi Pitou31,

    For woocommerce api , here is the docs online by woocommerce/woothemes. hope this help.

    http://docs.woothemes.com/wc-apidocs/

  23. Pitou31
    Member
    Posted 10 months ago #

    Than you queenielow. I will read it.

  24. Pitou31
    Member
    Posted 10 months ago #

    In the "thank you page" of the woocommerce version 2.0.14 (which is the last today) there are twice <p><?php _e( 'Thank you. Your order has been received.', 'woocommerce' ); ?></p> in the original line 36 and 67 .
    I put the <?php $order->payment_complete(); ?> in the first place before line 36 and not at the end.
    It seems working. Is it the right correction and the right place?
    I am not very familiar wit PHP language but it seems to me that in the first place we are in a situation that the payment is confirmed isn't it ? I don't know for the second place.
    Thank you for your help.

  25. queenielow
    Member
    Posted 10 months ago #

    Hi Pitou31,

    Yes, you have put at the right place.

    Not sure what the use of line 67 as it only have 1 thank you statement there. I guess you can add <?php $order->payment_complete(); ?> above the <p><?php _e( 'Thank you. Your order has been received.', 'woocommerce' ); ?></p> .

    Just to cover all possibility else just have it above line 36 is good enough.

    Cheers

  26. Pitou31
    Member
    Posted 10 months ago #

    Thanks queenielow.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic