WC_Product_Variation::add_to_cart_url()publicWC 1.0

Get the add to url used mainly in loops.

{} Это метод класса: WC_Product_Variation{}

Хуки из метода

Возвращает

Строку.

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

$WC_Product_Variation = new WC_Product_Variation();
$WC_Product_Variation->add_to_cart_url();

Код WC_Product_Variation::add_to_cart_url() WC 6.4.1

public function add_to_cart_url() {
	$url = $this->is_purchasable() ? remove_query_arg(
		'added-to-cart',
		add_query_arg(
			array(
				'variation_id' => $this->get_id(),
				'add-to-cart'  => $this->get_parent_id(),
			),
			$this->get_permalink()
		)
	) : $this->get_permalink();
	return apply_filters( 'woocommerce_product_add_to_cart_url', $url, $this );
}