SureCart Setup
BuddyX and BuddyX Pro both ship a SureCart compatibility layer. It does four things: it puts a SureCart cart icon in the site header, it strips the theme’s own page header and sidebar off SureCart product pages so SureCart’s own layout has the full width, it assigns a no-sidebar page template to SureCart’s shop, cart, checkout and dashboard pages, and it loads a small SureCart stylesheet.
The theme does not add store features. Products, carts, checkout, payments and customer accounts all come from the SureCart plugin. What the theme adds is layout and styling around them.
What is SureCart?
Section titled “What is SureCart?”SureCart is an e-commerce plugin for WordPress. It registers its own post types for products (sc_product), collections (sc_collection) and upsells (sc_upsell), and it builds its store screens out of its own blocks, including the cart drawer and the cart menu icon.
Requirements
Section titled “Requirements”| Requirement | Notes |
|---|---|
| SureCart plugin | Must be installed and active. The theme detects it by the SURECART_PLUGIN_FILE constant. |
| BuddyX or BuddyX Pro | The integration ships in both themes. |
| WooCommerce | Must not be active if you want the SureCart cart icon in the header. See the note below. |
About WooCommerce: the header cart half of the integration only registers when WooCommerce is not active. If WooCommerce is running, the theme’s WooCommerce cart icon takes over and none of the SureCart cart code loads. Everything else (sidebar removal, page header removal, page templates, stylesheet) still applies.
Installation & Setup
Section titled “Installation & Setup”Step 1: Install SureCart
Section titled “Step 1: Install SureCart”- Go to Plugins > Add New.
- Search for “SureCart”.
- Click Install Now, then Activate.
Once SureCart is active, the theme loads its SureCart file automatically. There is nothing to switch on in the theme.
Step 2: Let SureCart create its pages
Section titled “Step 2: Let SureCart create its pages”Follow SureCart’s own onboarding so it creates and saves its shop, cart, checkout and customer dashboard pages.
Each time SureCart saves one of those four page IDs, the theme assigns its own page template to that page. The template is not the same in the two themes:
- BuddyX Pro assigns
page-templates/full-width-container.php, which appears in the Template dropdown as Page No Sidebar. It drops the sidebar and keeps the theme’s normal container width and sub header. - BuddyX (free) assigns
page-templates/full-width.php, which appears as Page Full Screen. It drops the sidebar, the container wrapper and the sub header.
The theme skips the assignment when the saved page ID is 0, when it is unchanged, or when it does not resolve to a real post.
Step 3: Switch the theme on after SureCart (or the other way round)
Section titled “Step 3: Switch the theme on after SureCart (or the other way round)”If SureCart’s pages already existed before you activated the theme, the theme catches up on activation. On the first page load after you switch to BuddyX or BuddyX Pro, it reads the four saved SureCart page IDs and applies the same full-width template to any of them that exist.
That catch-up runs once. The theme then stores a flag so it never runs again:
- BuddyX Pro: option
buddyx_pro_surecart_defaults_set - BuddyX: option
buddyx_surecart_defaults_set
Step 4: Check the header cart icon
Section titled “Step 4: Check the header cart icon”If WooCommerce is not active, the SureCart cart icon appears in the header icon group next to the search icon. It is on by default. To find the switch, go to Appearance > Customize > Site Header. See Settings below for the exact control names and defaults in each theme.
Step 5: Publish a product and look at it
Section titled “Step 5: Publish a product and look at it”Publish a SureCart product and open it on the front end. You should see:
- No theme page header and no theme breadcrumb bar
- No sidebar
- Full-width content
- No theme entry footer
That is the integration doing its job. All of it is described in Theme Features.
What You Can Do
Section titled “What You Can Do”| Task | Where it happens |
|---|---|
| Show or hide the header cart icon | Customizer, Site Header |
| Open the cart drawer | SureCart’s own cart menu icon block, rendered inside the theme’s icon |
| Give shop, cart, checkout and dashboard pages a no-sidebar layout | Automatic, on save and on theme activation |
| Change a SureCart page back to a different layout | Edit the page, change Page Attributes > Template |
| Style SureCart buy buttons with your theme colors | Automatic, via the buddyx-surecart stylesheet |
Theme Features
Section titled “Theme Features”Header cart icon
Section titled “Header cart icon”The theme’s header renders a cart icon only when a function named is_woocommerce() exists. On a SureCart-only site that function does not exist, because it belongs to WooCommerce. So the theme defines a stand-in is_woocommerce() that always returns false, on init at priority 5, and only if nothing else has defined it already.
Two things follow from that stand-in:
- The cart icon can print at all.
- The theme’s own Site Cart control appears in the Customizer, because that control is itself gated on the same function existing.
The icon itself is a theme wrapper around SureCart’s surecart/cart-menu-icon block, rendered with the shopping-cart icon and the cart menu always shown. The link href is #. Opening the cart drawer is SureCart’s block behaviour, not the theme’s, so if the drawer does not open the theme is not the thing to look at.
The wrapper markup differs between the two themes:
| Theme | Markup |
|---|---|
| BuddyX Pro | <div class="cart surecart-widget-opener"> containing an <a href="#"> |
| BuddyX | <div class="menu-icons-wrapper cart-widget-wrapper"><div class="cart"><a href="#" class="cart-icon-wrap"> |
Both links carry an aria-label of “View Shopping Cart”.
Page header and breadcrumb removal
Section titled “Page header and breadcrumb removal”On single sc_product, sc_collection and sc_upsell pages the theme removes every callback attached to its buddyx_sub_header action. That action is what renders the theme page header and breadcrumb bar, so both disappear on those three post types. SureCart products carry their own title block, so leaving the theme header in place would print the title twice.
Sidebar removal
Section titled “Sidebar removal”On the same three post types the theme filters both theme_mod_sidebar_option and theme_mod_single_post_sidebar_option to return none. none is a real value of the sidebar control, so the page renders through the theme’s normal no-sidebar path. You cannot re-enable a sidebar on SureCart singles from the Customizer; the filter always wins there.
SureCart stylesheet
Section titled “SureCart stylesheet”Both themes enqueue a dedicated stylesheet under the handle buddyx-surecart, loaded from assets/css/surecart.min.css, only when SureCart is active. In both themes it styles:
- The header cart icon: icon size, SVG size, and the position of the cart count badge
- SureCart’s outline-style buy button, so it picks up the theme’s button color tokens for text, background, border, and their hover and focus states
- The theme entry footer on single
sc_product, which it hides
BuddyX Pro’s copy carries two things the free copy does not: the rules that hide the duplicate title, featured image and breadcrumb on SureCart singles (free prints those inline instead, see below), and one dark-mode rule for the product list price.
Differences between BuddyX and BuddyX Pro
Section titled “Differences between BuddyX and BuddyX Pro”| Area | BuddyX (free) | BuddyX Pro |
|---|---|---|
| Page template assigned | page-templates/full-width.php (Page Full Screen) |
page-templates/full-width-container.php (Page No Sidebar) |
| Rules that hide the duplicate title, featured image and breadcrumb | Printed inline in wp_head at priority 999, inside a <style id="buddyx-surecart-single-styles"> block, only on SureCart single pages |
Moved into the buddyx-surecart stylesheet, scoped by body class |
| Cart icon wrapper class | cart-widget-wrapper |
surecart-widget-opener |
| Cart icon SVG size | 16px | 18px |
| Dark mode | No SureCart dark-mode rules | One rule, recoloring the product list price to the theme title color |
| Cart icon control | Two switches, both must be on (see below) | One switch |
Neither theme supplies an off-canvas cart panel for SureCart. BuddyX Pro has a cart panel stylesheet, but it only loads when WooCommerce is active, so it never loads on a SureCart-only site. The drawer you see is SureCart’s.
Settings
Section titled “Settings”There is no SureCart admin page or submenu in either theme. Everything the theme controls for SureCart lives in the Customizer.
BuddyX Pro: cart icon
Section titled “BuddyX Pro: cart icon”Location: Appearance > Customize > Site Header
| Control | Setting ID | Options | Default |
|---|---|---|---|
| Site Cart ? | site_cart |
Yes / No | Default: 1 (Yes) |
Set it to No to hide the cart icon from the header. When SureCart is active and WooCommerce is not, this same setting ID is registered twice, once by the theme’s header fields and once by the SureCart file, with the same label, section and default. The value and the behaviour are the same either way.
BuddyX: cart icon
Section titled “BuddyX: cart icon”BuddyX registers two separate switches in the same section, and the icon prints only when both are on.
Location: Appearance > Customize > Site Header
| Control | Setting ID | Options | Default |
|---|---|---|---|
| Enable Cart Icon | site_cart |
Enable / Disable | Default: 1 (Enable) |
| Enable Cart Icon? | site_header_enable_cart |
Yes / No | Default: 1 (Yes) |
The first switch decides whether the header renders a cart icon at all. The second is added by the SureCart file and is checked inside the render function. If your cart icon has vanished in BuddyX, check both.
Sidebar layout
Section titled “Sidebar layout”Location: Appearance > Customize > Site Sidebar
| Control | Setting ID | Options | Default |
|---|---|---|---|
| Default Sidebar Layout (Pro) / Sidebar Layout (free) | sidebar_option |
None / Left / Right / Both | Default: right |
The single-post sidebar control sits in a different place, and carries a different default, in each theme.
BuddyX Pro location: Appearance > Customize > Single Post
| Control | Setting ID | Options | Default |
|---|---|---|---|
| Sidebar layout | single_post_sidebar_option |
None / Left / Right / Both | Default: whatever sidebar_option is set to, so right out of the box |
BuddyX location: Appearance > Customize > Site Sidebar
| Control | Setting ID | Options | Default |
|---|---|---|---|
| Single Post Sidebar Layout | single_post_sidebar_option |
None / Left / Right / Both | Default: none |
Both of these are overridden to none while you are viewing a SureCart product, collection or upsell. Your saved values still apply everywhere else on the site.
Page template on SureCart pages
Section titled “Page template on SureCart pages”Location: edit the page, then Page Attributes > Template
| Page | Template the theme assigns |
|---|---|
| Shop | Page No Sidebar in Pro (full-width-container.php), Page Full Screen in free (full-width.php) |
| Cart | Same |
| Checkout | Same |
| Customer dashboard | Same |
You can change the template by hand at any time. The theme only writes it when the SureCart page ID option changes, or once on theme activation, so a manual choice you make afterwards stays.
Use Cases
Section titled “Use Cases”A course site selling one flagship course
Section titled “A course site selling one flagship course”You run a course site and sell access through SureCart. The product page is the sales page, and it needs the whole width for SureCart’s pricing, testimonial and buy-button blocks. The theme takes the page header, breadcrumb and sidebar off that page automatically, so you build the sales page entirely out of SureCart and theme blocks without fighting a sidebar column. The buy button picks up your theme button colors, so the call to action matches the rest of the site without extra CSS.
A paid community charging for membership
Section titled “A paid community charging for membership”Your site is a BuddyPress community and SureCart handles the paid tier. Members are logged in and moving between activity, groups and the store, so the cart needs to be reachable from every screen. Leave the Site Cart switch on and the cart icon sits in the header icon group beside search on every page, community screens included. Checkout gets the no-sidebar template automatically, which keeps the payment screen free of sidebar widgets.
A creator selling downloads next to a blog
Section titled “A creator selling downloads next to a blog”You publish articles with a right sidebar and also sell a few digital products. You do not want to change your global sidebar setting to sell things. You do not have to: the global sidebar_option stays at right for posts and pages, and only the SureCart product, collection and upsell screens drop to no sidebar. One setting, two behaviours, no per-page work.
A store with collection landing pages
Section titled “A store with collection landing pages”You group products into SureCart collections and send campaign traffic to them. Collection pages get the same treatment as products: no theme page header, no breadcrumb, no sidebar, full width. That gives a campaign landing page the clean top of page it needs, while the rest of your site keeps its normal header and breadcrumbs.
For Developers
Section titled “For Developers”Load path and bootstrap
Section titled “Load path and bootstrap”The SureCart file is required only when SURECART_PLUGIN_FILE is defined. BuddyX Pro requires it directly from functions.php; BuddyX requires it from its plugin-compatibility loader. The file also guards itself and returns early if the constant is missing.
| Theme | Class | Bootstrap function | Hook |
|---|---|---|---|
| BuddyX Pro | BuddyX_Pro_SureCart_Support |
buddyx_pro_surecart() |
add_action( 'init', 'buddyx_pro_surecart', 0 ) |
| BuddyX | BuddyX_SureCart_Support |
buddyx_surecart() |
add_action( 'init', 'buddyx_surecart', 0 ) |
Both are singletons via ::instance().
File paths:
inc/compatibility/surecart/surecart-functions.phpassets/css/src/surecart.css(source),assets/css/surecart.min.css(built)
Hooks the integration touches
Section titled “Hooks the integration touches”| Hook | What the integration does |
|---|---|
wp |
Runs the single-page setup on sc_product, sc_collection, sc_upsell |
buddyx_sub_header |
remove_all_actions() on those three post types |
theme_mod_sidebar_option |
Filtered to none on those three post types |
theme_mod_single_post_sidebar_option |
Filtered to none on those three post types |
update_option_surecart_shop_page_id |
Writes _wp_page_template on the new page |
update_option_surecart_checkout_page_id |
Same |
update_option_surecart_cart_page_id |
Same |
update_option_surecart_dashboard_page_id |
Same |
after_switch_theme |
One-time retrofit of the template onto existing SureCart pages |
init priority 5 |
Defines the is_woocommerce() and buddyx_render_cart_icon() fallbacks (only when WooCommerce is not active) |
init priority 20 |
Registers the cart Customizer switch (only when WooCommerce is not active) |
Overriding the cart icon
Section titled “Overriding the cart icon”buddyx_render_cart_icon() is defined by the SureCart file only if no other copy exists. Declare your own before init priority 5 and yours wins. The same applies to the is_woocommerce() stand-in, and WooCommerce’s own copy of buddyx_render_cart_icon() wins when WooCommerce is active.
To force the icon off in code, filter the theme mod:
add_filter( 'theme_mod_site_cart', '__return_false' );In BuddyX the SureCart render function reads a second value, so filter that one too:
add_filter( 'theme_mod_site_header_enable_cart', '__return_false' );Stylesheet
Section titled “Stylesheet”The handle is buddyx-surecart in both themes.
- BuddyX enqueues it directly, gated on
defined( 'SURECART_PLUGIN_FILE' ). - BuddyX Pro registers it as an entry in the asset manifest in
inc/Styles/Component.php, with apreload_callbackthat returnsdefined( 'SURECART_PLUGIN_FILE' ). The manifest is filterable throughbuddyxpro_css_files.
To drop it entirely:
add_action( 'wp_enqueue_scripts', function () { wp_dequeue_style( 'buddyx-surecart' );}, 20 );Selectors worth knowing
Section titled “Selectors worth knowing”| Selector | Where it comes from |
|---|---|
.surecart-widget-opener |
BuddyX Pro cart icon wrapper |
.cart-widget-wrapper, .cart-icon-wrap |
BuddyX cart icon wrapper and link |
.single-sc_product, .single-sc_collection, .single-sc_upsell |
Body classes the hide rules are scoped to |
.dark-mode .wp-block-surecart-product-list-price |
BuddyX Pro only, dark-mode price color |
#buddyx-surecart-single-styles |
BuddyX only, the inline wp_head style block on SureCart singles |
Options written
Section titled “Options written”buddyx_pro_surecart_defaults_set (Pro) and buddyx_surecart_defaults_set (free) are the one-time activation flags. Delete the flag to make the activation retrofit run again on the next request after a theme switch.
Known dead code
Section titled “Known dead code”buddyx_pro_surecart_prevent_entry_header() and buddyx_surecart_prevent_entry_header() are attached to a filter named get_post_type. WordPress core has no such filter, so the callbacks never run. Nothing depends on them: single.php loads the entry-header template part only when the post type is literally post, so a SureCart product never renders the theme entry header in the first place.
buddyx_pro_surecart_add_cart_styles() and buddyx_surecart_add_cart_styles() are hooked to wp_footer but output nothing. Their bodies contain only the enabled check.
Troubleshooting
Section titled “Troubleshooting”The cart icon is missing from the header
Section titled “The cart icon is missing from the header”- Confirm WooCommerce is not active. If it is, the theme uses the WooCommerce cart icon and the SureCart cart code never registers.
- Confirm SureCart is active.
- In BuddyX Pro: Appearance > Customize > Site Header, set Site Cart ? to Yes.
- In BuddyX: same section, set both Enable Cart Icon and Enable Cart Icon? to on.
- Clear any page cache and reload.
The cart icon shows but clicking it does nothing
Section titled “The cart icon shows but clicking it does nothing”The theme’s link points at #. What opens the drawer is SureCart’s own cart menu icon block, rendered inside that link. Check that SureCart’s front-end scripts are loading and look for JavaScript errors in the browser console. This is a plugin-side behaviour, not a theme setting.
A product page still shows the title twice
Section titled “A product page still shows the title twice”The rules that hide the theme’s duplicate title, featured image and breadcrumb are scoped to the single-sc_product, single-sc_collection and single-sc_upsell body classes. Confirm the page really is one of those three post types, then confirm the buddyx-surecart stylesheet is loading (BuddyX Pro) or that the buddyx-surecart-single-styles block is present in the page source (BuddyX). A plugin that dequeues theme styles will take these rules with it.
I want a sidebar on product pages
Section titled “I want a sidebar on product pages”You cannot get one from the Customizer. The theme forces the sidebar option to none on SureCart singles through the theme_mod_sidebar_option and theme_mod_single_post_sidebar_option filters. Removing that behaviour means unhooking those filters from the integration class in a child theme.
The shop or checkout page still shows a sidebar
Section titled “The shop or checkout page still shows a sidebar”The template is written when the SureCart page ID option changes, and once when you activate the theme. If you set up SureCart pages before installing the theme and the activation retrofit already ran, or if someone changed the template by hand later, set it yourself:
- Edit the page.
- Open Page Attributes.
- Set Template to Page No Sidebar (BuddyX Pro) or Page Full Screen (BuddyX).
- Update the page.
Note that BuddyX Pro’s Page No Sidebar keeps the theme’s container width and sub header on these four pages. Only the sc_product, sc_collection and sc_upsell single views get the sub header removed. If you want the shop or checkout page edge to edge as well, pick a wider template by hand.
The page header and breadcrumb are gone on products
Section titled “The page header and breadcrumb are gone on products”That is intended. The theme removes every callback on buddyx_sub_header for SureCart product, collection and upsell pages so SureCart’s own title block is not duplicated.
Related Settings
Section titled “Related Settings”- Header Elements - the header icon group the cart icon sits in
- Sidebar Layouts - the sidebar options the integration overrides
- Site Layout - page templates and content width
Got a question? We are a friendly team and happy to help.
- Visit our Documentation Portal
- Email us at support@wbcomdesigns.com

