Skip to content

Commit 1ad1411

Browse files
committed
Add Vehicle Payments location documentation.
1 parent 631f125 commit 1ad1411

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

source/includes/_locations.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,43 @@ This element is positioned below the vehicle image area on vehicle search pages.
8888
This element is positioned below the vehicle tech specs area on vehicle search and detail pages.
8989

9090

91+
## Vehicle Payments
92+
93+
> Usage:
94+
95+
```javascript
96+
(async APILoader => {
97+
const API = await APILoader.create(document.currentScript);
98+
API.insert('vehicle-payments', (elem, meta) => {
99+
// This element is positioned directly below the vehicle pricing area on vehicle search and detail pages.
100+
});
101+
})(window.DDC.APILoader);
102+
```
103+
104+
> Example Implementation:
105+
106+
```javascript
107+
(async APILoader => {
108+
const API = await APILoader.create(document.currentScript);
109+
API.subscribe('page-load-v1', ev => {
110+
// Only execute the code on search results and vehicle details pages.
111+
if (ev.payload.searchPage || ev.payload.detailPage) {
112+
API.insert('vehicle-payments', (elem, meta) => {
113+
const button = API.create('button', {
114+
text: 'Vehicle Payments',
115+
href: '#',
116+
classes: 'btn btn-primary'
117+
})
118+
API.append(elem, button);
119+
});
120+
}
121+
});
122+
})(window.DDC.APILoader);
123+
```
124+
125+
This element is positioned directly below the vehicle pricing area on vehicle search and detail pages.
126+
127+
91128
## Vehicle Pricing
92129

93130
> Usage:
@@ -96,7 +133,7 @@ This element is positioned below the vehicle tech specs area on vehicle search a
96133
(async APILoader => {
97134
const API = await APILoader.create(document.currentScript);
98135
API.insert('vehicle-pricing', (elem, meta) => {
99-
// This element is positioned below the vehicle pricing area on vehicle search and detail pages.
136+
// This element is positioned after the vehicle-payments insert location, and is placed below the pricing/incentives area on vehicle search and detail pages.
100137
});
101138
})(window.DDC.APILoader);
102139
```
@@ -125,7 +162,7 @@ This element is positioned below the vehicle tech specs area on vehicle search a
125162
})(window.DDC.APILoader);
126163
```
127164

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

130167
## Vehicle Media Container
131168

source/includes/_requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ When you begin development of your script, it's easy to test on any Dealer.com s
1818

1919
```javascript
2020
(async APILoader => {
21-
const API = await APILoader.create(document.currentScript);
21+
const API = await APILoader.create(document.currentScript || 'test-integration');
2222
API.test('https://www.yourdomain.com/your-javascript-file.js');
2323
})(window.DDC.APILoader);
2424
```

0 commit comments

Comments
 (0)