• Resolved Konstantin

    (@k0stell0)


    Hi,

    I’m thinking about using your plugin on my website, but I already have a lot of custom WooCommerce templates in my Child Theme. By default, WooCommerce allows to copy any templates from “wp-content\plugins\woocommerce\templates\” to “wp-content\themes\your-child-theme\woocommerce\” and customize them to your needs. After installing CartFlows, all my changes were overridden.

    I found that in CartFlows you have copied the same templates to “wp-content\plugins\cartflows\woocommerce\template\”.
    Is there any options to copy them into my Child Theme to customize?

    I’ve tried to copy them to:
    “wp-content\themes\your-child-theme\cartflows\”
    “wp-content\themes\your-child-theme\cartflows\woocommerce\template\”
    but it doesn’t work for me.
    Any ideas would be highly appreciated.

    Many thanks,
    Kon

    • This topic was modified 4 years, 6 months ago by Konstantin.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support CartFlows Team

    (@cartflows)

    Hello @k0stell0

    Thank you for getting in touch with us!

    You are correct, CartFlows overriding the WooCommerce’s some of the templates.
    CartFlows is using woocommerce_locate_template WooCommerce filter to override those templates.

    So you can also use this filter to override the templates that is been overridden by the CartFlows.

    Using this filter you just need to change the template path from the CartFlows directory to your child theme’s WooCommerce directory.

    I hope this helps.

    If you need more help or assistance don’t hesitate to open a technical support request from here.

    Thread Starter Konstantin

    (@k0stell0)

    Hi @cartflows

    Thanks for your reply.
    I was trying to use the following code to point to my template, but looks like I’m doing something wrong

    
    add_filter( 'woocommerce_locate_template', 'override_cartflows_template', 10, 3 );
    function override_cartflows_template( $template, $template_name, $template_path ) {
    	if ( 'form-login.php' === basename( $template ) ) {
    		$template = 'wp-content/themes/my-child-theme/woocommerce/checkout/form-login.php';
    	}
    	return $template;
    }
    

    I wonder if you could help me to figure out why it’s not working?

    Many thanks,
    Kon

    • This reply was modified 4 years, 5 months ago by Konstantin.
    • This reply was modified 4 years, 5 months ago by Konstantin.
    Plugin Support CartFlows Team

    (@cartflows)

    Hello @k0stell0

    Thank you for getting back to us!.

    It seems that the path that you have configured is not properly added. You need to use the theme functions to get the theme directory path and then you can use it to create an absolute path for the templates that you want to override.

    Here is the article which can help you. You can open it from here.
    I hope this helps.

    Feel free to get in touch in case you need more help or assistance.

    Thread Starter Konstantin

    (@k0stell0)

    Hi @cartflows

    Thanks your reply and the article on this topic. I’ve adjusted my code accordingly:

    
    function override_cartflows_template($template, $template_name, $template_path) {
        if ($template_name == 'checkout/form-login.php') {
            $template = 'wp-content/themes/hello-theme-child-master/woocommerce/checkout/form-login.php';
        }
        return $template;
    }
    add_filter('woocommerce_locate_template', 'override_cartflows_template', 20, 3);
    

    In the article you mentioned, they use absolute path to the template, but in my case it doesn’t work.
    Unfortunately, I don’t have a lot of experience with WP functions and would really appreciate your help on this one.

    Many thanks,
    Kon

    Plugin Support CartFlows Team

    (@cartflows)

    Hello @k0stell0

    Thank you for getting in touch with us!

    Actually, this is and additional customization that you are trying to achieve so, let me tell you that for additional customization I suggest you to get help of a freelancer developer who will help you with the additional customization.

    But, I have take a once step forward and created a simple code for your help. You can download it from here: https://share.getcloudapp.com/jkuQ2QY4

    So, in this code, you need to add your child theme’s directory path and the templates that you have added in your child theme you can override it using the proper conditions.

    I hope this clarifies you.

    Feel free to get in touch in case you need more help or assistance.
    ?
    Please let me know in case you have more questions.

    Thread Starter Konstantin

    (@k0stell0)

    Hi @cartflows

    Thank you so much for your help. Your code works for me perfectly fine. Very much appreciate your help on this one.

    Cheers,
    Kon

    Plugin Support CartFlows Team

    (@cartflows)

    Hello @k0stell0

    I am happy that I was able to help you with your issue.

    If you are happy with our support and the plugin then if you don’t mind can you leave a five star review?

    This would help other users make a comfortable decision while downloading the plugin and be assured of the support we provide.

    You can leave a feedback from here & if you want too get the news and updates about the CartFlows you can join our Facebook group from here.

    Feel free to open a new support topic in case you need more help or assistance.

    Have a great day ahead & stay safe.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @cartflows Again, please do not use ?rate=5 when you ask for a review. This will be forwarded to the plugins team for review.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CartFlows overwrites WooCommerce Templates in Child Theme’ is closed to new replies.