Skip to the main content

Webal Phoca Countdown shows the products your Phoca Cart shop has on sale right now. Each one has its picture, its name, the sale price, the old price crossed out, the date and time the sale ends, and a clock that counts down to that moment.

You choose how many sales to show, from 1 to 5. If there is more than one, they play one at a time in a slideshow with a Pause button. You can also give the offers a band behind them, with a picture, a colour and a minimum height.

This module is part of Webal Phoca Blocks, which needs Phoca Cart 6 or later. To show a short list of products with no clock, use Webal Phoca Product.

Tip. A sale is a discount that you add to a product in Phoca Cart, with an end date. The module shows only products that have a discount running now. If none is running, it shows nothing.

Where the prices and the dates come from

The module never works out a price or a date itself. It asks Phoca Cart, and it shows the answer that Phoca Cart gives to the person looking at the page.

So the sale price, the old price, the tax, the sale's name and the end of the sale are exactly what Phoca Cart gives. The module has no setting for any of them. To change one, change the discount on the product in Phoca Cart.

The end of a sale is the moment Phoca Cart stops working out the discount. The date is written in your site's time zone, with the name of the zone after the time.

The sale price shows even if your shop is set not to show discount prices on its own category and product pages. Phoca Cart's own sales module does the same. On its own product page Phoca Cart then shows the usual price, although the basket charges the sale price. To make its product page agree, set the Phoca Cart option Display Product Discount Price (Category, Items, Item View) to Yes.

Two things to know about end dates. A date with no time ends at midnight at the start of that day, so the sale stops when that day begins; to end a sale at the end of a day, give it the next day's date. And in a time zone that uses summer time the stored moment is shifted: a shop in London that types 15 July gets a price that stops at 00:00 BST on the 15th. The sentence on the page says exactly that, with the name of the zone.

If a product has two running discounts, the module shows it once, with the clock of the discount that ends first.

Add it to a page

These steps follow the order of the screens in Joomla. Nothing is saved until you press Save.

  1. In Phoca Cart, edit a product and add a discount with an end date.
  2. Log in to the Joomla administrator. In the menu on the left, choose Content, then Site Modules.
  3. Press New, then choose Webal Phoca Countdown from the list.
  4. Type a Title for the module.
  5. Type how many sales to show in How many sales.
  6. Open the Words tab. Choose a Picture and what the Button says.
  7. Open the Countdown tab. Choose which units the clock shows.
  8. To give the offers a band behind them, open the Layout tab and use the Background group.
  9. In the right-hand column of the Module tab, open the Position list and choose a position. A position is a named place in your template where a module can go.
  10. Beside Show Title in the same column, choose Hide if you typed a heading in the Title group.
  11. Open the Menu Assignment tab. In Module Assignment, choose Only on the pages selected.
  12. Beside Assign to Menu Items, press None. Every page is ticked until you do this.
  13. Type the name of the page in the search box, then tick that page.
  14. Press Save & Close, then open that page on your site.

If Phoca Cart is switched off, missing or too old, visitors see nothing at all. You, signed in as an administrator, see a short notice at the top of the page.

If no product is on sale, the module shows nothing, not even its heading. You can switch on Show featured products when nothing is on sale. Featured products have no end date, so they have no clock.

Accessibility. Give each Webal Phoca Countdown on a page a different module title. The title names the block for screen readers.

How the clock behaves

  • The date is always in the page. The end of the sale is written in words and marked up as a date. Screen readers read it, and so do search engines. The moving numbers are hidden from screen readers, so nothing is read out every second.
  • Pause. Every clock has a Pause the countdown button. It changes to Resume the countdown when pressed. The numbers then catch up with the real time left.
  • Seconds are off by default. A clock that changes every second is movement the page may not need. You can turn the seconds on in the Countdown tab.
  • The clock uses the visitor's own clock. The end moment is in the page. The visitor's browser counts down to it, so the count is right even if the page was kept for a while by a cache.
  • Without script. The offer, the price and the end date in words are in the page. The clock and the Pause button are not drawn, because they need script.

