Cart Drawer Shortcode: [plugincy_cart]

Shortcodes Reference
Updated Nov 8, 20263 min read

[plugincy_cart] adds a cart button that opens a slide-in drawer, where shoppers can check their cart, change quantities and go to checkout. It works in both the free plugin and Pro. You can see the drawer on the live demo.

You may not need it. If you want the cart on every page, turn on the floating cart instead. The shortcode is for when you want the drawer to open from the left, a different icon, or the cart on chosen pages only.

Quick start

[plugincy_cart drawer="right" cart_icon="cart"]

Add a Shortcode block and paste this in. There is also a Floating Cart block and Elementor widget, with Cart Icon, Drawer Position and Product Title Tag settings and a Style tab for colours.

Cart drawer opened from the WooCommerce cart button

The options

OptionWhat it doesValuesDefault
drawerThe side the drawer slides from.left, rightright
cart_iconThe button’s icon.cart, shopping-bag, basketcart
product_title_tagThe HTML tag for product names. Most people can leave this alone. It matters only for styling.h1 to h6, p, divp
positionAdds a class name, plugincy_pos_ plus your value. Any value other than fixed removes the floating position, so the button stays where you pasted it and you style it with your own CSS.Your wordEmpty

Where the button appears

By default, the button floats on the screen at the place set on the Floating Cart tab, under Top Position and Left Position. So pasting the shortcode into a header or sidebar does not put the button there, unless you use the position option above. In Pro, the floating styles load only while Enable Sticky Cart is on, so with it off the button sits where you pasted it, without the colours from that tab. The top and left options you may see in older guides are not used.

Top Position and Left Position settings for the WooCommerce cart button

Avoid two buttons

When Enable Sticky Cart is on, the plugin already adds a button to every page. The shortcode then adds a second one in the same spot. Use one or the other.

What the drawer shows

The shortcode has no options for the drawer’s contents. These come from the Floating Cart tab, as explained in the floating cart design guide.

Tips

  • Choose an icon people know. The cart icon is the safest.
  • Use the left side if your theme has its own items on the right.
  • Test on a phone, because the drawer covers much of the screen.

If something goes wrong

  • The drawer does not open: check your browser console for script errors, and turn off JavaScript delay options in your optimisation plugin.
  • The count does not update: clear your site’s cache, and exclude the cart and checkout pages from caching.
  • The wrong products show: your page cache may be serving an old copy.
  • The drawer sits behind your header: your theme’s header is on a higher layer. Go to Appearance > Customize > Additional CSS and add .cart-drawer { z-index: 999999; }.