Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › external product URL redirection
- This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Sarmistha Chakraborty.
- AuthorPosts
- April 19, 2020 at 3:26 pm #120591
- April 20, 2020 at 12:29 pm #120866Sarmistha ChakrabortyMember
Hello,
Sorry, but we didn’t get your requirement. Can you explain little more.
Here is WooCommerce External Product Documentation : https://woocommerce.com/videos/woocommerce-external-affiliate-product-overview/Thanks.
- April 20, 2020 at 6:43 pm #120994karl ohinParticipant
Hi Guys
thanks for the reply.
Yes i understand the product function.
So what i mean is .
If i put in a URL in the product edit page, when a user clicks the button it opens up a new tab in browser to the URL specified – thats normal operation
What i am looking for
If i leave the URL blank currently the button still opens up a new tab with the “#” link – so the same page.
I need the function of the button when URL is empty to open up the enquiry window .
If URL = http – open window
ELSE open enquiry window .The reason behind this that if i dont have the affilate and i want to generate LEADS i can measure them .
Do you understand what i mean ?
Many Thanks
- April 20, 2020 at 8:40 pm #121053Sarmistha ChakrabortyMember
Hi,
To add below code in your theme’s functions.php, you can use our inquiry module(https://wclovers.com/knowledgebase/wcfm-enquiry-module/) for those external product have no url filled in product edit.
function woocommerce_external_add_to_cart() { global $product; if ( ! $product->add_to_cart_url() ) { ?> <a href="javascript:void(0)" id="external_url_enquiry">Ask the Price</a> <?php return; } wc_get_template( 'single-product/add-to-cart/external.php', array( 'product_url' => $product->add_to_cart_url(), 'button_text' => $product->single_add_to_cart_text(), ) ); }
Thanks.
- AuthorPosts
- You must be logged in to reply to this topic.