This shortcode fetched data using the WooCommerce class WC_Cart. To be precise, it returns the value as per the function called and arguments used in the shortcode syntax.
Cart session data, items list, coupon details, coupon count, removed cart items information, discounts, discounts after taxes, shipping data, fees on cart, cart total, cart tax, cart weight, and other such details can be fetched and displayed using this shortcode on any shop page.
- Fetch any cart-related information to show throughout your shop or on particular page(s).
- Show cart items on the My Account or Shop page.
- Display the coupons applied on the cart on your shop page. It will help buyers compare coupon offers on the go and use the best coupon(s) on their purchases. It can improve your sales and assure a better store experience.
You may use any of the shortcodes common args with this shortcode.
[wcj_cart_function function_name=”fn1″ arg1=”value1″ arg2=”value2″]
- “fn1” needs to be replaced by the name of a function from the WC_cart as you need.
- Replace “arg1”, “arg2”, etc. with the name of attributes and specify their respective values instead of the “value1”, “value2”, etc.
[wcj_cart_function function_name=”get_cart_contents_count” before=”Cart contents count: “]
The output should display the total number of items present in the cart alongside a prefix as added to the above input. You may always visit this page to see what a function does, or to find out which function will be useful to you.
Use the [wcj_cart_tax] shortcode to display cart tax on any web page in your WooCommerce store. It calculates the total tax applicable on the buyer’s cart and displays it.
- On the checkout page at the top for highlighting the taxes.
- On the shop page or on the account page so that customers could see it without opening the cart or checkout page.
- On your single product pages if you prefer.
- On other shop or non-shop pages of your website.
Use shortcode common attributes to control visibility, prefix, or postfix of the [wcj_cart_tax] shortcode.
- [wcj_cart_tax before=”Cart tax: “]
Using the “Before” attribute should append a prefix to the Tax amount.
- [wcj_cart_tax before=”Cart tax: ” after=” is the tax amount.” location=”IN”]
This input should add a prefix and a suffix phrase to the tax amount on any page in your shop. Using the Location attribute, you may set the visibility of this shortcode’s data by country. For example, in the current context, the output will only be displayed when the user’s country is India, i.e. IN (country’s 2-letter shortcode).
[wcj_cart_tax arg1=“value1” arg_1=“value_1” … arg_n=“value_n”]
Let’s add it to a single product page’s description. (For the location India)
This shortcode displays the total tax on the current cart subtotal on the customer’s account. It can be displayed on any shop page, e.g. single, product, archive, account, etc.
Use the common Booster shortcode args to display a prefix or suffix, or to control the shortcode’s visibility by user role, WooCommemece page type, location, or WPML language.
Example Input #1:
[wcj_cart_subtotal_tax before=”Cart subtotal tax: “]
If you want to display the cart subtotal in your WooCommerce store, use the shortcode [wcj_cart_subtotal]. With it, you may use the following arguments:
- before = To add a prefix to the cart subtotal value;
Syntax: [wcj_cart_subtotal before=”Cart Subtotal: “]
Description: It will add a suffix text “is the cart subtotal.” to the shortcode’s value.
- after = To add text after the cart subtotal value;
Syntax: [wcj_cart_subtotal after=”is the cart subtotal.”]
Description: It will add a suffix text “is the cart subtotal.” to the shortcode’s value.
- visibility = To allow certain user roles (including custom roles) to see the shortcode’s value.
Syntax: [wcj_cart_subtotal visibility=”customer, administrator”]
Description: This shortcode syntax will make the cart subtotal to the user roles “customer” and “administrator” only.
- location = To show the shortcode’s value in particular countries using 2 character long country codes.
Syntax: [wcj_cart_subtotal location=”IN”]
Description: The cart subtotal will only be visible to customers in India.
- site_visibility = Set its value as “single”, “page”, or “archive” in order to make it limit its scope.
Syntax: [wcj_cart_subtotal site_visibility=”single”]
Description: The shortcode’s value will only be visible when it’s on a ‘single’ (WooCommerce Product Single) page.
- wpml_language = Add the 2-characters WPML language list or a comma-separated list for this parameter to make the cart subtotal visible for particular languages only.
Syntax: [wcj_cart_subtotal wpml_language=”EN, HI”]
Description: The shortcode’s value will only be visible to the customers with their language set as English or Hindi.
- not_wpml_language = Add the 2-characters WPML language list or a comma-separated list for this parameter to make the cart subtotal invisible for particular languages only.
Syntax: [wcj_cart_subtotal wpml_language=”EN, HI”]
Description: Customers with their language in the store as English or Hindi will not be able to view cart subtotal.
Input and Output:
Add the shipping tax’s value to any WooCommerce page using the [wcj_cart_shipping_tax] shortcode. As this value is generally included in the total tax amount, your customers cannot view it directly. However, by letting them know about shipping taxes, you will make them feel more informed and relieved about the amount they are paying for the purchase.
You may use any Booster Common Attribute (from the All Shortcodes section) with it.
- Highlight the tax on shipping fee on your checkout or cart page for extra transparency;
- Let your buyers know the total shipping fee tax on each product page as they add more products to their cart.
This shortcode displays the total shipping fee, applicable on the customer’s cart. You may add it on any of your shop (or website) pages to inform the customers how much shipping charge is applicable on the products/items that they have added to their cart at present.
- Let users see shipping fees even when they are on one of your site pages. By adding a link to get back to the shop alongside it, you may reduce the bounce rate.
- Show total shipping fee on any of your product pages.
- Display shipping fee in your desired location on the account, checkout, or cart page in your WooCommerce shop.
Let’s say a customer visits the Refund and Returns Policy page after adding a few products to the cart. It is very much probable in the case of first-time buyers. However, they may forget to complete the purchase or leave from there only.
To prevent cart abandonment, you may use a notification that displays the total shipping fee details and a link to shop page. It will clarify customers’ doubts about the shipping total and give them a quick reminder that they were about to complete the purchase.
Want to show the total cart fee for your customers in a customized manner? Use the shortcode [wcj_cart_fee_total] to do so.
As your WooCommerce may have various extra fees, e.g. packaging fee, customization fee, handling fee, etc., the total of these additional fees can be shown on any of the shop pages – alongside the details section on your cart/checkout pages – to make sure there is no confusion.
Check and use shortcodes common args (Booster – All Plugins).
- Use this shortcode on the shop or website pages to display fees applicable to the cart.
- If required, you can even print/echo this shortcode’s value by adding it to your PHP files.
Let’s say, you want to show the cart fee total on all your category pages in the shop. For this, you can edit the archive-product.php file using the Template Editor Plugin.
We added the following lines to the files for this purpose:
<div style=”background-color:green; color:white;”><b>
<?php echo do_shortcode(‘Total Fee on Cart Amount is: $0.00‘); ?>
By default, the cart or the checkout page in WooCommerce shows the cart fee taxes inclusive in each cart fee. However, to clarify how much tax is applied on cart fees, you can use the [wcj_cart_fee_tax before] shortcode.
It lets you show the tax amount, applied on the current cart fee value.
You may use attributes/parameters before, after, site_visibility, visibility, location, wpml_language, and not_wpml_language with this shortcode. See details on how to use them here.
- Show Cart Fee Tax separately to your buyers on the cart page or checkout page;
- Show cart fee tax on single product pages or archive pages.
Let’s add this content on the Cart Page:
[wcj_cart_fee_tax before=”Tax Applied on the Cart Fee: “]
This shortcode enabled store owners to display or use the Total Cart Amount (Exclusive of Taxes) on any page through the WooCommerce shop. In fact, you can also display this amount anywhere on your website too.
All the Common Attributes (all products) work for this Booster shortcode. Find more details here.
- Insert this shortcode in your template files to directly display it or to use it in further calculations.
- Add it to any of the cart pages, e.g. cart details, checkout, account, etc.
- Show this detail on your single product pages, archive pages, or website pages.
[wcj_cart_total_ex_tax before=”Cart total (excl. tax): “]
(Added on the Top of the WooCommerce Cart Page)
The Booster WooCommerce cart discount set shortcode, [wcj_cart_discount_tax] is used to display the discount being applied on the cart tax. As the tax value is added to the customer tax without any explanation of tax discount when you are using the default settings, you can use this shortcode to provide clear distinction about every tax, discount, and amount to your buyers.
All the Shortcode Common attributes (before, after, site_visibility, location, visibility, wpml_language, and not_wpml_language) can be used with this shortcode. Find related details here.
- Apply discount on cart tax and show its value to buyers;
- Use coupons, applicable on taxes, and specify the discounted tax amount to your buyer during checkout or in the cart total details.
- Show product prices inclusive of taxes, without showing the tax separately. And while applying the discount, clarify how much discount is on the base cost and how much is it on the tax value.
If your store applied a location-based discount of 12% on WooCommerce tax, the total discounted amount will be shown when you will use this shortcode.
For example, if the total cart tax is ₹15, your cart look similar to this before a discount on the tax is applied:
After the discount is applied:
(Here, the shortcode applied is: [wcj_cart_discount_tax before=”Discount tax: “])
Use this shortcode to show the total discount applied to the buyer’s cart. It will be helpful for the customer when there are multiple discounts mentioned in the calculation but he wants to view the total discount at once.
Syntax and Arg
[wcj_cart_discount_total arg1=”value1″ arg2=”value2″ …]
Where arg could be any attribute from the Booster Common Attributes List > All Plugins.
- Display cart discount total as the discount summary on your cart or checkout page.
- Show cart discount on each page of your shop, in order to encourage the buyer to checkout.
Let’s say, you want to show a display notification on the top of your cart, highlighting the amount availed by the buyer as per the cart’s current status.
[wcj_cart_discount_total before=”Congrats. Pay ” after=” Less.”]
This shortcode displays the total cart value after summing up the basic cost per product and subtracting the total discounts. It is the cart total before applying any fee or taxes.
- Display the cart total or its multiple on any shop page.
- Give special Cart Total based discounts for offline purchases or payments using this functionality.
You may use the [wcj_cart_total] shortcode with common Booster attributes from the All Plugins list on this page. Besides, you may use the following attribute to show a multiple of cart subtotal instead of the total amount itself:
multiply_by – Its default value is 1.
- [wcj_cart_total multiply_by=‘0.1’]
- [wcj_cart_total multiply_by=‘2’]
- [wcj_cart_total before=“Cart Total is ”]
On the cart page, we have added –
[wcj_cart_total before=”Cart total: “]
[wcj_cart_total before=”Show receipt and get ” after =” OFF on buying from our retail sto next time.” multiply_by=’0.1′]
The buyer’s cart, by default, shows the total quantity of items per product in the list. However, if you want to tell your customers the total number of items their cart has at present, use the shortcode [wcj_cart_items_total_quantity].
Using this shortcode, you will be able to display the total cart quantity anywhere in your shop, from the single product pages to the cart pages, and website pages.
- Show total cart quantity on your cart details page
- Show total cart quantity on the checkout page
- Display total cart quantity on all pages when you have a minimum or maximum limit on item count. It will keep reminding the buyer about the limit.
- Add a hyperlink to the cart or checkout page with the cart items total quantity value on shop or website pages. It may increase your checkout/conversion rate.
Use the following shortcode attributes as per your requirements:
- before: Add the prefix text;
- after: Add the postfix text;
- visibility: Set visibility by user role;
- location: Set visible by country code through IP detection;
- site_visibility: Show the output on particular page(s), e.g. single, page, and/or archive;
- wpml_language: Show the output for one or several WPML languages only.
- not_wpml_language: Hide the output for one or several WPML languages only.
Details description of these attributes can be found here.
[wcj_cart_items_total_quantity before=“Total items:”]
The cart details page or the checkout page, by default, do not show this information to your buyer. In fact, product/item weight is visible on the single product page > Additional Information section, implying the information is not directly invisible but on click.
However, with the [wcj_cart_items_total_weight] Booster shortcode, you can display the total cart weight to your buyers on cart details, checkout, website pages, and single product pages.
So, the buyers, before making the purchase, won’t be confused about the cart weight, even if they couldn’t see the per-item cart quantity on the single product page(s).
Use the Common Booster attributes from the list of shortcode attributes that work for All Plugins.
[wcj_cart_items_total_weight before=“Cart Weight is ”]