Home > database >  Run a specific filter or function on WooCommerce checkout page
Run a specific filter or function on WooCommerce checkout page

Time:10-03

actully i want to resize the cart item thumbnail on checkout page of WooCommerce currently i am using I can't change the product image size for woocommerce anser code in my child theme

but when i add this in my child functions .. it also resize the thubnail of main home page. i want this function to run only on woocommerce checkout page. please help me to fix that. i have tried is_page function also but running into error.

CodePudding user response:

You can use Woocommerce Conditional tag of Checkout Page.

if ( is_checkout() ) {
  // Your Code Here
} 

Source: https://docs.woocommerce.com/document/conditional-tags/

CodePudding user response:

You can use the WooCommerce Visual Hook to run the code only on the checkout

add_action('woocommerce_before_checkout_form','function_name');
function function_name(){
   //your code here
}

source:https://www.businessbloomer.com/woocommerce-visual-hook-guide-checkout-page

  • Related