WC_Cart::__clone()publicWC 1.0

When cloning, ensure object properties are handled.

These properties store a reference to the cart, so we use new instead of clone.

Метод класса: WC_Cart{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Cart = new WC_Cart();
$WC_Cart->__clone();

Код WC_Cart::__clone() WC 8.9.0

public function __clone() {
	$this->session  = clone $this->session;
	$this->fees_api = clone $this->fees_api;

	$this->session->set_cart( $this );
}