Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jas_gecko_os_locate_template( $located, $template_name, $args, $template_path, $default_path ) {
- if ( $template_name == 'single-product/add-to-cart/variable.php' ) {
- global $post;
- $tmp = get_post_meta( $post->ID, '_allow_openswatch', true );
- if ( $tmp != 0 ) {
- // Change the path to new template file here
- return get_stylesheet_directory_uri() . 'your_file_here.php';
- }
- }
- return $located;
- }
- add_filter( 'wc_get_template','jas_gecko_os_locate_template', 20, 5 );
Add Comment
Please, Sign In to add comment