Comment out exception code - see #11715

This commit is contained in:
Mike Jolley 2016-08-17 17:07:30 +01:00
parent 709dec9ef1
commit 594bceedf2
3 changed files with 5 additions and 5 deletions

View File

@ -700,7 +700,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
*/ */
public function set_currency( $value ) { public function set_currency( $value ) {
if ( $value && ! in_array( $value, array_keys( get_woocommerce_currencies() ) ) ) { if ( $value && ! in_array( $value, array_keys( get_woocommerce_currencies() ) ) ) {
$this->throw_exception( 'invalid_currency', 'Invalid currency code' ); //$this->throw_exception( 'invalid_currency', 'Invalid currency code' );
} }
$this->_data['currency'] = $value; $this->_data['currency'] = $value;
} }

View File

@ -128,7 +128,7 @@ class WC_Order_Item_Fee extends WC_Order_Item {
*/ */
public function set_tax_class( $value ) { public function set_tax_class( $value ) {
if ( $value && ! in_array( $value, WC_Tax::get_tax_classes() ) ) { if ( $value && ! in_array( $value, WC_Tax::get_tax_classes() ) ) {
$this->throw_exception( __METHOD__, 'Invalid tax class' ); //$this->throw_exception( __METHOD__, 'Invalid tax class' );
} }
$this->_data['tax_class'] = $value; $this->_data['tax_class'] = $value;
} }

View File

@ -234,7 +234,7 @@ class WC_Order_Item_Product extends WC_Order_Item {
*/ */
public function set_quantity( $value ) { public function set_quantity( $value ) {
if ( 0 >= $value ) { if ( 0 >= $value ) {
$this->throw_exception( __METHOD__, 'Quantity must be positive' ); //$this->throw_exception( __METHOD__, 'Quantity must be positive' );
} }
$this->_data['quantity'] = wc_stock_amount( $value ); $this->_data['quantity'] = wc_stock_amount( $value );
} }
@ -245,7 +245,7 @@ class WC_Order_Item_Product extends WC_Order_Item {
*/ */
public function set_tax_class( $value ) { public function set_tax_class( $value ) {
if ( $value && ! in_array( $value, WC_Tax::get_tax_classes() ) ) { if ( $value && ! in_array( $value, WC_Tax::get_tax_classes() ) ) {
$this->throw_exception( __METHOD__, 'Invalid tax class' ); //$this->throw_exception( __METHOD__, 'Invalid tax class' );
} }
$this->_data['tax_class'] = $value; $this->_data['tax_class'] = $value;
} }
@ -331,7 +331,7 @@ class WC_Order_Item_Product extends WC_Order_Item {
*/ */
public function set_product( $product ) { public function set_product( $product ) {
if ( ! is_a( $product, 'WC_Product' ) ) { if ( ! is_a( $product, 'WC_Product' ) ) {
$this->throw_exception( __METHOD__, 'Invalid product' ); //$this->throw_exception( __METHOD__, 'Invalid product' );
} }
$this->set_product_id( $product->get_id() ); $this->set_product_id( $product->get_id() );
$this->set_name( $product->get_title() ); $this->set_name( $product->get_title() );