0

I am using my child's theme functions.php to add custom functions. Thing is, I heavily modified the checkout page, so in my functions.php there are:
-about 300 lines I want to use globally,
-but then there are about 700 lines for checkout page alone.

And add to that, there are checkout-related customizations in 4 other files:
-form-checkout.php,
-payment.php,
-review-order.php,
-shipping-order-review.php (custom file)

I was wondering, is there a way to load all those checkout-related functions only on cart and checkout pages and not globally?
Could this be done by creating a custom plugin and then dequeue the script from certain pages?
Can someone point me to what should I search because I have no clue (guides, etc.)?
Also, could the same be done for styles.css (have separate files somehow and load separate custom .css based on the page you want)?

Thanks in advance.

ilkork
  • 23
  • 5
  • You can use conditional tags: https://woocommerce.com/document/conditional-tags/ – Terminator-Barbapapa Sep 22 '22 at 07:17
  • After a little bit of searching, I realised that I have to study more, because I can't make it work. Even a simple test: if ( is_checkout() ) { [custom functions here] } breaks my checkout page. But it's a start, thank you very much. – ilkork Sep 22 '22 at 08:20

0 Answers0