One of my client is decided to add a add Woocommerce Email a Friend button at just below the Add to Cart button on the Woocommerce single product page. This will email the product url to your friend email address.
1 2 3 4 5 6 7 8 9 10 11 | /** * Plugin action links. * Add settings links to the plugins.php page below the plugin name */ add_filter("plugin_action_links_$plugin", 'fm_plugin_settings_link' ); function fm_plugin_settings_link($links) { $settings_link = '<a href="admin.php?page=wc-settings&tab=settings_tab_refer_friend">Settings</a>'; array_unshift($links, $settings_link); return $links; } |
1 2 3 4 5 6 7 8 9 | /** * Add script to front end website */ function fm_enqueue_script() { wp_enqueue_script( 'jquery'); wp_enqueue_script('bootstrap-js',plugins_url("js/bootstrap.min.js",__FILE__)); } add_action( 'wp_enqueue_scripts', 'fm_enqueue_script' ); |
1 2 3 4 5 6 7 | /** * Add stylesheet to front end website */ function fm_enqueue_style() { wp_enqueue_style('fm_style',plugins_url("css/bootstrap.min.css",__FILE__)); } add_action('wp_head', 'fm_enqueue_style'); |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: email friend button on product detail page, Tip and tricks, Woocommerce Email a Friend, wordpress