You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/includes/_utilities.md
+67Lines changed: 67 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,3 +168,70 @@ Will return the following object:
168
168
});
169
169
})(window.DDC.APILoader);
170
170
```
171
+
172
+
## API.utils.getUnlockedVehicles()
173
+
The utility method `getUnlockedVehicles` returns an array of vehicle UUIDs where the vehicle's pricing has already been unlocked.
174
+
175
+
This can be useful when paired with the `unlockPricing` method. When `vehicle-data-updated-v1` triggers, a list of currently displayed vehicles is provided. You could gather the list of vehicles, skip the ones which are already unlocked, and then call your service for a smaller subset of vehicles which may need to be unlocked.
// Unlock vehicles which are not already unlocked, and your service indicates should be unlocked.
208
+
API.utils.unlockPricing(uuidsToUnlock);
209
+
210
+
});
211
+
})(window.DDC.APILoader);
212
+
```
213
+
214
+
## API.utils.unlockPricing(uuids)
215
+
The utility method `unlockPricing` is used to unlock special pricing for specific vehicles on a page.
216
+
217
+
You can provide the vehicles to unlock by passing an array of vehicle UUIDs to the method. If you would like to unlock all vehicles on the page, omit the `uuids` parameter from the function call.
218
+
219
+
The method must be called on each page where you want the vehicles to be unlocked. If a vehicle has been previously unlocked, it will be initially displayed unlocked on a subsequent view of the vehicle. However, when faceting and searching vehicles it is common for a mix of locked and unlocked vehicles to be rendered. Therefore, it is necessary to call the function each time the `vehicle-data-updated-v1` event is triggered.
0 commit comments