In This Article:

    Storefront: Offer a discount on the storefront page

    In This Article:

      Background

      The Salsa storefront page accepts payment for merchandise (and other stuff) sold on your storefront.  There's a way to add an additional amount to the storefront (click here), but not a way to offer a discount.  This article describes a solution that offers a discount on the storefront checkout if a purchaser has the right discount code.

      2015-07-15_15-19-01.png

      Before you begin

      You'll need to gather this information before you begin:

      1. The storefront_KEY for the storefront where you'll be offering a discount.
      2. The template that will be modified.  It's usually a pretty good idea to create a copy of one of your templates for modifications like this.  Click here to find out how to make a copy.
      3. The discount code that the purchaser must type in order to get the discount.  The default value is Mountain Goat.
      4. The discount rate that the purchaser must type.  The default value is 0.15 (15%).

      Solution

      The solution is to add HTML, Javascript and CSS to the template that's used by your storefront.  The result is displayed as a line on the checkout page containing the discount code and amount. To get the discount, the purchaser must enter the correct discount code then click the Apply button.

      When the button is clicked, then the script verifies that the correct discount code has been entered. If an incorrect code is entered, then the script does not apply a discount.

      If the correct discount code is supplied, then configured discount rate against the merchandise price. The resulting discount is then displayed as a negative number. The final amount is computed as follows:

      merchadise total
      -       discount
      +       shipping
      ----------------
                 total
      

      The standard donation processing occurs after the total is computed.

      Here are some steps that you can use to install this solution:

      1. Edit the template used by the storefront.
      2. Locate the </body> tag using the browser's search tool.
      3. Insert a blank line just before the </body> tag.
      4. Click here to view the solution source.
      5. Click on the Raw button.  You'll see window open that contains the solution source.  (There's a lot of it...)
      6. Copy the contents of the window and close it.
      7. Paste the copied text into the newly inserted line in the template.
      8. Configure the solution by modifying the discount code and discount rate in the pasted text.  You'll find it right at the top. Please use the guidance in the text to configure the script.

       2015-07-15_15-36-23.png

      1. Save the template.
      2. Test!

      Questions?

      If you have any questions, please collect this information:

      • Your organization_KEY
      • Your chapter_KEY if you are in a chapter
      • The template_KEY of the modified template
      • The storefront_KEY of a storefront that uses the modified template
      • A screenshot if at all possible

      Send this information to support@salsalabs.com, and we'll be glad to help.

      Was this article helpful?
      0 out of 0 found this helpful
      Have more questions? Submit a request

      Comments

      0 comments

      Please sign in to leave a comment.