General notes

With YITH WooCommerce Share for Discounts, you can allow the sharing of the contents of your shop on social networks via Facebook, Twitter and Google+, or via email. In order to do that, you just have to activate the related options you can find in the settings panel of the plugin.


In order to let the plugin work fine, it is essential to enable coupons in the WooCommerce settings panel.


The product sharing generates a coupon which value depends on how configurated in the “Coupon settings” tab of the plugin settings dashboard.



You can share the same product more than once only after 24 hours have passed.

Configure Facebook application

Recently, Facebook has updated the Terms of the platform and is now considering the issuing of a coupon code in exchange of a sharing as a breach of their Terms (read here for more details). Consequently, you might receive an email from Facebook regarding your Facebook app block. Moreover, as Facebook constantly applies changes to their API, the plugin might not work after one of these changes. As long as we can, we will keep supporting the plugin, but please, consider what we have just stated above as a possibility. If you want to use Facebook sharing anyway, please, add this line in the functions.php file of your theme:

add_filter('ywsfd_enable_facebook_anyway', '__return_true');

Regarding Facebook, you need to add the “App ID” code that you can obtain creating a new application on Facebook developers. Login with your account and click on the Add new app entry.


Fill in the form with the required information.


If the creation of the application was successful you will be redirected to a page like the one shown in the following image.


Now click on “Settings” (that you find in the side menu of the page) and fill in the “Namespace” field with a name to identify the application.


Then click on “Add Platform”, select “Website” and insert your site URL.



Go to the “App Review” section and ensure the application is public.


The last step is to copy the APP ID and paste it within the plugin settings dashboard.

Configure twitter application

In order to share via Twitter, it is essential to configure a new application for the required parameters in the plugin settings dashboard.


Go to and click on the “Create new app” button.


Complete the required fields and insert in “Callback url” one of the two options suggested in YITH Plugins -> Share for Discounts -> Settings -> Twitter



After creating the application, go to the “Keys and Access Tokens” section to recover the required parameters, that is “Twitter Consumer Key” and “Twitter Consumer Secret”.
Copy and paste them in the related options of the plugin.



As last step click on the “Create my access token” button that you find at the bottom of “Keys and Access Tokens” Twitter section.


If the process ended well, now your users could start sharing your contents via Twitter in order to get the discount you provided.



Configure LinkedIn application

To enable the content sharing through LinkedIn, it is essential to create a LinkedIn application and recover the parameters required by the plugin.


Log in to and click on the “Create application” button.


Fill in the required fields of the form.


Now copy “Client ID” and “Client Secret” associated with the application and paste them in the plugin settings dashboard.


Now you can apply the sharing via LinkedIn.


Email sharing

To enable the sharing via email, you just have to enable the option in the plugin settings and whenever users click on the email sharing button, they will get a form where they can enter the sender and receiver email addresses and a custom message. 

The receiver will get a message with a link to the page you’ve shared.


Coupon settings

The plugin automatically generates a coupon when a product is shared. The user could use the coupon by adding it to the cart.
The amount and modality about the use of the generated coupon depend on the configuration settings, in Share for Discounts -> Coupon Settings, after the coupon sharing.


The coupon can be applied to the shared product or to the cart.
Generically, the coupons are cumulative only if applied on the product and the user doesn’t share the same product on the same day.
Once shared, the product could no longer be selected again within the same day.The user will find the coupon automatically applied in “cart” and “checkout” pages.


Each generated coupon from a sharing is identified by a name that includes the username- label followed by year, month, day, hour, minute and second of the content shared.


If you want to automatically remove all the expired coupons generated by the plugin, enable “Expired Coupon Clearing”.
The removal can be also done manually through the “Remove expired coupons” button.


Sharing pages

The sharing buttons can be shown on the product page and in “Cart” and “Checkout” pages.
Go to “Share for Discounts -> Sharing Settings” to enable or not the addition and to choose in what spot of the page you want to insert the buttons.


Here, in the Sharing settings section, you can also enable the option Add to cart after sharing which allows applying the coupon automatically once shared the related product.




The sharing URL will be the same as the one of the current page unless you inserted a specific URL in “URL to share”.


Any page of the site can be shared if you have inserted the [ywsfd_shortcode] shortcode in the page.

On-sale products

By default the discounted products can’t be shared. However, if you want to offer a discount coupon also for these products, you can do it by enabling “Enable on on-sale products”.


Facebook OpenGraph

For a correct sharing of the contents on Facebook, you necessarily need to set the Open Graph tags.
Otherwise, a wrong content could be possibly shared.

To avoid this issue, set the defaut contents in the “Facebook OpenGraph Meta Defaults” section and they will be automatically shared in case of any issue about the Open Graphs associated to the page.



The plugin is ready to use with the new Gutenberg editor. When you add a new post or page, you will be able to find our YITH shortcodes and widgets. With a simple click they will be added to your page.

Share for discount gutenberg