Easy Digital Downloads
  • Package
  • Function
  • Tree

Packages

  • EDD
    • Admin
      • Actions
      • Add-ons
      • Dashboard
      • Discounts
      • Downloads
      • Export
      • Notices
      • Pages
      • Payments
      • Reports
      • Settings
      • System
      • Upgrades
      • Upload
      • Welcome
    • Cart
    • Checkout
    • Classes
      • API
      • Fees
      • HTML
      • Roles
      • Session
    • Emails
    • Functions
      • AJAX
      • Compatibility
      • Errors
      • Formatting
      • Install
      • Login
      • Taxes
      • Templates
    • Gateways
    • Logging
    • Payments
    • Shortcodes
    • Widgets

Classes

  • EDD_Discount_Codes_Table

Functions

  • edd_activate_discount
  • edd_add_discount
  • edd_deactivate_discount
  • edd_delete_discount
  • edd_discounts_contextual_help
  • edd_discounts_page
  • edd_edit_discount
 1 <?php
 2 /**
 3  * Contextual Help
 4  *
 5  * @package     EDD
 6  * @subpackage  Admin/Discounts
 7  * @copyright   Copyright (c) 2013, Pippin Williamson
 8  * @license     http://opensource.org/licenses/gpl-2.0.php GNU Public License
 9  * @since       1.2.3
10  */
11 
12 // Exit if accessed directly
13 if ( ! defined( 'ABSPATH' ) ) exit;
14 
15 /**
16  * Adds the Contextual Help for the Discount Codes Page
17  *
18  * @since 1.3
19  * @return void
20  */
21 function edd_discounts_contextual_help() {
22     $screen = get_current_screen();
23 
24     $screen->set_help_sidebar(
25         '<p><strong>' . sprintf( __( 'For more information:', 'edd' ) . '</strong></p>' .
26         '<p>' . sprintf( __( 'Visit the <a href="%s">documentation</a> on the Easy Digital Downloads website.', 'edd' ), esc_url( 'https://easydigitaldownloads.com/documentation/' ) ) ) . '</p>' .
27         '<p>' . sprintf(
28                     __( '<a href="%s">Post an issue</a> on <a href="%s">GitHub</a>. View <a href="%s">extensions</a> or <a href="%s">themes</a>.', 'edd' ),
29                     esc_url( 'https://github.com/pippinsplugins/Easy-Digital-Downloads/issues' ),
30                     esc_url( 'https://github.com/pippinsplugins/Easy-Digital-Downloads' ),
31                     esc_url( 'https://easydigitaldownloads.com/extensions/' ),
32                     esc_url( 'https://easydigitaldownloads.com/themes/' )
33                 ) . '</p>'
34     );
35 
36     $screen->add_help_tab( array(
37         'id'        => 'edd-discount-general',
38         'title'     => __( 'General', 'edd' ),
39         'content'   =>
40             '<p>' . __( 'Discount codes allow you to offer buyers special discounts by having them enter predefined codes during checkout.', 'edd' ) . '</p>' .
41             '<p>' . __( 'Discount codes that are set to "inactive" cannot be redeemed.', 'edd' ) . '</p>' .
42             '<p>' . __( 'Discount codes are setup to only be used only one time by each customer. If a customer attempts to use a code a second time, they will be given an error.', 'edd' ) . '</p>'
43     ) );
44 
45     $screen->add_help_tab( array(
46         'id'        => 'edd-discount-add',
47         'title'     => __( 'Adding Discounts', 'edd' ),
48         'content'   =>
49             '<p>' . __( 'You can create any number of discount codes easily from this page.', 'edd' ) . '</p>' .
50             '<p>' . __( 'Discount codes have several options:', 'edd' ) . '</p>' .
51             '<ul>'.
52                 '<li>' . __( '<strong>Name</strong> - this is the name given to the discount. Used primarily for administrative purposes.', 'edd' ) . '</li>' .
53                 '<li>' . __( '<strong>Code</strong> - this is the unique code that customers will enter during checkout to redeem the code.', 'edd' ) . '</li>' .
54                 '<li>' . __( '<strong>Type</strong> - this is the type of discount this code awards.', 'edd' ) . '</li>' .
55                 '<li>' . __( '<strong>Amount</strong> - this discount amount provided by this code. For percentage based discounts, enter a number such as 70 for 70%. Do not enter a percent sign.', 'edd' ) . '</li>' .
56                 '<li>' . __( '<strong>Requirements</strong> - This allows you to select the product(s) that are required to be purchased in order for a discount to be applied.', 'edd' ) . '</li>' .
57                 '<li>' . __( '- <strong>Condition</strong> - This lets you set whether all selected products must be in the cart, or just a minimum of one.', 'edd' ) . '</li>' .
58                 '<li>' . __( '- <strong>Apply discount only to selected Downloads?</strong> - If this box is checked, only the prices of the required products will be discounted. If left unchecked, the discount will apply to all products in the cart.', 'edd' ) . '</li>' .
59                 '<li>' . __( '<strong>Start Date</strong> - this is the date that this code becomes available. If a customer attempts to redeem the code prior to this date, they will be given an error. This is optional.', 'edd' ) . '</li>' .
60                 '<li>' . __( '<strong>Expiration Date</strong> - this is the end date for the discount. After this date, the code will no longer be able to be used. This is optional.', 'edd' ) . '</li>' .
61                 '<li>' . __( '<strong>Minimum Amount</strong> - this is the minimum purchase amount required to use this code. If a customer has less than this amount in their cart, they will be given an error. This is optional.', 'edd' ) . '</li>' .
62                 '<li>' . __( '<strong>Max Uses</strong> - this is the maximum number of times this discount can be redeemed. Once this number is reached, no more customers will be allowed to use it.', 'edd' ) . '</li>' .
63             '</ul>'
64     ) );
65 
66     do_action( 'edd_discounts_contextual_help', $screen );
67 }
68 add_action( 'load-download_page_edd-discounts', 'edd_discounts_contextual_help' );
Easy Digital Downloads API documentation generated by ApiGen 2.8.0