• So I decided to give Customizr another try before I scrap the idea of using it on this particular site, everything works fine with woocommerce and the plugins in the PARENT THEME. But the moment I go to use the child theme I insert the coding I need into the functions.php file which has been verified to work via Mike Jolley from woocommerce and has worked in the past and it goes to hell and a handbasket really quick.

    I do my test by adding items to the cart using the CHILD THEME and when I go to checkout all it does is hang and will not let me proceed to the finale steps to finish the transaction.

    I have cleared all transients as was suggested by Mike also disabled all plugins except woocommerce in the CHILD THEME, cleared my cache in the browser, reinstalled both customizr, child theme that was downloaded from presscustomizr, wordpress core and woocommerce. Even went as far as clearing out the database on the server side. And still no luck. I use Customnizr on 2 other websites with child themes and have no issues granted they do not have woocommerce installed on them and when you copy Customizr core files that you want to modify everything still works.

    Here is what the style.css and the functions.php look like.. I would really like to keep using the Customizr theme and would consider going pro for this one retail site because I really like how it looks so any help would be appreciated.

    ?/*
    Theme Name:     EatGaff Tape
    Theme URI:      https://eatgafftaperadio.com/childmain
    Description:    A child theme for the Customizr WordPress theme. This child theme simply includes 2 files : style.css to add your custom css and functions.php where you can extend Customizr's core code. In order to keep your code as clean and flexible as possible, try to use Customizr's hooks API for your customizations. Do something awesome and have fun !
    Author:         Nicolas Guillaume (nikeo)
    Author URI:     https://eatgafftaperadio.com
    Template:       customizr
    Version:        1.0.0
    */
    
    /* Your awesome customizations start right here !
    -------------------------------------------------------------- */
    ?<?php
    /**
    * This is where you can copy and paste your functions !
    */
    /**
     * woocommerce_package_rates is a 2.1+ hook
     */
    add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 );
    
    /**
     * Hide shipping rates when free shipping is available
     *
     * @param array $rates Array of rates found for the package
     * @param array $package The package array/object being shipped
     * @return array of modified rates
     */
    function hide_shipping_when_free_is_available( $rates, $package ) {
    
     	// Only modify rates if free_shipping is present
      	if ( isset( $rates['free_shipping'] ) ) {
    
      		// To unset a single rate/method, do the following. This example unsets flat_rate shipping
      		unset( $rates['flat_rate'] );
    
      		// To unset all methods except for free_shipping, do the following
      		$free_shipping          = $rates['free_shipping'];
      		$rates                  = array();
      		$rates['free_shipping'] = $free_shipping;
    	}
    
    	return $rates;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,
    I cannot reproduce your issue (copying the code you posted in my child-theme functions.php).
    Also cannot reproduce it on your site, also ’cause the only one available checkout I see is through paypal (the only one I can see) which takes me outside your site of course.
    Another thing not clear to me is,
    does a child theme without the code above work fine?

    What do you mean with “hang”, blank page or what?
    Did you try to enable WP_DEBUG to see if that helps printing some error?

    Thread Starter BARTNKCMO

    (@bartnkcmo)

    When I am in my admin section and browse the site and try placing an order it is supposed to give you an option of checkout the normal woocommerce way way where you can input your fields and agree to the terms before you proceed to paypal this is where it hangs up. at the very bottom it just sits there and spins and will not let you click on anything.

    The other button is for paypal quick checkout takes you directly to paypal with no issue. I am more than happy to scrap that idea due to the fact that is can cause issues with spammers trying to use bogus cards to buy products with.

    In the top part of the site under USER TOOLS you will see Checkout once you goto that screen there is the issue where it just hangs up and spins an icon at the bottom.

    The code listed above is used to hide shipping if a certain amount is hit ( currently set at 300 ) anything under that will show a $15.00 shipping fee

    The code was working with no issues in the child theme before the upgrades to Customizr.. Hope this helps

    Yea I see what that code does ?? and cannot see how it could cause the issue (for the record if you want to unset all the shippings when the free is available you don’t need the unset line, if you need to just unset the flat in the same condition, you don’t need the second block, as you can read they cover different use case), that’s why I asked you if without that code you could experience the same issue ( but I cannot understand this from your answer above )
    What does this mean?

    The code was working with no issues in the child theme before the upgrades to Customizr..

    Did it work fine in a child theme of another theme, or did it work fine before upgrading to the latest Customizr?

    Mmm, I’ve been able to reproduce the issue on your site.
    This is the issue, right?
    https://prntscr.com/9ci85z

    Looks like a js issue.
    It might depend on some other plugin too.
    I see this in your site (google-chrome console)
    https://prntscr.com/9cigqt
    also, what’s this?
    https://prntscr.com/9cih20
    mah..

    Anyway if you want to figure out why this is happening you have to proceed with valid tests.
    1) disable all your plugins (woocommerce excluded)
    if the issue doesn’t occur, it might be a plugin fault or a theme’s conflict with a plugin.
    2) activate the parent theme and see if you can reproduce it (so you can exclude the child-theme if it still occurs)
    3) activate a “vanilla” child-theme (so you can exclude the custom function if it still occurs)
    4) put the custom code in the child-theme functions.php
    .. and so on..
    if you can’t reproduce the issue keeping the plugins disabled
    then you can start activating theme one by one.

    Anyway I’m unable to reproduce the issue. Works fine here with the custom function in my child-theme functions.php

    Hope this helps.

    Thread Starter BARTNKCMO

    (@bartnkcmo)

    So I did the suggested and everything works fine in the parent theme with all plugins enabled and disabled for the testing.

    I then deleted the old child theme and started with a blank slate and no custom functions and everything worked fine with all plugins enabled and then disabled with only woocommerce running. So the plugins were eliminated as a source of the problem.

    The minute I add the custom function to the functions.php the issue starts, the same goes for any custom function being added to that area.

    In regards to this https://prntscr.com/9cigqt from the research i have done Woocommerce blames the theme developers and the teme developers blame woocommerce . So who knows when that battle will ever get fixed. Until then I am dead in the water with my retail site.

    As for this issue https://prntscr.com/9cih20 I have no idea what that even is..

    I am unable to pinpoint when the issue actually started or if it was due to a customizr update or recent woo commerce updates. I do know that it started a couple days before Thanksgiving when I went to add product updates to the site for a month long sale I was wanting to have for my musician customers which was missed .

    I am the owner a company with 3 employees and it is up to me to handle the website, provide audio gear for shows, book the events and handle all the retail sales in addition to programming light shows and audio consoles so you can imagine my frustration when everything messes up lol

    Bart

    Thread Starter BARTNKCMO

    (@bartnkcmo)

    So I turned on DEBUG Mode in wp-config and found the following error. So now the major what needs to be done to fix this. This was found while using the CHILD THEME.

    instead. in E:\HostingSpaces\*******\eatgafftape*****.com\wwwroot\wp-includes\functions.php on line 3619

    Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
    __construct()
    instead. in E:\HostingSpaces\*******\eatgafftape*****.com\wwwroot\wp-includes\functions.php on line 3619

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Child Theme’ is closed to new replies.