WordPress at Your Fingertips
function is not described

WC_Legacy_Cart::__set() public WC 1.0

Map legacy variables to setters.

{} It's a method of the class: WC_Legacy_Cart{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Legacy_Cart = new WC_Legacy_Cart();
$WC_Legacy_Cart->__set( $name, $value );
$name(string) (required)
Property name.
$value(mixed) (required)
Value to set.

Code of WC_Legacy_Cart::__set() WC 5.7.1

public function __set( $name, $value ) {
	switch ( $name ) {
		case 'cart_contents_total' :
			$this->set_cart_contents_total( $value );
			break;
		case 'total' :
			$this->set_total( $value );
			break;
		case 'subtotal' :
			$this->set_subtotal( $value );
			break;
		case 'subtotal_ex_tax' :
			$this->set_subtotal( $value );
			break;
		case 'tax_total' :
			$this->set_cart_contents_tax( $value );
			$this->set_fee_tax( 0 );
			break;
		case 'taxes' :
			$this->set_cart_contents_taxes( $value );
			break;
		case 'shipping_taxes' :
			$this->set_shipping_taxes( $value );
			break;
		case 'fee_total' :
			$this->set_fee_total( $value );
			break;
		case 'discount_cart' :
			$this->set_discount_total( $value );
			break;
		case 'discount_cart_tax' :
			$this->set_discount_tax( $value );
			break;
		case 'shipping_total' :
			$this->set_shipping_total( $value );
			break;
		case 'shipping_tax_total' :
			$this->set_shipping_tax( $value );
			break;
		case 'coupon_discount_amounts' :
			$this->set_coupon_discount_totals( $value );
			break;
		case 'coupon_discount_tax_amounts' :
			$this->set_coupon_discount_tax_totals( $value );
			break;
		case 'fees' :
			wc_deprecated_function( 'WC_Cart->fees', '3.2', sprintf( 'the fees API (%s)', 'WC_Cart::add_fee' ) );
			$this->fees = $value;
			break;
		default :
			$this->$name = $value;
			break;
	}
}