Skip to content

Releases: justin-netage/sa-motorlease

v2.6.39

Choose a tag to compare

@justin-netage justin-netage released this 29 Sep 12:09
22ee483

Fixes the "see what vehicles you qualify for" button for the new vehicle filter.

  • "See what vehicles you qualify for" works with the new vehicle filter again. The button on the qualification results page still linked with the old WooCommerce Product Filter's ?wpf_min_price=0&wpf_max_price=<limit> params, which the new filter ignores, so visitors landed on the unfiltered catalogue. The button now links to ?price=0-<limit>, and the filter accepts any whole-rand max-price ceiling in the URL (not just the ones on the dropdown ladder), adding it to the Max Price dropdown as "Up to R". Old wpf_max_price links are still honoured and mapped to the same ceiling.

v2.6.38

Choose a tag to compare

@justin-netage justin-netage released this 28 Sep 07:48
5e15ab2

The NEW badge is now white with orange text.

  • The NEW badge is now white with orange text, on the listing cards and the single product page — the inverse of the orange SOLD badge rather than the navy it shipped with in 2.6.37. Filter asset version bumped to 2.0.5.

v2.6.37

Choose a tag to compare

@justin-netage justin-netage released this 21 Sep 09:59
e2200d7

The single product page now shows the NEW badge.

  • NEW badge on the single product page. The vehicle's own page now carries the same NEW badge as its listing card, in the corner of the image gallery where the theme puts its Sold label, styled to match it (navy rather than orange). Same rule as the cards: a sold vehicle shows Sold only. Hooked into the theme's flatsome_sale_flash action inside the gallery box, so the child theme's product-image template needs no change and the CSS is printed by the plugin on product pages.

v2.6.36

Choose a tag to compare

@justin-netage justin-netage released this 21 Sep 09:30
9a41e7b

Carousels can be scoped by vehicle attribute (e.g. a "New Vehicles" strip), and vehicle cards show a NEW badge.

  • Carousels can be scoped by vehicle attribute. [sa_featured_vehicles] takes condition, make, model, transmission, body_type, fuel and year — e.g. [sa_featured_vehicles condition="new" title="New Vehicles"] shows only new vehicles: the featured ones first, topped up with the newest new vehicles. A comma lists alternatives (fuel="petrol,diesel"), attributes combine with AND, and attr="new-or-used:new; transmission:automatic" reaches any other product attribute by taxonomy (; between attributes, | between values). Values match as term slugs after sanitising, so New and new both work. The scope applies alongside category, and the strip is omitted when nothing matches.
  • NEW badge on vehicle cards. Cards for vehicles whose New or Used attribute is New carry a navy NEW badge in the corner, in the same spot and style as the orange SOLD badge. A card shows at most one badge: a sold vehicle shows SOLD only, whatever its condition. Read from the cached index (the condition facet), with the same direct-term fallback the SOLD badge uses. Filter asset version bumped to 2.0.4, which also rebuilds the cached card HTML.

v2.6.35

Choose a tag to compare

@justin-netage justin-netage released this 15 Sep 07:44
1b8309a

The vehicle grid now opens sorted by "Recently Added".

  • "Recently Added" is the default sort. The featured strip already sits above the grid, so opening the grid with the same featured vehicles again just repeated them. The grid now opens newest-first; "Featured" stays in the dropdown for anyone who wants it. The dropdown lists Recently Added first, the URL omits sort= for the default (so ?sort=featured is what a shared Featured view carries), and Clear resets to it. Filter asset version bumped to 2.0.3.

v2.6.34

Choose a tag to compare

@justin-netage justin-netage released this 15 Sep 07:36
f02e057

The "Featured" sort now puts featured vehicles first, and releases purge the page cache themselves.

  • The "Featured" sort now actually puts featured vehicles first. The default sort option in the vehicle filter was catalogue order — date-descending, i.e. "Recently Added" under another name — and the WooCommerce Featured flag was not even in the filter's index, so flagging a vehicle changed nothing in the grid. The flag is now indexed and the Featured sort leads with the flagged vehicles (available ones only — a sold vehicle does not head the catalogue), then everything else in catalogue order. Applied to both the server-side sort and its client-side mirror. Filter asset version bumped to 2.0.2, which also rebuilds the cached index and client dataset so the flag is present.
  • Releases now go live for visitors without a manual cache clear. A plugin update changes what pages render, but only catalogue changes purged the host's full-page cache, so after every release the public site kept serving the pre-update HTML (old script version, old carousel markup) until the next import happened to flush it — 2.6.33 sat behind a cached homepage for exactly this reason. The first request that runs under a new plugin version now drops the vehicle caches and purges the page cache itself.

v2.6.33

Choose a tag to compare

@justin-netage justin-netage released this 15 Sep 07:14
f839f25

