WordPress at Your Fingertips
function is not described

WC_Product_Simple::add_to_cart_url() public WC 1.0

Get the add to url used mainly in loops.

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

Hooks from the method
Return

String.

Usage

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

Code of WC_Product_Simple::add_to_cart_url() WC 5.6.0

public function add_to_cart_url() {
	$url = $this->is_purchasable() && $this->is_in_stock() ? remove_query_arg(
		'added-to-cart',
		add_query_arg(
			array(
				'add-to-cart' => $this->get_id(),
			),
			( function_exists( 'is_feed' ) && is_feed() ) || ( function_exists( 'is_404' ) && is_404() ) ? $this->get_permalink() : ''
		)
	) : $this->get_permalink();
	return apply_filters( 'woocommerce_product_add_to_cart_url', $url, $this );
}