What a visitor sees when the time is up

The price is worked out by Phoca Cart when the page is built. It is not asked for again while the page is open.

A visitor who leaves the page open sees this when the end moment passes. The clock and the sentence about the end date are replaced by the message This offer has ended. The price, the sale text, the stock words and the button of that offer disappear. The product name stays, and it still goes to the product page, where Phoca Cart shows today's price.

The message is written into a status paragraph that is empty until then, so a screen reader announces it once. You can write your own words in Message when the offer has ended.

A visitor who loads the page again no longer gets that sale.

A visitor with scripts switched off, or a page kept by a cache, shows the page as it was built until it is loaded again. The end date in words tells them when the offer ends.

Options

Module tab (Offers)

Options on the Module tab
OptionWhat it doesDefault
TitleAn optional heading above the offers. If you type one, set Show Title to Hide.No title
How many salesThe most sales shown, from 1 to 5. More than one play in a slideshow.1
Show featured products when nothing is on saleShows the products marked as featured when no product is on sale. They have no clock.No
Leave out products that are out of stockLeaves out a product on sale when Phoca Cart has none left. It works only when your shop counts stock.Yes
Show the sale price when the sale needs a larger orderA sale can apply only when a customer orders several of a product. Off shows the usual price. On shows the sale price too.No
Only on these components, Only in these viewsShows the module only on pages of these components and views, for example com_phocacart and category. Separate several with commas.Empty (every page)

Words tab

Options on the Words tab
OptionWhat it doesDefault
Picture, Picture size, Picture sideThe product picture, or the picture set on the sale, or none. The size is one Phoca Cart makes. The side is before or after the words on a wide screen.The product picture, medium, before
Product name heading levelAutomatic is one level below the Title, so the page outline never skips a level.Automatic
Price size, Products with optionsHow big the price is. For a product whose price depends on options, From and to or From only. A range shows only when the card has no crossed-out price: for featured products shown when nothing is on sale, and for sales that apply only to a larger order while the option above is off. A card that shows a sale price shows that price alone.Large, From and to
Show the product's short textThe start of the product's description, as plain text, cut at a word.No
Show the sale's own textThe text written for the sale itself in Phoca Cart.Yes
Show how many are in stockThe number in stock, with words before and after. It works only when your shop counts stock.No
Button, Button words, style and sizeA button that goes to the product page, or no button.A link, large

Countdown tab

Options on the Countdown tab
OptionWhat it doesDefault
Show the days, hours, minutes, secondsWhich units the clock counts. Turn the days off and the hours show every hour left.Days, hours and minutes
Look, Number sizeEach unit in a box or numbers only, and how big the numbers are.Boxes, small
Words before the date, Words after the dateThe words round the date in the sentence about the end of the offer.Offer ends on
Message when the offer has endedShown in place of the price and the clock when the time is up.This offer has ended.

The Layout tab has the General, Spacing, Width, Colour scheme and Background groups. The Slideshow tab has the speed, auto play, arrows and dots. The Animation tab has the Animation group.

What the Phoca Cart module had that this one does not

  • Free positioning of each part. Phoca Cart's module takes a box of CSS for each part. This module has one set arrangement, with a picture beside the words, and a Background group for the band.
  • Background video and moving background pictures. A video that plays by itself needs its own pause, makes the page heavy, and cannot carry readable words.
  • Animate.css and Swiper. They are not loaded. The slideshow is the Webal Blocks slider.
  • An add to cart button. The offer has a button to the product page, as Phoca Cart's module does.

What has and has not been checked

  • Joomla and Phoca Cart versions. The tests ran on Joomla 6.2 with Phoca Cart 6.1.9.
  • Time zones. The test shop uses UTC. In another time zone Phoca Cart's own list and its price rule can disagree by a few hours on the last day of a sale. The module follows the price rule.
  • Browsers. The browser tests used one browser. Safari and Firefox have not been tried, and no screen reader was used.
  • Customers in special groups and other currencies. They were not checked in a browser.
  • Caches. A page kept by a page cache was not tried.

Other ways to reach us

Ask the community