Oxygen builder have an add-on for WooComerce plugin and you can create the custom shop, archive, single product etc pages quickly. But sometimes we are getting the complex challenge, and that time we need to edit the core templates files.
WooCommerce have an option. You can easily override the templates file from your active theme’s folder. But there have a problem for Oxygen builder. We knew that Oxygen builder is not loading the theme. In this scenario we need the custom plugin and edit the templates.
I already created a blank helper plugin Customize Oxygen Builder. Download the plugin and upload on your site via Dashboard. You can avoid my plugin if you built one for your site. In that case you can just use my PHP snippet.
In my plugin have a helpers.php file inside the includes folder. Open the file and put this PHP snippets
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
<?php /************************************************* Add your custom PHP code inside this PHP file *************************************************/ add_action( 'after_setup_theme', 'pauloxyb_after_setup_oxyb' ); function pauloxyb_after_setup_oxyb() { //* Allow to override WC /templates path add_filter( 'wc_get_template', 'pauloxyb_wc_template', 10, 5 ); add_filter( 'wc_get_template_part', 'pauloxyb_wc_template_part', 10, 3 ); } function pauloxyb_wc_template( $located, $template_name, $args, $template_path, $default_path ) { $newtpl = str_replace( 'woocommerce/templates', basename( POXYB_DIR ) . '/woocommerce', $located ); if ( file_exists( $newtpl ) ) return $newtpl; return $located; } function pauloxyb_wc_template_part( $template, $slug, $name ) { $newtpl = str_replace( 'woocommerce/templates',basename( POXYB_DIR ) . '/woocommerce', $template ); if ( file_exists( $newtpl ) ) return $newtpl; return $template; } |
Now you will create the “woocommerce” folder inside the plugin folder and customize the any templates. Please check the above video.
sixto says
the changes do not appear on my site can help me thanks Override Core WooCommerce Template Files in Oxygen Builder
https://www.loom.com/share/650a02b7c0014b3a8831041cdea39492
Aleš Sýkora says
Hello, this is awesome, thanks! Do you have any idea how to use this, to force WordPress to load custom theme.json, when Oxygen Builder is activated?
Seth says
Hi,
Great video and helpful tips but after implementing, I have found that the solution is not working. It seems the /woocommerce/single-product/related.php path & file are not being read in the plugin.
Would appreciate any feedback you have on this.
Thanks,
SL
Harish says
Hi Mate,
I need your help!
How we can override the js file.
Path: /wp-content/plugins/woocommerce/assets/js/frontend/checkout.js