Use this article for the Advanced card on the Smart Cart's Global Settings screen, which holds the settings that connect the Smart Cart to your theme and to your own code. Find it in your Rebuy admin under Smart Carts, your cart, the Global Settings gear at the bottom of the Cart Editor sidebar, then the Advanced card.
The Advanced card is where the theme selectors, cart attribution tracking, the Custom CSS box, the event callbacks, and the custom template toggle live. The cart page behavior, the product form submission behavior, and the cart's schedule sit in other cards on the same screen and are covered in Smart Cart: Global Settings.
Open the Advanced card
The Advanced card is a section of the Global Settings screen inside the Cart Editor, not a separate page in the Rebuy admin.
Go to Smart Carts in your Rebuy admin.
Click the cart you want to configure to open the Cart Editor.
At the bottom of the editor sidebar, click Global Settings (the gear icon).
Expand the Advanced card.
The screen has no Save button of its own. Changes in the Advanced card are saved with the editor's Save button, the same as any component change.
Keep your theme's cart count and subtotal in sync
Theme Selectors tell the Smart Cart which elements in your theme display the cart item count and the cart subtotal, so it can update them whenever the cart changes. They are in the Advanced card of the Smart Cart's Global Settings screen.
Item Count defaults to
.cart-count. This is the element that shows the number of items in the cart, usually the badge on the cart icon.Cart Subtotal defaults to
.cart-subtotal. This is the element that shows the cart subtotal.
Most themes use those class names, which is why they are the defaults. If your cart icon badge or header subtotal stops updating when a shopper adds an item, your theme uses different names. Inspect the element in your browser, copy its class or ID, and paste that selector into the matching field here.
Cart Attribution Tracking
Cart Attribution Tracking decides whether the Smart Cart writes its own attribution data onto the Shopify cart. It is in the Advanced card of the Smart Cart's Global Settings screen and is on by default.
With it on, the Smart Cart writes _attribution and _source cart attributes when the cart mounts. Rebuy reads those to report on Smart Cart performance and engagement.
Turning it off stops those attributes being written, and you lose Smart Cart performance and engagement metrics from that point on. The usual reason to turn it off is that a store's shipping labels or packing slips print cart attributes and the merchant wants them gone.
Add custom CSS to the Smart Cart
The Custom CSS box in the Advanced card of the Smart Cart's Global Settings screen holds styling that is injected into the Smart Cart. Anything you paste here applies to this cart only, not to your Rebuy widgets and not to the rest of your theme.
Write plain CSS with no <style> tags. Test on an unpublished cart before you put styling on a live one, since a selector that matches more than you intended can hide part of the cart.
Note: For the verified selectors that target each part of the Smart Cart, along with worked examples, see the Smart Cart CSS Customization Guide. That guide is the source for selectors; this box is where the CSS goes.
Run your own JavaScript with event callbacks
The Event Callbacks section in the Advanced card of the Smart Cart's Global Settings screen lets you run JavaScript at specific points in the Smart Cart's lifecycle without touching your theme code. Each callback has a checkbox, and checking it opens a JavaScript editor underneath.
Code you write here is scoped to this Smart Cart. Rebuy also dispatches DOM events such as rebuy:cart.change that theme code can listen for, and those are documented separately in Rebuy's developer documentation for Smart Cart events.
The table below lists every callback, when it runs, and the arguments your function receives.
Callback | Runs when | Arguments |
Init | The Smart Cart is initialized |
|
Ready | The Smart Cart has finished setting up and is ready to be shown |
|
Show | The Smart Cart is opened |
|
Hide | The Smart Cart is closed |
|
LineItemIncrease | A line item's quantity is increased |
|
LineItemDecrease | A line item's quantity is decreased |
|
LineItemRemoved | A line item is removed from the cart |
|
The smartcart argument is the Smart Cart instance. The item argument on the line item callbacks is the cart item that changed.
To add code to a callback:
Expand the Advanced card and scroll to Event Callbacks.
Check the box for the callback you want.
Type or paste your JavaScript into the editor that appears. If you want a working starting point, click Fill with example code while the editor is empty and Rebuy writes a sample function into it.
Click Save in the editor toolbar.
Load your storefront and confirm the code runs. The example code logs to the browser console, so you can watch for it there while you test.
Unchecking a callback stops it running without deleting what you wrote, so you can turn a callback off while you troubleshoot and turn it back on afterward.
Note: Decreasing a line item's quantity from 1 to 0 removes the item, so that one shopper action runs the LineItemDecrease callback and the LineItemRemoved callback. Write your handlers so that running each of them is safe.
Enable Custom Template
Enable Custom Template replaces the markup for the entire Smart Cart with HTML you write. It is the last setting in the Advanced card of the Smart Cart's Global Settings screen and is off by default.
Turning it on saves the cart immediately and covers the Cart Editor with a Custom Template Active notice. While it is on, components cannot be dragged, hidden, deleted, or reconfigured, because you now own the markup rather than the editor. Rebuy cannot guarantee that a custom template keeps working with future Smart Cart releases, so check it after each release.
To get the drag-and-drop editor back, click Revert to Default on that notice. Your custom template is kept rather than deleted, so you can turn it back on later. For the markup itself, see Smart Cart Custom Templates.
Rebuy support policy for advanced settings
Rebuy Support covers the settings on the Advanced card that ship as part of the standard Rebuy package, and does not cover the code you put into it. Theme Selectors and Cart Attribution Tracking are standard settings, so Support will help you configure and troubleshoot them. The Custom CSS box, the Event Callbacks editors, and Enable Custom Template hold code that you or your developer write, and Rebuy Support does not write, review, or troubleshoot that code, even though those boxes live in the Rebuy admin.
That distinction decides where troubleshooting starts. If a Smart Cart carrying custom code starts behaving unexpectedly, empty the Custom CSS box, uncheck every event callback, turn Enable Custom Template off, and confirm the cart works on its defaults before you open a ticket. A cart running Rebuy's own markup and styling is the version Support can reproduce. Unchecking a callback keeps the code you wrote, so you lose nothing by testing this way.
When you want behavior the settings do not offer, the first route is your own developer. Rebuy's AI Integration Guide is written to be fed into an AI coding tool, and the Smart Cart event listener reference documents what the cart exposes, so a developer can build against them without Rebuy Support.
Support policy. Rebuy support covers everything directly associated with Rebuy's standard package. It does not cover third-party plugins or customizations beyond Rebuy's scope, and the unsupported list includes custom template modifications and troubleshooting, headless configurations and troubleshooting, native cart configurations and troubleshooting, custom CSS and JavaScript, custom scripts, and third-party integrations. The full terms are on Rebuy's support policy page.
Get matched with the right Service Partner
If you do not have a developer, Rebuy's partner team can connect you with an accredited expert for work that falls outside support scope.
Browse the Rebuy partner directory, or book a free matchmaking consultation and Rebuy will introduce you to a partner.
Frequently asked questions
If I turn off Cart Attribution Tracking, do my Shopify Functions discounts stop working?
No, turning off Cart Attribution Tracking does not break Shopify Functions discounts. Rebuy's discount functions do not depend on the Smart Cart's cart attributes being present. Some other attributes, such as _barId, are written by specific functions rather than by attribution tracking, so those can still appear on shipping labels and packing slips after you turn this setting off. What you do lose is Smart Cart performance and engagement reporting from that point forward.
Where do I add custom CSS for the Smart Cart?
Custom CSS for the Smart Cart goes in the Advanced card of the Global Settings screen. Open Smart Carts, click your cart, click the Global Settings gear at the bottom of the sidebar, expand Advanced, and paste your CSS into the Custom CSS box. For the selectors that target each part of the cart, see the Smart Cart CSS Customization Guide.
How do I replace the Smart Cart's close icon with my own SVG?
Replacing the close icon takes JavaScript, because there is no setting for it. Add code to the Ready callback in the Advanced card under Event Callbacks that finds the close button in the cart and replaces its inner contents with your own SVG markup. This is custom development work and falls outside Rebuy Support's scope, so test it on an unpublished cart first.
Is there an event callback for when a discount code is applied?
No, there is no event callback or dedicated event for a discount code being applied. Listen for the rebuy:cart.change DOM event instead, and read Rebuy.SmartCart.discountEnabled() and Rebuy.SmartCart.getCalculatedCartDiscount() inside your handler to see the current discount state.
Which event should I use so the Smart Cart updates after my theme's own AJAX add to cart, and how do I refresh it manually?
The Smart Cart reacts to the rebuy:cart.change DOM event, so dispatch that from your theme's add-to-cart handler and the cart updates. To refresh the cart data yourself, call Rebuy.Cart.fetchCart(). There is no Rebuy.Cart.refresh() method.





