Woo Gift Cards Lite Shortcode

Below, you’ll find a detailed guide on how to add the Woo Gift Cards Lite Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Woo Gift Cards Lite Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Woo Gift Cards Lite Plugin and the shortcodes it provides:

Plugin Icon
Ultimate Gift Cards for WooCommerce – Create, Redeem & Manage Digital Gift Certificates with Personalized Templates

"Ultimate Gift Cards for WooCommerce is a versatile plugin that allows you to create, redeem, and manage digital gift certificates. It offers customizable templates for a personalized touch."

★★★★☆ (179) Active Installs: 5000+ Tested with: 6.3.2 PHP Version: 5.6
Included Shortcodes:
  • [wps_check_your_gift_card_balance]

[wps_check_your_gift_card_balance] Shortcode

The WooGiftCards Lite plugin shortcode ‘wps_check_your_gift_card_balance’ allows users to check their gift card balance. It generates a form with two input fields: one for the recipient’s email and another for the gift card code. Upon clicking the ‘Check Balance’ button, the plugin communicates with the server to retrieve and display the remaining balance. The shortcode also includes a loading gif that appears while the balance is being fetched.

Shortcode: [wps_check_your_gift_card_balance]

Examples and Usage

Basic example – Utilizes the default shortcode to check gift card balance. This shortcode doesn’t require any parameters, it simply displays the form where users can enter their recipient email and gift card code.

[wps_check_your_gift_card_balance]

Advanced examples

Unfortunately, the provided shortcode does not accept any parameters, hence advanced examples with different parameters cannot be provided. The shortcode is designed to output a specific HTML structure for checking the balance of a gift card, and its output does not vary based on parameters. This is due to the specific functionality of the Woo-Gift-Cards-Lite plugin, which is to allow users to check their gift card balance.

However, if you’re looking for customization such as changing the labels, placeholders or button text, these would typically be handled within the plugin settings or directly in the code, rather than through shortcode parameters.

PHP Function Code

In case you have difficulties debugging what causing issues with [wps_check_your_gift_card_balance] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'wps_check_your_gift_card_balance', array( $this, 'wps_uwgc_gift_card_balance_org' ) );

Shortcode PHP function:

function wps_uwgc_gift_card_balance_org() {
		$html = '<div class="wps_gift_card_balance_wrapper">';
		// $html .= '<div><h4>Recharge Coupon Code</h4>';
		$html .= '<div class="gift_card_balance_email"><label>' . __( 'Enter Recipient Email', 'giftware' ) . '</label>	<input type="email" id="gift_card_balance_email" class="wps_gift_balance" placeholder="' . __( 'Enter Recipient Email/Name or Sender Email.', 'giftware' ) . '" required="required"></div>';
		$html .= '<div class="gift_card_code"><label>' . __( 'Enter Gift Card Code', 'giftware' ) . '</label>	<input type="text" id="gift_card_code" class="wps_gift_balance" placeholder="' . __( 'Enter Gift Card Code', 'giftware' ) . '" required="required"></div>';
		$html .= '<p class="wps_check_balance"><input class="button wps_check_balance" type="button" id="wps_check_balance" value="' . __( 'Check Balance', 'giftware' ) . '"><span id="wps_notification"></span></p></div>';
		$html .= '<div style="display: none;" class="loading-style-bg" id="wps_wgm_loader"><img src="' . WPS_WGC_URL . 'assets/images/loading.gif"></div></div>';
		return $html;
	}

Code file location:

woo-gift-cards-lite/woo-gift-cards-lite/public/class-woocommerce-gift-cards-lite-public.php

Conclusion

Now that you’ve learned how to embed the Woo Gift Cards Lite Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *