Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hello
    Thanks for the response
    Got the issue, one of the plugins led to the error i.e MediaPress

    i highly appreciate your help
    Best Regards
    ndungu

    Hello
    Thanks for the response
    Got the issue, one of the plugins led to the error i.e MediaPress

    i highly appreciate your help
    Best Regards
    ndungu

    Hello
    @angelleye
    even after updating to woocommerce Version: 3.0.8 i still get the same error.

    Fatal error: Uncaught Error: Call to a member function is_on_sale() on null in /home/windowsh/public_html/wp-content/plugins/woocommerce/templates/single-product/sale-flash.php:26 Stack trace: #0 /home/windowsh/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(204): include() #1 /home/windowsh/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(950): wc_get_template(‘single-product/…’) #2 /home/windowsh/public_html/wp-includes/class-wp-hook.php(298): woocommerce_show_product_sale_flash(”) #3 /home/windowsh/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array) #4 /home/windowsh/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/windowsh/public_html/wp-content/plugins/woocommerce/templates/content-single-product.php(48): do_action(‘woocommerce_bef…’) #6 /home/windowsh/public_html/wp-includes/template.php(686): require(‘/home/windowsh/…’) #7 /home/windowsh/public_html/wp-content/plugins/woocommerce/includes/wc-core-f in /home/windowsh/public_html/wp-content/plugins/woocommerce/templates/single-product/sale-flash.php on line 26

    the php file has the same code

    <?php
    /**
    * Single Product Sale Flash
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/single-product/sale-flash.php.
    *
    * HOWEVER, on occasion WooCommerce will need to update template files and you
    * (the theme developer) will need to copy the new files to your theme to
    * maintain compatibility. We try to do this as little as possible, but it does
    * happen. When this occurs the version of the template file will be bumped and
    * the readme will list any important changes.
    *
    * @see https://docs.woocommerce.com/document/template-structure/
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 1.6.4
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }

    global $post, $product;

    ?>
    <?php if ( $product->is_on_sale() ) : ?>

    <?php echo apply_filters( ‘woocommerce_sale_flash’, ‘<span class=”onsale”>’ . esc_html__( ‘Sale!’, ‘woocommerce’ ) . ‘</span>’, $post, $product ); ?>

    <?php endif;

    /* Omit closing PHP tag at the end of PHP files to avoid “headers already sent” issues. */

    Best Regards
    ndungu

    Hello
    @angelleye

    Thanks for the response
    yes i switched the themes and the error still occurred and even deactivated the plugins and still it dint go away

    line 26 = <?php if ( $product->is_on_sale() ) : ?> just after global $post, $product;

    the Single Product Sale Flash php file has the following information

    Full code

    <?php
    /**
    * Single Product Sale Flash
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/single-product/sale-flash.php.
    *
    * HOWEVER, on occasion WooCommerce will need to update template files and you
    * (the theme developer) will need to copy the new files to your theme to
    * maintain compatibility. We try to do this as little as possible, but it does
    * happen. When this occurs the version of the template file will be bumped and
    * the readme will list any important changes.
    *
    * @see https://docs.woocommerce.com/document/template-structure/
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 1.6.4
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }

    global $post, $product;

    ?>
    <?php if ( $product->is_on_sale() ) : ?>

    <?php echo apply_filters( ‘woocommerce_sale_flash’, ‘<span class=”onsale”>’ . esc_html__( ‘Sale!’, ‘woocommerce’ ) . ‘</span>’, $post, $product ); ?>

    <?php endif;

    /* Omit closing PHP tag at the end of PHP files to avoid “headers already sent” issues. */

    Regards

    @mikejolley
    line 26 = <?php if ( $product->is_on_sale() ) : ?>
    the Single Product Sale Flash php file has the following information

    Full code

    <?php
    /**
    * Single Product Sale Flash
    *
    * This template can be overridden by copying it to yourtheme/woocommerce/single-product/sale-flash.php.
    *
    * HOWEVER, on occasion WooCommerce will need to update template files and you
    * (the theme developer) will need to copy the new files to your theme to
    * maintain compatibility. We try to do this as little as possible, but it does
    * happen. When this occurs the version of the template file will be bumped and
    * the readme will list any important changes.
    *
    * @see https://docs.woocommerce.com/document/template-structure/
    * @author WooThemes
    * @package WooCommerce/Templates
    * @version 1.6.4
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly
    }

    global $post, $product;

    ?>
    <?php if ( $product->is_on_sale() ) : ?>

    <?php echo apply_filters( ‘woocommerce_sale_flash’, ‘<span class=”onsale”>’ . esc_html__( ‘Sale!’, ‘woocommerce’ ) . ‘</span>’, $post, $product ); ?>

    <?php endif;

    /* Omit closing PHP tag at the end of PHP files to avoid “headers already sent” issues. */

    Regards

    • This reply was modified 8 years, 10 months ago by ndungu.
    • This reply was modified 8 years, 10 months ago by ndungu.
    • This reply was modified 8 years, 10 months ago by ndungu.
    • This reply was modified 8 years, 10 months ago by ndungu.

    Hello
    @mikejolley
    i have the latest version of woocommerce 3.07 and i am experiencing the error

    Fatal error: Uncaught Error: Call to a member function is_on_sale() on null in /home/windowsh/public_html/wp-content/plugins/woocommerce/templates/single-product/sale-flash.php:26 Stack trace: #0 /home/windowsh/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(204): include() #1 /home/windowsh/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(950): wc_get_template(‘single-product/…’) #2 /home/windowsh/public_html/wp-includes/class-wp-hook.php(298): woocommerce_show_product_sale_flash(”) #3 /home/windowsh/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(”, Array) #4 /home/windowsh/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #5 /home/windowsh/public_html/wp-content/plugins/woocommerce/templates/content-single-product.php(48): do_action(‘woocommerce_bef…’) #6 /home/windowsh/public_html/wp-includes/template.php(686): require(‘/home/windowsh/…’) #7 /home/windowsh/public_html/wp-content/plugins/woocommerce/includes/wc-core-f in /home/windowsh/public_html/wp-content/plugins/woocommerce/templates/single-product/sale-flash.php on line 26

    kindly give direction
    Best Regards
    Steve

    Hello
    i am running Woocommerce 3.07 and got this error, however, the site has been running ok. kindly give direction.

    Fatal error: Call to a member function is_on_sale() on null in /home//public_html/wp-content/plugins/woocommerce/templates/single-product/sale-flash.php on line 26

    Hi
    Great plugin but its not working.
    Plus, cant find the updated version on WordPress.
    kindly give the link for the updated version.
    Best Regards

    Hi
    Great plugin but its not working.
    Plus, if the update looks like above then its not yet updated on WordPress.
    kindly give the link for the updated version.
    Best Regards

Viewing 9 replies - 1 through 9 (of 9 total)