Skip to content

Commit a4a9bfa

Browse files
Changes from Dhub (#59)
* Changes from Dhub * Removed empty asset --------- Co-authored-by: dhub-sync[bot] <145223974+dhub-sync[bot]@users.noreply.github.com> Co-authored-by: J2Commerce <olivier@j2commerce.com>
1 parent 262e0a8 commit a4a9bfa

37 files changed

Lines changed: 382 additions & 414 deletions

website/docs-v6/apps-and-extensions/apps/j2commerce_advancedcart.md renamed to website/docs-v6/apps-and-extensions/j2commerce_advancedcart.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,21 @@ The plugin works in tandem with the companion **Advanced Cart Toggle** module, w
2828

2929
You can install this **Advanced Cart** App using the Joomla installer. The following steps help you with a successful installation.
3030

31+
:::info
32+
33+
**IMPORTANT**: You will also have to install the **Advanced Cart Toggle** module that came with the package. Once installed, the **Advanced Cart Toggle** will enable itself automatically
34+
35+
:::
36+
3137
In the Joomla admin, go to **System -> Install -> Extensions**
3238

3339
Upload the plugin file or use the Install from URL option.
3440

3541
![Install extensions](<../../../assets/app install1 (1) (1).webp>)
3642

37-
## Enable the App
43+
## Enable the Plugin
3844

39-
Once you have installed the App, you will need to enable it. There are **two** ways you can access the extension.&#x20;
45+
Once you have installed the plugin, you will need to enable it. There are **two** ways you can access the extension.&#x20;
4046

4147
**Option A:** Go to the **J2Commerce** icon at the top right corner **-> Apps**
4248

@@ -60,7 +66,7 @@ Select **Advanced Cart Toggle** from the module type list.
6066

6167
![](/img/advanced-cart-modules1.webp)
6268

63-
Give it a title and assign it to a **module position** in your template (such as a header or navigation position). The most common position is in the upper right corner but every template is different
69+
Give it a **Title** and assign it to a **module position** in your template (such as a header or navigation position). The most common position is in the upper right corner but every template is different
6470

6571
![](/img/advanced-cart-modules2.webp)
6672

@@ -222,10 +228,24 @@ Go to **Content** -> **Site Modules**, find the **Advanced Cart Toggle** module
222228

223229
**Display Mode:** Whether to show a font icon or a custom image.
224230

225-
**Icon Class:** Font Awesome or custom CSS class for the cart icon. Only visible when Display Mode is set to **Icon**.
231+
**Icon Class:** Font Awesome or custom CSS class for the cart icon. Only visible when Display Mode is set to **Icon**. The **Icon Class** field accepts any CSS class string your site's template already loads. Common choices: Below are the **Icon Library** and the **Example Class**
232+
233+
![](/img/advanced-toggle-icon.webp)
234+
235+
- **Font Awesome 6 Free:** `fa-solid fa-cart-shopping`
236+
237+
- **Font Awesome 6 Free:** `fa-solid fa-bag-shopping`
238+
239+
- **Font Awesome 6 Free:** `fa-solid fa-basket-shopping`
240+
241+
- **Bootstrap Icons:** `bi bi-cart3`
242+
243+
If your template does not load an icon library automatically, you may need to add one or use **Image** mode instead.
226244

227245
**Cart Image:** Image to display when Display Mode is set to **Image**. Selected using the Joomla media picker.
228246

247+
![](/img/advanced-toggle-image-1.webp)
248+
229249
**Count Type:** Controls what number appears in the badge. **Sum Quantities** adds up the total quantity of all items (e.g., 3 units of one product + 2 of another = 5). **Line Items** counts the number of distinct product lines in the cart. Sum all item quantities, or count the number of distinct line items.
230250

231251
**Hide Badge When Empty:** Hides the count badge entirely when the cart is empty instead of showing a zero.
@@ -244,6 +264,10 @@ Go to **Content** -> **Site Modules**, find the **Advanced Cart Toggle** module
244264

245265
## How It Works
246266

267+
When the page loads, the module queries the current visitor's cart on the server and renders the badge with the live item count. After the page loads, the Advanced Cart Drawer plugin takes over: any time the cart changes (add, remove, quantity update), the plugin dispatches a browser event that updates all elements with the class `j2commerce-cart-badge` — including the badge from this module — instantly, with no page reload.
268+
269+
Clicking the button calls `AdvancedCart.open()`, which slides the cart drawer into view.
270+
247271
### Drawer Lifecycle
248272

249273
**When a page loads:**
@@ -278,6 +302,12 @@ All quantity changes made inside the drawer are debounced by 300ms and sent to t
278302

279303
The coupon and voucher fields are collapsed behind toggle links by default. Once a customer clicks "Have a coupon?" or "Have a voucher?", the form expands inline. Applied discounts are shown immediately after the item list and reflected in the totals.
280304

305+
## Placing the Button in a Navbar
306+
307+
Most templates expose a module position inside the navbar — commonly named `nav-right`, `header-right`, `navbar-search`, or similar. Assign the module to that position with **Show Title** set to **Hide** for a clean icon-only button.
308+
309+
If your template does not have a suitable built-in position, you can load the module inline using the `{loadmodule}` content plugin syntax in a Custom HTML module, or ask your template developer to expose an appropriate position.
310+
281311
## Template Overrides
282312

283313
The drawer uses two PHP layout files:

website/docs-v6/apps-and-extensions/modules/mod_j2commerce_advancedcart_toggle.md

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)