Add a custom code with custom link after add to cart for every product

You need to add custom meta box such as product_ext_url for product post type. Then use hook below to add your code in single product page. add_action( ‘woocommerce_after_add_to_cart_button’, ‘your_function’ ); function your_function(){ echo get_post_meta( $product_id, ‘product_ext_url’ ); } In above function you will print external url of current product after add-to-cart button. // UPDATE To … Read more