Skip to content

Commit ba97525

Browse files
authored
Grammar and styleguide
1 parent 1af665c commit ba97525

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

Diff for: commerce-add-ons/packages/cart/configuration.md

+25-25
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ description: Learn how to configure the Umbraco Commerce Cart package.
44

55
# Configuration
66

7-
The Cart package is configured using a JavaScript, CSS and data attributes based API.
7+
The Cart package is configured using a JavaScript, CSS, and data attributes-based API.
88

99
## Initialization
1010

11-
Before adding items to a cart, it is required the the Cart package is first initialized with some default settings. This is done using the `UCC.init` global function which should be executed after the `umbraco-commerce-cart.js` file is loaded.
11+
Before adding items to a cart, it is required that the Cart package is initialized with some default settings. This is done using the `UCC.init` global function which should be executed after the `umbraco-commerce-cart.js` file is loaded.
1212

1313
```javascript
1414
<script src="/App_Plugins/UmbracoCommerceCart/umbraco-commerce-cart.js" defer></script>
@@ -23,23 +23,23 @@ Before adding items to a cart, it is required the the Cart package is first init
2323
</script>
2424
```
2525

26-
The core intialization settings are:
26+
The core initialization settings are shown in the table below.
2727

2828
| Key | Description |
2929
| -- | -- |
3030
| `store` | The ID or alias of the store the cart should be associated with. |
3131
| `checkoutUrl` | The URL of the checkout page the cart should redirect to on checkout. |
32-
| `showPricesIncludingTax` | Define whether to show prices inclusive of exclusive of sales TAX. Defaults to `false`. |
32+
| `showPricesIncludingTax` | Define whether to show prices inclusive or exclusive of sales tax. Defaults to `false`. |
3333

3434
Calling the `init` method will also automatically bind any UI elements configured using the following APIs.
3535

3636
## UI Elements
3737

3838
### Add to Cart Buttons
3939

40-
With Umbraco Commerce Cart, products that can be added to a cart are defined by adding attributes to HTML elements on your site. Most likely this will be a "buy" `<button>` element, however, any HTML element can become an add to cart component.
40+
With Umbraco Commerce Cart, products that can be added to a cart are defined by adding attributes to HTML elements on your site. Most likely this will be a "buy" `<button>` element, however, any HTML element can become an add-to-cart component.
4141

42-
The first step when defining a add to cart component is to add the `ucc-add-to-cart` class to the element. This informs Umbraco Commerce Cart that it should react to that element's click event.
42+
The first step when defining an add-to-cart component is to add the `ucc-add-to-cart` class to the element. This informs Umbraco Commerce Cart that it should react to that element's click event.
4343

4444
```html
4545
<button class="ucc-add-to-cart"
@@ -48,12 +48,12 @@ The first step when defining a add to cart component is to add the `ucc-add-to-c
4848
</button>
4949
```
5050

51-
Along with the `ucc-add-to-cart` class we also use a series of data attributes to provide information about the product being added to the cart. At minimum a `data-ucc-product-reference` is required, but the following table outlines all the available configuration options.
51+
Along with the `ucc-add-to-cart` class, a series of data attributes provides information about the product being added to the cart. At a minimum, a `data-ucc-product-reference` is required, but the following table outlines all the available configuration options.
5252

5353
| Key | Description |
5454
| -- | -- |
5555
| `data-ucc-product-reference` | The unique reference for the product being added. This is usually the Key of the product Umbraco node. |
56-
| `data-ucc-product-variant-reference` | The unique reference for a variant of the primary product being added. This is usually either a child variant nodes Key or the Key of a complex variant item from the Variants property editor.
56+
| `data-ucc-product-variant-reference` | The unique reference for a variant of the primary product being added. This is usually either a child variant node Key or the Key of a complex variant item from the Variants property editor.
5757
| `data-ucc-quantity` | The amount of the given product to be added. |
5858
| `data-ucc-property1-key` | The key of a property to set on the added order line. |
5959
| `data-ucc-property1-value` | The value of a property to set on the added order line. |
@@ -64,31 +64,31 @@ Along with the `ucc-add-to-cart` class we also use a series of data attributes t
6464
| `data-ucc-bundle-item1-property1-key` | The key of a property to set on the added bundle item. |
6565
| `data-ucc-bundle-item1-property1-value` | The value of a property to set on the added bundle item. |
6666

67-
Where an attribute ends with a number, this signifies that this attribute defines a collection and so multiple attributes can be defined with each distinct combination incrementing the number by `1`. It is important that these attributes start from `1` and must be sequential without gaps.
67+
Some attributes end with a number. This signifies that the attribute defines a collection and so multiple attributes can be defined with each distinct combination incrementing the number by `1`. It is important that these attributes start from `1` and must be sequential without gaps.
6868

69-
With an add to cart button defined, clicking on the button should now automatically add the given product to the cart and open the cart for display.
69+
With an add-to-cart button defined, clicking on the button will automatically add the given product to the cart and open the cart for display.
7070

7171
![Shopping cart modal.](../media/cart/cart.png)
7272

7373
### Open Cart Button
7474

75-
Whilst the cart will open automatically when an item is added to the cart, it's also likely that you will want the ability for customers to open their carts manually. To do this you can add a `ucc-cart` class to a link or button element and Umbraco Commerce Cart will automatically bind a click event handler to trigger opening the cart.
75+
While the cart will open automatically when an item is added, you can also enable the customers to open their carts manually. To do this, add a `ucc-cart` class to a link or button element. The Umbraco Commerce Cart will then automatically bind a click event handler to trigger opening the cart.
7676

7777
```html
7878
<a href="#" class="ucc-cart">Cart</a>
7979
```
8080

8181
### Cart Count Label
8282

83-
Another common feature on commerce sites is the ability to display a total number of items in the current cart. To do this you can define a html element with a `ucc-cart-count` class applied and Umbraco Commerce Cart will automatically update it's text value whenever the cart changes.
83+
Another common feature on commerce sites is the ability to display the total number of items in the current cart. To do this, define an HTML element with a `ucc-cart-count` class applied. Umbraco Commerce Cart will then automatically update its text value whenever the cart changes.
8484

8585
```html
8686
<a href="#" class="ucc-cart">Cart (<span class="ucc-cart-count">0</span>)</a>
8787
```
8888

8989
## Commands
9090

91-
As well as the automatic API defined above, it is also possible to trigger Umbraco Commerce Cart commands manually via a number of JavaScript functions.
91+
As well as the automatic API defined above, it is possible to trigger Umbraco Commerce Cart commands manually via a number of JavaScript functions.
9292

9393
```javascript
9494
// Open the cart
@@ -106,7 +106,7 @@ UCC.setStore('brewed');
106106
// Update the checkout URL
107107
UCC.setCheckoutUrl('/new-checkout');
108108

