The [plugincy_cart] shortcode displays the Plugincy cart icon and cart drawer in a custom location. You can use it in a page, post, header template, sidebar, widget area, or page builder layout.
Use this shortcode when you want customers to open the cart drawer without relying only on the default theme cart icon.
Basic usage
Add the shortcode where you want the cart icon/drawer to appear:
[plugincy_cart]
This displays the cart using the default drawer and cart icon settings.
When to use this shortcode
Use [plugincy_cart] when you want to place the cart drawer trigger in a custom location.
Best use cases:
- Custom header templates
- Sidebar layouts
- Product landing pages
- Funnel pages
- Custom WooCommerce pages
- Page builder templates
- Floating cart access
- Store navigation areas
Shortcode attributes
| Attribute | Default | Accepted values | Description |
|---|---|---|---|
drawer | right | right, left, or plugin-supported drawer positions | Controls which side the cart drawer opens from |
cart_icon | cart | Plugin-supported icon values | Controls the icon used for the cart trigger |
product_title_tag | cart | HTML heading/text tag supported by the plugin | Controls the HTML tag used for product titles in the drawer |
position | Empty | CSS position value or plugin-supported position value | Controls custom cart position |
top | Empty | CSS size value | Controls top offset when custom positioning is used |
left | Empty | CSS size value | Controls left offset when custom positioning is used |
Drawer position
Use the drawer attribute to control where the cart drawer opens.
Right drawer
[plugincy_cart drawer="right"]
Use this when the cart should slide in from the right side of the screen.
Left drawer
[plugincy_cart drawer="left"]
Use this when the cart should slide in from the left side of the screen.
Recommended setup
For most stores, use:
[plugincy_cart drawer="right"]
A right-side cart drawer is familiar to most WooCommerce shoppers.
Cart icon
Use cart_icon to choose the icon displayed for the cart trigger.
[plugincy_cart cart_icon="cart"]
The available icon options may depend on your plugin version and settings.
Common cart icon styles may include:
- Cart
- Bag
- Basket
Example
[plugincy_cart drawer="right" cart_icon="cart"]
Use an icon that matches your store design and is easy for customers to recognize.
Product title tag
Use product_title_tag to control the HTML tag used for product titles inside the cart drawer.
[plugincy_cart product_title_tag="h3"]
This can help with theme styling, accessibility, and layout consistency.
Common values
h2
h3
h4
p
span
Recommendation
For most stores, use a simple tag such as:
product_title_tag="h3"
or keep the default setting if the cart drawer looks correct.
Custom position
Use position, top, and left when you need to place the cart icon in a specific location.
Example: fixed cart icon
[plugincy_cart drawer="right" cart_icon="cart" position="fixed" top="120px" left="20px"]
This can be useful when placing a floating cart trigger on a landing page.
Example: absolute position
[plugincy_cart drawer="right" position="absolute" top="10px" left="10px"]
Use this only when your page layout requires precise positioning.
Common examples
Basic cart drawer
[plugincy_cart]
Use this for the default cart icon and drawer.
Right-side cart drawer
[plugincy_cart drawer="right" cart_icon="cart"]
Use this for the standard right-side slide-in cart.
Left-side cart drawer
[plugincy_cart drawer="left" cart_icon="cart"]
Use this when your layout works better with a left-side drawer.
Cart drawer with product title tag
[plugincy_cart drawer="right" cart_icon="cart" product_title_tag="h3"]
Use this if you want product titles in the drawer to use a specific HTML tag.
Floating cart trigger
[plugincy_cart drawer="right" cart_icon="cart" position="fixed" top="120px" left="20px"]
Use this to show the cart trigger in a fixed location.
Where to place the shortcode
You can place [plugincy_cart] in any area that supports WordPress shortcodes.
WordPress block editor
- Edit a page or post.
- Add a Shortcode block.
- Paste the shortcode.
- Update the page.
Example:
[plugincy_cart drawer="right" cart_icon="cart"]
Elementor
- Edit the page with Elementor.
- Add the Shortcode widget.
- Paste the shortcode.
- Update the page.
Header builder
If your theme or page builder supports shortcodes in header templates, place the cart shortcode where you want the cart icon to appear.
Sidebar or widget area
If your theme supports shortcode widgets, add the shortcode to a sidebar or widget area.
How the cart drawer works
When the customer clicks the cart icon, the cart drawer opens and displays the current WooCommerce cart.
Depending on your plugin settings, the drawer may show:
- Product image
- Product name
- Product price
- Quantity controls
- Variation details
- Remove button
- Cart subtotal
- Discount/coupon information
- Cart total
- Checkout button
- Suggested or related products
- Empty cart message
The cart drawer updates using WooCommerce cart/session data.
Best practices
Place the cart where customers expect it
The header is usually the best location for a cart icon. Customers often look for the cart in the top-right area of a store.
Keep the icon recognizable
Use a cart, bag, or basket icon that clearly represents shopping cart access.
Test on mobile
Make sure the cart icon is easy to tap and the drawer opens correctly on mobile devices.
Avoid placing too many cart triggers
Multiple cart icons on the same page can confuse customers. Use one main cart trigger unless your layout requires more.
Exclude cart pages from cache
Cart drawer content is dynamic. Make sure your cache plugin does not cache cart/session content incorrectly.
Exclude:
Cart
Checkout
My Account
Pages with [plugincy_cart]
One-page checkout pages
Test with your theme header
Some themes have sticky headers, transparent headers, or custom z-index layers. Test the cart drawer with your active header design.
Troubleshooting
Cart icon does not appear
Check:
- Shortcode spelling is correct.
- The page/widget area supports shortcodes.
- Plugin is active.
- WooCommerce is active.
- Cache has been cleared.
- Theme/page builder is not stripping shortcodes.
Correct shortcode:
[plugincy_cart]
Cart drawer does not open
Check:
- JavaScript errors in the browser console.
- Plugin frontend scripts are loading.
- Theme scripts are not conflicting.
- Cache/minification is not delaying required scripts.
- Drawer position is valid.
- WooCommerce cart fragments/session scripts are working.
Cart count does not update
Check:
- AJAX add-to-cart is working.
- WooCommerce cart fragments are not disabled.
- Cache plugin is not caching cart fragments.
- Cart/session cookies are not blocked.
- JavaScript optimization is not delaying cart scripts.
Cart shows wrong products
This is usually a cache or session issue.
Check:
- Page cache exclusions
- CDN cache settings
- WooCommerce session cookies
- Object cache behavior
- Browser cache
- Logged-in vs guest cart testing
Drawer is hidden behind header or popup
This is usually a z-index/theme CSS issue.
Try:
- Testing with a default theme
- Disabling conflicting popups temporarily
- Checking sticky header z-index
- Adding custom CSS if needed
Positioning does not work as expected
Check:
position,top, andleftvalues are valid CSS values.- The parent container is not overriding layout.
- The page builder is not wrapping the shortcode unexpectedly.
- Mobile layout does not require separate styling.