10 Products Available
The following has evaluated to null or missing:
==> productDetail.urlImage [in template "37794063322763#20119#53162" at line 38, column 51]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: defaultImageURL = productDetail.urlIm... [in template "37794063322763#20119#53162" at line 38, column 33]
----
1<#assign
2 defaultImgMap = {
3 "220": "/documents/d/guest/220-coming-soon",
4 "220EV": "/documents/d/guest/220ev-coming-soon",
5 "520": "/documents/d/guest/520-coming-soon",
6 "389": "/documents/d/guest/389-coming-soon",
7 "520EV": "/documents/d/guest/520ev-coming-soon",
8 "535": "/documents/d/guest/535-coming-soon",
9 "536": "/documents/d/guest/536-coming-soon",
10 "537": "/documents/d/guest/537-coming-soon",
11 "548": "/documents/d/guest/548-coming-soon",
12 "567": "/documents/d/guest/567-coming-soon",
13 "579": "/documents/d/guest/579-coming-soon",
14 "579EV": "/documents/d/guest/579ev-coming-soon",
15 "589": "/documents/d/guest/589-coming-soon"
16 }
17 />
18<#assign
19 commerceContext = renderRequest.getAttribute("COMMERCE_CONTEXT")
20 account = commerceContext.getAccountEntry()
21 accountId = account.getAccountEntryId()
22 chanelId = commerceContext.getCommerceChannelId()
23 />
24<div class="product-card-tiles">
25 <#if entries?has_content>
26 <#list entries as curCPCatalogEntry>
27
28 <#assign
29 cpDefinitionId = curCPCatalogEntry.getCPDefinitionId()
30 productId = curCPCatalogEntry.getCProductId()
31 productName = curCPCatalogEntry.getName()
32 productShortDescription = curCPCatalogEntry.getShortDescription()
33 productDescription = curCPCatalogEntry.getDescription()
34 friendlyURL = cpContentHelper.getFriendlyURL(curCPCatalogEntry, themeDisplay)
35 defaultImageURL = cpContentHelper.getDefaultImageFileURL(accountId, cpDefinitionId)
36 defaultImageFileVersion = cpContentHelper.getCPDefinitionImageFileVersion(cpDefinitionId, request)
37 productDetail = restClient.get("/headless-commerce-delivery-catalog/v1.0/channels/${chanelId}/products/${productId}?accountId=${accountId}&nestedFields=categories,productSpecifications")
38 defaultImageURL = productDetail.urlImage?replace('https://localhost', '')
39 fileEntryIdAttr = 'data-fileentryid="' + defaultImageFileVersion.fileEntryId + '"'
40 specifications = productDetail.productSpecifications
41 customFields = productDetail.customFields
42
43 productCategories = restClient.get("/headless-commerce-delivery-catalog/v1.0/channels/${chanelId}/products/${productId}/categories?pageSize=40")
44 categories = productCategories.items
45
46 erc = productDetail.externalReferenceCode
47 infoObj = {}
48 tags = productDetail.tags
49 featuredSpecificationKeys = ["fit", "weight", "material"]
50 isSuggested = false
51 suggestedClass = ""
52
53 visiblePrice = ""
54 miles = ""
55 neworUsed = ""
56 locationName = ""
57 locationId = ""
58 displayPrice = false
59
60 truckBadgesArray = [{"id": "", "value": ""}]
61
62
63 />
64 <#if categories?has_content>
65 <#list categories as category>
66 <#if category.vocabulary?replace(' ', '') = 'truckbadges'>
67 <#assign truckBadgesArray += [{"id": category.id, "value": category.name}] />
68 <#else>
69 <#assign infoObj = infoObj + {category.vocabulary?replace(' ', ''): {"id": category.id, "value": category.name}} />
70 </#if>
71 </#list>
72 <#assign infoObj = infoObj + {"truckbadges": truckBadgesArray} />
73 </#if>
74
75 <div class="d-none">
76 <#list customFields as customField>
77 <#if customField.name = 'Visible Price'>
78 <#assign visiblePrice = customField.customValue.data />
79 </#if>
80
81 <#if customField.name = 'Display Price'>
82 <#assign displayPrice = customField.customValue.data />
83 </#if>
84
85 <#if customField.name = 'Miles'>
86 <#assign miles = customField.customValue.data />
87 </#if>
88 </#list>
89
90 <#if infoObj.year?has_content>
91 <#assign productName = infoObj.year.value />
92 </#if>
93 <#if infoObj.make?has_content>
94 <#assign productName = productName + " " + infoObj.make.value />
95 </#if>
96 <#if infoObj.model?has_content>
97 <#assign productName = productName + " " + infoObj.model.value />
98
99 <#if defaultImageURL?trim?contains('/o/commerce-media/default/?groupId=') || defaultImageURL?trim?contains('commercial-truck-coming-soon')>
100 <#if defaultImgMap[infoObj.model.value?lower_case]?? >
101 <#assign fileEntryIdAttr = '' />
102 <#assign defaultImageURL = defaultImgMap[infoObj.model.value?lower_case] />
103 </#if>
104 </#if>
105
106 </#if>
107
108 <#if categories?has_content>
109 <#list categories as category>
110 <#if category.vocabulary = 'conditions'>
111 <#assign newOrUsed = category.name />
112 <#if category.name = 'Used'>
113 <#assign newOrUsed = 'Pre-Owned'/>
114 </#if>
115 </#if>
116
117 <#if category.vocabulary = 'location'>
118 <#assign locationName = category.name />
119 <#assign locationId = category.id />
120 </#if>
121
122 <!--<span class="btn btn-outline-primary product-category">${category.vocabulary}: ${category.name}</span> -->
123 </#list>
124 </#if>
125
126 <#if specifications?has_content>
127 <#list specifications as specification>
128 <#if featuredSpecificationKeys?seq_contains(specification.specificationKey) >
129 <span class="badge badge-secondary">${specification.value}"</span>
130 </#if>
131 </#list>
132 </#if>
133 </div>
134
135 <#if tags?seq_contains("suggested")>
136 <#assign isSuggested = true />
137 <#assign suggestedClass = "suggested" />
138 </#if>
139 <div class="product-listing-card">
140 <div class="product-card-top click-here-box">
141 <img src="${defaultImageURL}" ${fileEntryIdAttr} class="img-fluid" alt="${productName}" />
142
143 <#if infoObj.truckbadges??>
144 <#list infoObj.truckbadges as truckBadge>
145 <#if truckBadge.value = "Red Oval">
146 <div class="overlay-badge top-right">
147 <img src="/documents/d/guest/red-oval" class="overlay-badge-img red-oval-badge" alt="Red Oval" />
148 </div>
149 </#if>
150
151 <#if truckBadge.value = "Work Ready">
152 <div class="overlay-badge top-left">
153 <img src="/documents/d/guest/work-ready" class="overlay-badge-img work-ready-badge" alt="Work Ready" />
154 </div>
155 </#if>
156 </#list>
157 </#if>
158
159 <#if isSuggested>
160 <div class="aspect-ratio-item-bottom-right">
161 <span class="label label-inverse-primary ${suggestedClass}" >
162 <span class="label-item label-item-expand">
163 Suggested
164 </span>
165 </span>
166 </div>
167 </#if>
168
169 <a href="${friendlyURL}" class="click-here-link d-none">Learn More</a>
170 </div>
171
172 <div class="product-card-body click-here-box ${suggestedClass}">
173 <p class="mb-1">Stock Number: <b>${curCPCatalogEntry.getName()}</b></p>
174 <h3 class="product-card-title ${suggestedClass}" title="${productName}"><a href="${friendlyURL}" class="color-inherit click-here-link">${productName}</a></h3>
175 <div class="product-card-details">
176 <ul class="prod-main-info">
177 <#if displayPrice[0] == "Yes" && visiblePrice?has_content>
178 <#assign formattedPrice = visiblePrice?string.currency>
179 <li class="prod-price">${formattedPrice}</li>
180 <#else>
181 <li class="prod-price">Call For Pricing</li>
182 </#if>
183 <#if miles != "" && miles != "0">
184 <#assign cleanMiles = miles?replace("[^0-9]", "", "r") />
185 <#assign formattedMiles = cleanMiles?number?string('#,##0.###') />
186 <li class="prod-miles"><span class="miles-text">${formattedMiles}</span> mi</li>
187 </#if>
188 </ul>
189
190 <#if newOrUsed??>
191 <span class="new-or-used-badge">${newOrUsed}</span>
192 </#if>
193 </div>
194 </div>
195
196 <div class="product-card-footer">
197 <#if locationName != "">
198 <div class="product-card-location">
199 <p>Available in: <a href="/product-list?location=${locationId}">${locationName}</a></p>
200 </div>
201 </#if>
202 </div>
203
204 </div>
205 </#list>
206 </#if>
207</div>
2022 Peterbilts For Sale
Shop our 2022 Peterbilt trucks for sale and find a truck that fits your business. Our 2022 Peterbilt models include 579s, 389s, 567s, 548s, and more. From sleepers, to day cabs, to dump trucks, we have configurations for every job and a reputation for getting the job done. Filter by engine, transmission, configuration, and more to narrow down your search. We also offer financing options that fit all business types, so apply online to get your budget.
2022 Peterbilt 579s For Sale
Find efficient Peterbilt 579s in sleeper or day cab configurations for hauls where every penny counts. Available in 118" and 124" BBC cabs with both PACCAR MX-13 and Cummins X15 engine options. With options like the 15-inch digital dashboard, smart steering wheel, driver-assistance and collision mitigation, refrigerator, and EPIQ aero package, you can find 579s with a variety of features. The spacious 80" UltraLoft sleeper is the largest on the market.
2022 Peterbilt 389s For Sale
The iconic Peterbilt 389 follows the legacy of the models 379 and 359 as Peterbilt's long-nosed flagship truck. With classic styling and an instantly recognizeable front-end, the 389 stands out from the crowd. This class 8 truck comes with a variety of engine and transmission options for effortless hauling. Shop our used 2022 Peterbilt 389s today.
2022 Peterbilt 567s For Sale
The rugged and reliable Peterbilt 567 is built for the toughest jobs and a steel frame and impact resistant body that comes in day cab, sleeper, dump truck, and other vocational configurations. This class 8 truck comes in both 115" and 121" BBC cab lengths and a variety of engine and transmission options to get the job done.
2022 Medium-Duty Peterbilts
The Peterbilt medium-duty lineup includes work-horses like the 548, 537, 536, and 535 that are built for a variety of vocational and specialty applications. With VMUX multiplex electrical systems and body-builder friendly layouts these trucks are engineered for customizability. The wider 2.1 meter cab provides a spacious interior with comfort features and thoughtful storage; it's everything a driver wants in a truck and more. Shop our 2022 Peterbilt medium-duty inventory online today, or reach out to our sales team to assist you in your search!
