<?php
$post_id = get_the_id();
// echo print_r(get_vehicle_gallery_images());
$image_urls = get_post_meta($post_id, 'pictures', true);
if (is_string($image_urls)) {
$images = explode(',', $image_urls);
} elseif (is_array($image_urls)) {
$images = $image_urls;
} else {
$images = [];
}
if (!empty($images)): ?>
<div class="vehicle-gallery">
<?php foreach ($images as $index => $img_url): ?>
<a href="<?php echo esc_url(trim($img_url)); ?>" class="glightbox" data-gallery="vehicle-gallery">
<?php if ($index === 0): ?>
<img src="<?php echo esc_url(trim($img_url)); ?>" alt="Vehicle Image" class="gallery-main-image" />
<?php else: ?>
<img src="<?php echo esc_url(trim($img_url)); ?>" alt="Gallery Thumb" class="gallery-thumb" />
<?php endif; ?>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>
document.addEventListener('DOMContentLoaded', function () {
new Swiper('.vehicle-gallery', {
slidesPerView: 5,
spaceBetween: 10,
loop: true,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
breakpoints: {
768: {
slidesPerView: 3,
},
480: {
slidesPerView: 2,
}
}
});
});
Pre-Owned
BMW MY20 sDRIVE18i STEPTRONIC (2019)
R 429 000
Description
*MY SERVICE PLAN 2027,11,01 or 147589km *Mineral Grey *Leathertec Black *18" Y-spoke *Steptronic transmission with double clutch *Automatic tailgate *Rear view camera *Panorama glass *Park Distance Control front & rear *LED headlights with extended contents *Park Assist *Comfort Package
Mileage
58500 km
Year
Fuel Type
UNLEADED
Exterior Colour
Mineral Grey Metallic
Transmission
AUTOMATIC
VIN
Vehicle ID
28480017
Features
Range
X1
Mileage
58 500 km
Year
2019
Colour
Mineral Grey Metallic
Transmission
AUTOMATIC
Fuel
UNLEADED
Body Type
STATION WAGON
Doors
5
Service History
Full
Vin No.
WBAJG120405N06966
Comments
*MY SERVICE PLAN 2027,11,01 or 147589km *Mineral Grey *Leathertec Black *18" Y-spoke *Steptronic transmission with double clutch *Automatic tailgate *Rear view camera *Panorama glass *Park Distance Control front & rear *LED headlights with extended contents *Park Assist *Comfort Package
<?php
$post_id = get_the_id();
$custom_fields = get_post_meta($post_id);
echo $custom_fields['mmcode'][0] . '<br />';
echo print_r($custom_fields);
if (empty($custom_fields)) {
error_log("No custom fields found for post ID: $post_id");
return;
}
error_log("Custom fields for post ID $post_id:");
foreach ($custom_fields as $key => $value) {
// $value is always an array
if (is_array($value)) {
foreach ($value as $val) {
error_log("$key => $val");
}
} else {
error_log("$key => $value");
}
}
?>Back to search results
R 429 000
MSRP
Back to search results
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_8.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_9.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_10.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_11.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/mol01613_u51271_12.jpg
USED
2019
80 500 km
AUTOMATIC
UNLEADED
White
R 379 950
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_8.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_9.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_10.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_11.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_12.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_13.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u103929_14.jpg
USED
2020
53 500 km
AUTOMATIC
UNLEADED
Alpine White III
R 439 000
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10163_u104089_8.jpg
USED
2021
63 939 km
AUTOMATIC
DIESEL
Alpine White III
R 499 000
https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_1.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_2.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_3.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_4.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_5.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_6.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_7.jpg, https://bmrprodphotosuitestorage.blob.core.windows.net/stockimages/tol10005_u28077_8.jpg
USED
2023
66 571 km
AUTOMATIC
DIESEL
Pure White
R 649 950

