Deposits & Partial Payments for WooCommerce Shortcode

Below, you’ll find a detailed guide on how to add the Deposits & Partial Payments for WooCommerce 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 Deposits & Partial Payments for WooCommerce Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Deposits & Partial Payments for WooCommerce Plugin and the shortcodes it provides:

Plugin Icon
Deposits & Partial Payments for WooCommerce

"Deposits & Partial Payments for WooCommerce is a handy tool for managing partial payments and deposits, enabling seamless transactions on your WooCommerce store."

★★★★★ (46) Active Installs: 3000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [awcdp_deposit]

Deposits & Partial Payments for WooCommerce [awcdp_deposit] Shortcode

The Deposits-Partial-Payments-for-WooCommerce plugin shortcode, ‘awcdp_deposit’, allows you to display a deposit container for a specific product. By using this shortcode, you can extract the product ID and return the deposit container associated with it. This is particularly useful for showcasing deposit information on product pages.

Shortcode: [awcdp_deposit]

Parameters

Here is a list of all possible awcdp_deposit shortcode parameters and attributes:

  • product_id – The specific identifier of the WooCommerce product

Examples and Usage

Basic example – Showcases the usage of the shortcode to display the deposit container for a specific product by referencing the product ID.

[awcdp_deposit product_id=25 /]
For advanced examples:

Advanced example – Illustrates the usage of the shortcode to display deposit containers for multiple products by referencing their IDs. The shortcode will try to load the deposit container for each product ID specified.

[awcdp_deposit product_id="25,30,35" /]
Please note that in the advanced example, the product IDs are separated by commas without spaces. This is to ensure that the shortcode correctly identifies each product ID. If there are spaces between the commas and the numbers, the shortcode might not work as expected.

PHP Function Code

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

Shortcode line:

add_shortcode('awcdp_deposit', array($this, 'awcdp_shortcode_deposit_function'));

Shortcode PHP function:

                    function awcdp_shortcode_deposit_function($atts){
      extract(shortcode_atts(array(
          'product_id' => '',
      ), $atts));
      return $this->awcdp_get_deposit_container($product_id);
    }
                    

Code file location:

deposits-partial-payments-for-woocommerce/deposits-partial-payments-for-woocommerce/includes/class-awcdp-front-end.php

Conclusion

Now that you’ve learned how to embed the Deposits & Partial Payments for WooCommerce 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 *