replace get_product_url with add_to_cart_url
This commit is contained in:
parent
af6998fe4d
commit
fe6f680e44
|
@ -883,13 +883,14 @@ if ( ! function_exists( 'woocommerce_external_add_to_cart' ) ) {
|
|||
function woocommerce_external_add_to_cart() {
|
||||
global $product;
|
||||
|
||||
if ( ! $product->get_product_url() )
|
||||
if ( ! $product->add_to_cart_url() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wc_get_template( 'single-product/add-to-cart/external.php', array(
|
||||
'product_url' => $product->get_product_url(),
|
||||
'button_text' => $product->single_add_to_cart_text()
|
||||
) );
|
||||
'product_url' => $product->add_to_cart_url(),
|
||||
'button_text' => $product->single_add_to_cart_text()
|
||||
) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue