Home Forums WoodMart support forum Custom template page for ‘form-checkout’

Custom template page for ‘form-checkout’

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #603639

    chefnelone
    Participant

    Hello,

    I had a custom template page for ‘form-checkout’ placed at: wp-content/themes/woodmart-child/woocommerce/checkout/form-checkout.php (Capture 1)

    It was working fine.

    But now I created a Checkout Layout (Capture 2) and now the custom template page is not working anymore. No errors but it is just ignored.

    I guess that I need to change the location or the name of the custom template.

    How you please give directions?
    Thanks

    Attachments:
    You must be logged in to view attached files.
    #603650

    chefnelone
    Participant

    For your information:

    I just need to modify this line in the file:
    Just in case I can do this in the Woodmart Layout itself.

    
    // If checkout registration is disabled and not logged in, the user cannot checkout.
    if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
    	echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
    	return;
    }
    #603693

    Hello,

    Here is a tutorial that should help you
    https://xtemos.com/woocommerce-hooks-introduction-tutorial/

    Best Regards

    #603696

    chefnelone
    Participant

    Hello,

    I understand that I need to use a hook. Can you tell me the name of the hook please?
    I need to place the text in the checkout page at the top for non-logged users.

    Is this one: “woocommerce_before_checkout_form”?

    Thanks

    • This reply was modified 3 months, 1 week ago by chefnelone.
    #603700

    chefnelone
    Participant

    I tried this but not working. Can you please help me?
    I just need the right name of the hook.

    
    add_action( 'woocommerce_before_checkout_form', 'before_checkout_form_1', 10 );
    function before_checkout_form_1(){
    		echo "hi";
    	}
    #603703

    chefnelone
    Participant

    The problem is the Cart Layout I created. If I disable the Layout the hooks works fine.
    Please, take a look: https://drive.google.com/file/d/1G6nzzkm5WgsKzKRorrMytjiKRMSNHdCq/view?usp=sharing

    • This reply was modified 3 months, 1 week ago by chefnelone.
    • This reply was modified 3 months, 1 week ago by chefnelone.
    • This reply was modified 3 months, 1 week ago by chefnelone.
    #603988

    Hello,

    To add a custom hook, you need to add a WooCommerce hook element and select the desired hook. Here is the relevant documentation page: https://xtemos.com/docs-topic/custom-hooks-and-plugins-compatibility/

    Best Regards.

Viewing 7 posts - 1 through 7 (of 7 total)