Title: cashback shorcode
Last modified: October 3, 2021

---

# cashback shorcode

 *  Resolved [kiaee](https://wordpress.org/support/users/kiaee/)
 * (@kiaee)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/cashback-shorcode/)
 * Hello and thanks for your good plugin
    I want the shortcode so that I can display
   the cashback for each product on a page that is not shop page
 * please help me
    thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcashback-shorcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [arafat24bd](https://wordpress.org/support/users/arafat24bd/)
 * (@arafat24bd)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cashback-shorcode/#post-15090456)
 * I want also to display cashback amount on single product page as short-code (
   I am using elementor for product page)
 *  Plugin Author [Subrata Mal](https://wordpress.org/support/users/subratamal/)
 * (@subratamal)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/cashback-shorcode/#post-15147910)
 * [@arafat24bd](https://wordpress.org/support/users/arafat24bd/) Please use the
   bellow attached code in the theme function.php file for the shortcode `terawallet-
   cashback`.
 *     ```
       add_shortcode('terawallet-cashback', 'terawallet_cashback_callback');
       function terawallet_cashback_callback() {
           $product = wc_get_product(get_the_ID());
           if ($product->has_child()) {
               $product = wc_get_product(current($product->get_children()));
           }
           $cashback_amount = 0;
           if ('product' === woo_wallet()->settings_api->get_option('cashback_rule', '_wallet_settings_credit', 'cart')) {
               $cashback_amount = woo_wallet()->cashback->get_product_cashback_amount($product);
           } else if ('product_cat' === woo_wallet()->settings_api->get_option('cashback_rule', '_wallet_settings_credit', 'cart')) {
               $cashback_amount = woo_wallet()->cashback->get_product_category_wise_cashback_amount($product);
           }
           $cashback_amount = apply_filters('woo_wallet_product_cashback_amount', $cashback_amount, get_the_ID());
           ob_start();
           if ($cashback_amount) {
               echo '<span class="on-woo-wallet-cashback">' . wc_price($cashback_amount, woo_wallet_wc_price_args()) . __(' Cashback', 'woo-wallet') . '</span>';
           } else {
               echo '<span class="on-woo-wallet-cashback" style="display:none;"></span>';
           }
           return ob_get_clean();
       }
       ```
   
 *  [rajiv98116](https://wordpress.org/support/users/rajiv98116/)
 * (@rajiv98116)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/cashback-shorcode/#post-15382780)
 * Not working for me… 😢

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘cashback shorcode’ is closed to new replies.

 * ![](https://ps.w.org/woo-wallet/assets/icon-256x256.png?rev=3360666)
 * [Wallet for WooCommerce](https://wordpress.org/plugins/woo-wallet/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-wallet/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-wallet/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-wallet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-wallet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-wallet/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 3 replies
 * 4 participants
 * Last reply from: [rajiv98116](https://wordpress.org/support/users/rajiv98116/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/cashback-shorcode/#post-15382780)
 * Status: resolved