Featured carousels show every featured vehicle, loaded in batches as the visitor keeps clicking.

  • Featured carousels now show every featured vehicle. The strip took the vehicles flagged "Featured" in WooCommerce, then applied the same one-card-per-make collapse and the limit cap (8 by default) that were meant for the top-up stock. With 17 vehicles flagged across 9 makes the homepage carousel showed 8 — a single Haval, Polo, Jaecoo, Kwid and C3 each — and dropped the rest, so flagging a vehicle often had no visible effect. Flagged vehicles are now a hand-picked set and always all appear, newest first; limit is the minimum card count that unflagged stock tops up to, and dedupe only shapes that top-up (seeded with the makes the flagged vehicles already cover, so the filler adds variety rather than repeats).
  • Carousel cards load on demand. Only the first limit cards (8) are in the page; the remaining vehicle IDs ride along on the strip and the next batch is fetched (new sa_vf_cards AJAX action) and appended as the visitor keeps clicking Next or drags towards the end, so the initial HTML stays the same size however many vehicles are flagged. The Next arrow stays live while more remain; a failed fetch re-queues its batch for the next click. Filter asset version bumped to 2.0.1.

v2.6.32

Choose a tag to compare

@justin-netage justin-netage released this 14 Sep 10:07
b1263ba

Dead vehicle URLs redirect to live stock instead of a 404, and the page cache is purged while vehicles are being deleted rather than only afterwards.

  • Dead vehicle URLs now redirect to live stock instead of a 404. Vehicles are hard-deleted when they drop out of the PACE feed (prune) or a week after they sell, and nothing told anyone holding the old link: Google kept the pages indexed for weeks (every top result for site:samotorlease.co.za/listing/ was a 404), shared WhatsApp links and browser history went dead, and an anonymous visitor could be served a cached listing grid rendered before the deletion. Any 404 under the product permalink base (/listing/…) is now a 301 to the listings page, narrowed to the vehicle's make when the slug names one that still has stock (/listings/?make=citroen), so the visitor lands on comparable vehicles and search engines are told to drop the URL. Sent with no-cache headers so a slug reissued to a new vehicle later is not shadowed by a browser- or edge-cached redirect.
  • Purge the page cache while deleting, not only afterwards. The prune pass and the daily expired-sold cron each delete vehicles one at a time and flushed once at the end. A product page is 404 the instant its row is gone, but the cached grid kept linking to it until that final flush — minutes later when the loop is slow (each deletion also removes attachments), or never when the run was killed first. This is the window a visitor hit when clicking five Citroens from a listing served at 08:38 that had all already been deleted. Both loops now purge after each deletion, throttled to once per 30 s so a mass prune does not hammer the host purge API, and the end-of-request catch-all stays armed for anything deleted after the last mid-run purge.

PR: #82

v2.6.31

Choose a tag to compare

@justin-netage justin-netage released this 02 Sep 07:37
8c2acda

Sold vehicles are shown by default again, and no longer pushed to the last page.

  • Sold vehicles are shown by default. The "Available Only" toggle introduced in 2.5.0 was pre-checked, so an anonymous visitor's first view of the catalogue silently excluded every sold vehicle — the site looked smaller than the stock actually is, and the SOLD badge was effectively unreachable without knowing to untick a box. The toggle now starts unchecked: sold vehicles are listed alongside available ones, badged SOLD, and ticking "Available Only" hides them. The URL parameter inverts to match — the deviation from the default is now ?available_only=1 rather than ?show_sold=1. Links shared while the old default was in force still resolve to the same view, since show_sold=1 asked for what is now the default anyway.
  • Sold vehicles are no longer pushed to the last page. They previously sorted below every available vehicle regardless of the chosen sort, which was tolerable while they were hidden by default but not once they are shown: sorting by price produced a price-ordered list whose sold entries were all stranded at the end, so the order the visitor asked for was not the order they got. Sold vehicles now take their natural place in whichever sort is active and are distinguished by the badge on the card rather than by position. Applied to both the server-side sort and its client-side mirror, which had the same rule duplicated.
  • Filter asset version bumped to 2.0.0, which also busts the cached vehicle index, client dataset and per-query payload caches — those embed the rendered order, so they have to be rebuilt for the sort change to take effect rather than waiting out the hour TTL.

Full changes: #81

v2.6.30

Choose a tag to compare

@justin-netage justin-netage released this 26 Aug 11:22
cdeceb4

Follow-up to v2.6.29. The page-cache purge added in 2.6.29 works — verified live — but it was only wired into the two import passes, which turned out to be too narrow.

Plenty of things change the catalogue without going near an import: the 5-minute image sync, the image-repair and broken-image crons, the daily sold-date pass, the daily expired-sold deletion (which changes the vehicle count), and any manual product edit in wp-admin. Each left the index correct and the cached HTML stale — the same "right when logged in, behind when not" symptom 2.6.29 was meant to end.

Fixes

  • The purge now hangs off the index version bump itself, via a shutdown hook, rather than off each individual caller — so a future cron cannot reintroduce this by forgetting to flush. It fires at most once per request and only on requests that actually wrote to a vehicle, so ordinary page views are unaffected.
  • Purge before warming the index, not after. The warm renders a card for every vehicle and is where an import run meets the PHP timeout; a purge queued behind it never happens when the request is killed, leaving the transients dropped but the stale HTML still served.
  • A failing feed no longer hides its reason. A non-200 from PACE was being classified as INFO and dropped at the default WARN log threshold, leaving nothing but Create END (feed error). It now logs the status code, elapsed time and a short body snippet at WARN.

Note

If your import log shows Create START → Create END (feed error), that is a separate problem — PACE is returning a non-200 and no vehicles are being imported at all. This release makes the reason visible; SA Motorlease → Status → Run import now (progress UI) shows it immediately.