• Resolved aquumcreative

    (@aquumcreative)


    Hi,

    Can I adjust the Gift Card code format that is sent to recipient. Client is wanting to have “PP” at the beginning and then start the codes from “1800” and have them sent out in chronological order so that they match their POS system in store?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author pimwick

    (@pimwick)

    You can tweak the auto-generated gift card codes by following these steps:

    1. Download the wp-config.php from your FTP server.
    2. Keep a backup of wp-config.php in case there are problems.
    3. Edit wp-config.php and scroll to the end and add the following bit of code:

    Scroll towards the bottom, and before the line that says “Happy blogging.” add this code ABOVE that line (translate as needed):

    define( 'PWGC_RANDOM_CARD_NUMBER_SECTIONS', '4' );
    define( 'PWGC_RANDOM_CARD_NUMBER_SECTION_LENGTH', '4' );
    
    /* That's all, stop editing! Happy blogging. */

    4. Change the values for the settings as you see fit. We default to 4 sections that are 4 characters each.
    5. Save the wp-config.php file and re-upload it to your server.

    If you have any problems, replace wp-config.php with your backup file.

    Let me know if you have any questions!

    Plugin Author pimwick

    (@pimwick)

    Also, we do not advise chronological order because it makes it trivial for customers to “guess” numbers and start using gift cards they did not purchase.

    Thread Starter aquumcreative

    (@aquumcreative)

    Thank you for this!
    How can I add the letters “PP” to the beginning of the code?

    Plugin Author pimwick

    (@pimwick)

    We just released an update that will allow you to do this. To get the update:

    1. Log into your WordPress Admin area.
    2. Click on Plugins -> Installed plugins.
    3. Scroll down to PW WooCommerce Gift Cards and click “Check for updates.”
    4. The page will refresh, then scroll back down and click on “Update.”

    After you have upgraded to the latest version, you can add a prefix to the randomly generated card numbers by taking the following steps:

    1. Download the functions.php from your FTP server at /wp-content/themes/<your theme>/functions.php
    2. Keep a backup of functions.php in case there are problems.
    3. Edit functions.php and scroll to the very end and add this code.

    Note: if the last line is “?>” then put this code *above* that line. Otherwise, this code goes at the very end of the file:

    function custom_pw_gift_cards_random_card_number( $card_number ) {
        return 'PP' . $card_number;
    }
    add_filter( 'pw_gift_cards_random_card_number', 'custom_pw_gift_cards_random_card_number' );

    4. Save the functions.php file and re-upload it to your server.

    If you have any problems, replace functions.php with your backup file.

    Plugin Author pimwick

    (@pimwick)

    Marking this thread as resolved, let me know if you need anything else. Best of luck with your store!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Gift Card Code Format’ is closed to new replies.