109-
// Set whether to display prices inclusive of exclusive of sales TAX
109+
// Set whether to display prices inclusive or exclusive of sales tax
110110
UCC.showPricesIncludingTax(true);
111111

112112
// Show a property in the cart
@@ -129,7 +129,7 @@ UCC.setOnError(msg => {
129129

130130
## Localization
131131

132-
The cart UI supports being translated into any language. Out of the box it comes with a default English translation, but additional locales can be configured.
132+
The cart UI supports being translated into any language. Out of the box, it comes with a default English translation, but additional locales can be configured.
133133

134134
Localization is controlled via the `lang` attribute in the `<html>` tag of your site.
135135

@@ -146,7 +146,7 @@ Localization is controlled via the `lang` attribute in the `<html>` tag of your
146146

147147
In the above example, Umbraco Commerce Cart will look for a French locale. If a given locale can't be found, then it will default back to English.
148148

149-
Additional locales can be added either via the `UCC.init` method, or by calling the `UCC.addLocale` command.
149+
Additional locales can be added either via the `UCC.init` method or by calling the `UCC.addLocale` command.
150150

151151
```javascript
152152
// Init command example
@@ -182,7 +182,7 @@ UCC.addLocale('fr', {
182182
})
183183
```
184184

185-
The default English locale has the following values, and also defines the required keys for a locale.
185+
The default English locale has the following values and defines the required keys for a locale.
186186

187187
```javascript
188188
{
@@ -198,7 +198,7 @@ The default English locale has the following values, and also defines the requir
198198
}
199199
```
200200

201-
To override a locale you can re-add it reusing the same language key
201+
To override a locale you can re-add it by reusing the same language key.
202202

203203
```javascript
204204
// Init command example
@@ -222,9 +222,9 @@ UCC.addLocale('en', {
222222

223223
## Displaying Properties
224224

225-
If you capture any custom properties, you may wish to display them within the cart. Displaying properties is achieved in two steps.
225+
If you capture any custom properties, you may want to display them within the cart. Displaying properties is achieved in two steps.
226226

227-
We first define the property keys we wish to display either via the `UCC.init` command, or the `UCC.showProperty` command.
227+
First, you define the property keys you wish to display either via the `UCC.init` command, or the `UCC.showProperty` command.
228228

229229
```javascript
230230
// Init command example
@@ -238,7 +238,7 @@ UCC.init({
238238
UCC.showProperty('message');
239239
```
240240

241-
Next we define a localization key to use as a label for each property.
241+
Next, you define a localization key to use as a label for each property.
242242

243243
```javascript
244244
// Init command example
@@ -262,13 +262,13 @@ UCC.addLocale('en', {
262262
})
263263
```
264264

265-
Now when the cart is displayed, the defined properties will be displayed using the localization value as their label.
265+
Now, when the cart is displayed, the defined properties will be displayed using the localization value as their label.
266266

267267
![Example property](../media/cart/property.png)
268268

269269
## Theming
270270

271-
In order to allow customization of the cart UI, CSS variables are used to allow easy overiding of the default styles.
271+
To allow customization of the cart UI, CSS variables are used to allow overriding of the default styles.
272272

273273
The following details the default values, and the available keys to override.
274274

@@ -325,7 +325,7 @@ Styles can be overridden by including a stylesheet after the Umbraco Commerce Ca
325325

326326
## Error Handling
327327

328-
By default Umbraco Commerce Cart will just log any request errors to the console. If you would like to display errors to your users, or handle them differently you can do so by providing an error handler function.
328+
By default, Umbraco Commerce Cart will log any request errors to the console. If you would like to display errors to your users or handle them differently you can provide an error handler function.
329329

330330
```javascript
331331
// Init command example
@@ -337,4 +337,4 @@ UCC.init({
337337

338338
// Set on error command example
339339
UCC.setOnError(msg => console.log(msg));
340-
```
340+
```

0 commit comments

Comments
 (0)