Skip to content

Commit

Permalink
Add Vehicle Payments location documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jschulte committed Apr 29, 2022
1 parent 631f125 commit 1ad1411
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
41 changes: 39 additions & 2 deletions source/includes/_locations.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,43 @@ This element is positioned below the vehicle image area on vehicle search pages.
This element is positioned below the vehicle tech specs area on vehicle search and detail pages.


## Vehicle Payments

> Usage:
```javascript
(async APILoader => {
const API = await APILoader.create(document.currentScript);
API.insert('vehicle-payments', (elem, meta) => {
// This element is positioned directly below the vehicle pricing area on vehicle search and detail pages.
});
})(window.DDC.APILoader);
```

> Example Implementation:
```javascript
(async APILoader => {
const API = await APILoader.create(document.currentScript);
API.subscribe('page-load-v1', ev => {
// Only execute the code on search results and vehicle details pages.
if (ev.payload.searchPage || ev.payload.detailPage) {
API.insert('vehicle-payments', (elem, meta) => {
const button = API.create('button', {
text: 'Vehicle Payments',
href: '#',
classes: 'btn btn-primary'
})
API.append(elem, button);
});
}
});
})(window.DDC.APILoader);
```

This element is positioned directly below the vehicle pricing area on vehicle search and detail pages.


## Vehicle Pricing

> Usage:
Expand All @@ -96,7 +133,7 @@ This element is positioned below the vehicle tech specs area on vehicle search a
(async APILoader => {
const API = await APILoader.create(document.currentScript);
API.insert('vehicle-pricing', (elem, meta) => {
// This element is positioned below the vehicle pricing area on vehicle search and detail pages.
// This element is positioned after the vehicle-payments insert location, and is placed below the pricing/incentives area on vehicle search and detail pages.
});
})(window.DDC.APILoader);
```
Expand Down Expand Up @@ -125,7 +162,7 @@ This element is positioned below the vehicle tech specs area on vehicle search a
})(window.DDC.APILoader);
```

This element is positioned below the vehicle pricing area on vehicle search and detail pages.
This element is positioned after the vehicle-payments insert location, and is placed below the pricing/incentives area on vehicle search and detail pages.

## Vehicle Media Container

Expand Down
2 changes: 1 addition & 1 deletion source/includes/_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ When you begin development of your script, it's easy to test on any Dealer.com s

```javascript
(async APILoader => {
const API = await APILoader.create(document.currentScript);
const API = await APILoader.create(document.currentScript || 'test-integration');
API.test('https://www.yourdomain.com/your-javascript-file.js');
})(window.DDC.APILoader);
```
Expand Down

0 comments on commit 1ad1411

Please sign in to comment.