«
»

2015, woocommerce, wordpress

Solución WooCommerce::add_error()

03.20.15 | Comment?

Alberto Suárez Pérez

Solo necesitas reemplazar en el archivo woocommerce-checkout-manager.php la función wccs_custom_checkout_field_process().
Error:
Fatal error: Call to undefined method WooCommerce::add_error()

function wccs_custom_checkout_field_process() {
global $woocommerce;
$options = get_option( 'wccs_settings' );
    if ( count( $options['buttons'] ) > 0 ) : 
		foreach ( $options['buttons'] as $btn ) :
            if ( (!$_POST[ ''.$btn['cow'].'' ] )  && (true == ($btn['checkbox']) ) )

                //$woocommerce->add_error( '<strong>'.$btn['label'].'</strong> '. __('is a required field', 'woocommerce-checkout-manager' ) . ' ');
                wc_add_notice( '<strong>' . $btn['label'] . '</strong> ' . __( 'is a required field.', 'woocommerce' ), 'error' );
		endforeach;
    endif;
}

Comments are closed.


«
»