• Resolved josmi95

    (@josmi95)


    Is it possible to show the cancellation form on my site without using pop up. We want it to directly show on the order confirmation page. Currently the plugin provided a button “Click here” along with the cancellation text. When clicking on the text, cancellation pop up will display. Our requirement is to display the cancelation form directly on the order confirmation page without using the pop up

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Sorry but that is not there

    Thread Starter josmi95

    (@josmi95)

    Currently, the functionality is, when a user purchased a product then got the order email and click on the text “Click to manage your order” which links to the order confirmation page and there is a text “Want to cancel this order? Click here” when clicking on this it will show the cancellation pop up form. Our requirement is when the user clicks on the text on the mail to cancel the order(Click to manage your order), then redirect to the order confirmation page and shows the pop-up form directly without clicking any other text.

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Hi,

    Add the below code in your theme functions.php file this will
    1) change the link the Email as “Cancel order” link
    2) when user will click on that link they come to order confirmation page with popup opened up by default

    
    
    class pisol_direct_open_popup_20211018{
    	function __construct(){
    		add_filter('pisol_corw_view_order_detail_link', [$this,'addingHash'], 10, 2);
    		add_action('wp_enqueue_scripts', [$this,'openPopupJS']);
    	}
    
    	function addingHash($html, $link){
    		return sprintf('<p><a href="%s#open-cancel-order-popup">%s</a></p>', $link, 'Cancel order');
    	}
    
    	
    function openPopupJS(){
    	$js = '
    		jQuery(document).ready(function($){
    			var url = $(location). attr("href");
    			if(url.includes("#open-cancel-order-popup")){
    				$(".pi_cancel_request_form").trigger("click");
    			}
    		});
    	';
    	wp_add_inline_script('jquery', $js, 'after');
    }
    }
    new pisol_direct_open_popup_20211018();
    
    
    Thread Starter josmi95

    (@josmi95)

    This code works perfectly. Thank you for your help.

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Your welcome see if you can rate us that will be great

    Thread Starter josmi95

    (@josmi95)

    On the Order confirmation page there is button text “Want to cancel this order? Click here” .when we click on this, the cancel order pop-up form shows and after submitting the form a thank you message popup is showing. We want two things

    1.We do not want to show the Thank you message pop up after submitting the cancellation popup form.
    2.After submitting the cancellation pop up form we want to replace the “Thank you for your purchase. An email has been sent with all the details” text showing the very first of order confirmation page with cancelation text.

    Help as to fix these points

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    We do not have any “Thank you message pop up box” after summation of the cancellation request

    can you please describe it properly with screenshot

    If you are referring to this Message on the thank you page (see below screenshot) then you can change that with the below code

    View post on imgur.com

    
    add_filter( 'woocommerce_thankyou_order_received_text', function($msg, $order){
    	if ( $order->has_status( 'cancel-request' ) ) return 'Your order cancellation request is submitted';
    },10, 2);
    
    Thread Starter josmi95

    (@josmi95)

    1.By using the above code the text is replaced when cancel order pop up form submit. but the thank you message is not shown when we first comes to the order confirmation page after checkout a product.We need to change the text only after the cancel order popup submission.

    refer image
    https://www.awesomescreenshot.com/image/15396239?key=277d7bbd226ac4a3d5a071c92469602b

    View post on imgur.com

    2.pop up is a custom pop up.please refer screenshort

    View post on imgur.com

    We need to hide this pop up in cancel order form submission.Provide any hook that trigger in cancel order popup form submission

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    Sorry the code will be like this

    
    add_filter( 'woocommerce_thankyou_order_received_text', function($msg, $order){
    	if ( $order->has_status( 'cancel-request' ) ){ 
    return 'Your order cancellation request is submitted';
    }
    
    return $msg;
    },10, 2);
    

    and the popup that you are showing in this screenshot https://imgur.com/a/VLURA2s is not added by our pluming and it is not part of the WooCommerce core either, so we don’t know how to disable that popup

    Thread Starter josmi95

    (@josmi95)

    Is there any way to differentiate the order confirmation page between cancel order pop form submission and checkout form submission. By using this we can hide the pop-up only in cancel order popup submission.

    Plugin Author rajeshsingh520

    (@rajeshsingh520)

    We are reading the URL and when url contains

    #open-cancel-order-popup we open the cancellation popup

    so you can also read the presence of #open-cancel-order-popup in the url to disable your thank you popup

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Is it possible to show the cancellation form in my site without using pop up.’ is closed to new replies.