Home › Forums › WoodMart support forum › Custom template page for ‘form-checkout’
Custom template page for ‘form-checkout’
- This topic has 6 replies, 2 voices, and was last updated 3 months, 1 week ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
October 9, 2024 at 11:08 am #603639
chefneloneParticipantHello,
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?
ThanksAttachments:
You must be logged in to view attached files.October 9, 2024 at 11:29 am #603650
chefneloneParticipantFor 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; }
October 9, 2024 at 12:41 pm #603693
Aizaz Imtiaz AwanKeymasterHello,
Here is a tutorial that should help you
https://xtemos.com/woocommerce-hooks-introduction-tutorial/Best Regards
October 9, 2024 at 12:54 pm #603696
chefneloneParticipantHello,
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.
October 9, 2024 at 1:11 pm #603700
chefneloneParticipantI 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"; }
October 9, 2024 at 1:18 pm #603703
chefneloneParticipantThe 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.
October 10, 2024 at 10:54 am #603988
Aizaz Imtiaz AwanKeymasterHello,
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.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register