Skip to content

Tutorial - Mini cart slide out panel #242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

yutingjiangYTJ
Copy link

@yutingjiangYTJ yutingjiangYTJ commented Apr 7, 2025

@bdenham bdenham self-assigned this Apr 8, 2025
@bdenham bdenham added the documentation Improvements or additions to documentation label Apr 8, 2025
@bdenham bdenham removed their assignment Apr 8, 2025
@bdenham bdenham self-requested a review April 8, 2025 18:12
@yutingjiangYTJ yutingjiangYTJ marked this pull request as draft April 14, 2025 18:37
### Tutorial: Implementing Mini Cart Functionality

#### Introduction
This tutroial describes how to implement a slide-out panel Mini Cart on Boilerplate. The Cart dropin provides the template and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Please keep the same grammatical structure and wording styles as shown in experience league documentation. Examples of keeping wording consistent is using "cart drop-in" instead of "Cart dropin"; etc. Below is a suggested edit:

The following tutorial describes how to enable the MiniCart in a slide-out panel on boilerplate. This cart drop-in component enables functionality to display cart items, manage quantities, and proceed to checkout.


#### Step 2: JavaScript Logic for Mini Cart

Update `commerce-mini-cart.js` with logic to initialize and manage mini cart functionality:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update commerce-mini-cart.js with the following logic to initialize and manage MiniCart functionality:

This tutroial describes how to implement a slide-out panel Mini Cart on Boilerplate. The Cart dropin provides the template and
necessary functionality to display cart items, manage quantities, and proceed to checkout.

#### Step 1: CSS Styling for Mini Cart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 1: CSS Styling for MiniCart

}
```

#### Step 3: Integrating Mini Cart with Header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Step 3: Integrating Mini Cart with Header
#### Step 3: Integrating MiniCart with Header


#### Step 3: Integrating Mini Cart with Header

Update `header.css` to integrate the mini cart panel with the header navigation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Update `header.css` to integrate the mini cart panel with the header navigation:
Update `header.css` to integrate the `MiniCart` panel with the header navigation:


#### Step 4: JavaScript Logic for Header Integration

Update `header.js` to handle mini cart interactions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Update `header.js` to handle mini cart interactions:
Update `header.js` to handle `MiniCart` interactions:

events.on('cart/initialized', updateCartCounter, { eager: true });
```

As a result of these customizations, the Mini Cart is implemented as follows:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As a result of these customizations, the Mini Cart is implemented as follows:
As a result of these customizations, the `MiniCart` is implemented as follows:

@yutingjiangYTJ
Copy link
Author

@ericeoeur Thanks for the feedback! changes updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants