Membership 2 is an awesome plugin to sell your content. That being said, you can charge your members to see your site content.
If you want to give discount, you can use Coupon addon. You have to enable from Membership 2 > Addons and then you can create coupons and share with your users. Today I will show you a trick to share coupon embedded with URL. You can share your URl like domain.com/?coupon=XXXX and the XXXX coupon will be automatically applied on checkout.
Let’s look at the code:
You can add those codes in your functions.php in the theme, if you think your theme wonâ€™t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name ‘mu-plugins’. If there is no folder in that name, then create a folder, name it ‘mu-plugins’, create a file inside that, give any name you like and paste the code in there. You don’t need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.