title: How to add custom button to WooCommerce product archives
body: <p>I would like to add a custom button <em>(&quot;SEE ALL&quot;)</em> on product archive. I have already this custom button displayed on single product pages.</p>
  <p>What I want is to remove it from single product pages and add it to WooCommerce product archives instead.</p>
  <p><strong>Edited</strong>:
  <em>There is another issue with this code. when i remove the link from the backend and make the field empty and then click update button. The link remains there. means if i replace the link with another it works fine but the field does not get empty once filled with something. if i save the product with the empty field the previous value remains there after page load.</em></p>
  <p>Here is the related code:</p>
  <pre><code>// This function gets the value for the the custom fields from the database and adds it to the frontend output function
  function wpse_add_custom_link_output() {
      $external_link = get_post_meta(get_the_ID(), '_custom_product_text_field', true);
      $html = '&lt;a href=&quot;'.$external_link.'&quot; class=&quot;custom-button-class&quot; target=&quot;_blank&quot; title=&quot;'.__('External product link','woocommerce').'&quot;&gt;SEE ALL&lt;/a&gt;';
      echo $html;
  };
  add_action( 'woocommerce_after_add_to_cart_button', 'wpse_add_custom_link_output', 10, 0 ); 
  // This function creates the field in the backend
  function wpse_add_custom_link_field(){
      global $woocommerce, $post;
      echo '&lt;div class=&quot;product_custom_field&quot;&gt;';
      // Custom Product Text Field
      woocommerce_wp_text_input(
          array(
              'id' =&gt; '_custom_product_text_field',
              'placeholder' =&gt; __('Paste product link here', 'woocommerce'),
              'label' =&gt; __('Custom product link', 'woocommerce'),
              'desc_tip' =&gt; 'true'
          )
      );
      echo '&lt;/div&gt;';
  }
  add_action('woocommerce_product_options_general_product_data', 'wpse_add_custom_link_field');
  // this function saves the link/text field
  function wpse_save_custom_link_field($post_id){
      // Custom Product Text Field
      $woocommerce_custom_product_text_field = $_POST['_custom_product_text_field'];
      if (!empty($woocommerce_custom_product_text_field))
      update_post_meta($post_id, '_custom_product_text_field', 
      esc_attr($woocommerce_custom_product_text_field));
  }
  add_action('woocommerce_process_product_meta', 'wpse_save_custom_link_field');
  </code></pre>