Skip to the main content

Webal Phoca Cart shows what is in the visitor's Phoca Cart basket. It can be a small cart icon with a round number and a panel that opens to list the products, or the list of products right in the page, or only the icon and the number.

The number, the total and every price come from Phoca Cart. The module does no sums of its own, so it always agrees with your shop. It takes the place of Phoca Cart's own Cart module.

This module is part of Webal Phoca Blocks, which needs Phoca Cart 6 or later.

Tip. The basket is what Phoca Cart keeps for one visitor while they shop. Every visitor has their own, so the module is never kept by Joomla's cache.

What the visitor sees

  • The icon is a link. It goes to the Phoca Cart page where the visitor reviews the cart and checks out.
  • The number is in a small round badge. It is how many items are in the basket, counting each quantity.
  • The total is the total of the items, as Phoca Cart works it out. Shipping and payment are added at the checkout, so they are not in it.
  • The panel opens from a small button next to the icon. It lists the first products with their quantity and price, the total, and a button to the cart page. It closes when the visitor presses Escape, clicks somewhere else or moves on to another part of the page.

When a visitor adds a product

On Phoca Cart's own pages, the add button of a product works without reloading the page. The number and the total in the module change at once, to the figures Phoca Cart has just confirmed. A screen reader says the new number.

The list of products in the panel is not redrawn at that moment. It is hidden, and a short note with the button to the cart page takes its place. The list is right again on the next page. If scripts are switched off, nothing changes until the next page, and then everything is right.

Add it to a page

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

  1. Log in to the Joomla administrator. In the menu on the left, choose Content, then Site Modules.
  2. Press New. A list of module types opens.
  3. Choose Webal Phoca Cart from the list.
  4. Type a Title for the module. Joomla uses it to name the module in the list.
  5. On the Module tab, under Cart, choose How the cart is shown.
  6. Choose whether to show the number of items and the total, and how many lines to list.
  7. In the right-hand column, open the Position list and choose a position. A position is a named place in your template where a module can go. A place in the header suits an icon with a panel.
  8. Beside Show Title in the same column, choose Hide. Choose Show only if you want Joomla's module title above the cart.
  9. Press Save. The message "Module saved." appears.
  10. Open the Menu Assignment tab. In Module Assignment, choose On all pages for a cart in the header, or Only on the pages selected and tick the pages you want.
  11. Press Save & Close.
  12. Open a page of your site and look at the cart. Put a product in the basket and look again.

Accessibility. If you put more than one Webal Phoca Cart on a page, give each a different module title. The title names the block for screen readers.

Options

Module tab

Options on the Module tab
OptionWhat it doesDefault
TitleAn optional heading above the cart. See the Title group. If you type one, set Show Title to Hide.No title
How the cart is shownAn icon with a panel that opens suits a header. The lines in the page suit a side column. An icon and the count only has no list of products.An icon with a panel that opens
The words beside the iconShown prints the word Cart beside the icon. Hidden keeps the word for screen readers, so the icon link still has a name.Hidden
Own words for the cartThe word used beside the icon and as the name of the link, for example Basket. Leave it empty to use the standard word in the language of the page.Empty
Show the number of itemsThe round badge with the number.Yes
Show the totalThe total of the items, as Phoca Cart works it out.Yes
Where the total showsIn the panel, beside the icon, or both. With the icon and the count only, it is always beside the icon.In the panel
Show a small picture on each lineA small picture of the product beside each line. It is decoration: the product name beside it says the same.No
Lines shownThe most products listed, from 0 to 20. If the basket holds more, a short sentence says how many are not shown. With 0 you see the total and the button only.5
Button to the cart pageA button under the list that goes to the Phoca Cart page. Always, only when the cart has items, or never.Always
Button styleThe look of that button: filled, grey or an outline.Filled
Which edge the panel lines up withA cart at the right of a header opens its panel towards the left, so choose the end. A cart at the left opens it towards the right, so choose the start. With scripts on, the panel also turns round by itself if it would leave the screen. Without scripts it cannot, so choose the edge that suits where the cart is.The end

The Layout tab and the Animation tab hold the shared groups that every Webal module has: General, Spacing, Width, Colour scheme and Animation. They work as they do in the other Webal modules.

Tip. Phoca Cart's own Cart module can show the tax of each line in three columns. The Webal module does not. Those figures need sums that this module does not do. The full breakdown is on Phoca Cart's cart page, which the button opens.

Accessibility

  • The icon link has a name. When the word is not shown, a screen reader still hears it, with the number.
  • The panel opens and closes with the keyboard. Enter or Space opens it, Escape closes it and puts the focus back on its button.
  • Every link and button is at least 44 pixels high and wide. The focus ring is three pixels wide.
  • The small chevron turns only for visitors whose device allows movement. In high contrast mode the number keeps a visible edge.
  • Words that the module prints itself come from language files.

Tips

  • For a header, use An icon with a panel that opens and keep The words beside the icon hidden.
  • Keep Lines shown small. Each line asks the shop a few questions every time the page is shown.
  • If Phoca Cart is switched off, visitors see nothing and you see a notice at the top of the page.
  • If your host or a service in front of your site keeps whole pages, leave the pages of your shop out of it. The module shows each visitor's own basket.

What has been tested

  • Phoca Cart. Version 6.1.9 with its demo shop, as a guest. The count and the total match what Phoca Cart answers after an add, with each of its three add methods. Each line price is printed on Phoca Cart's own cart page.
  • Pages kept by Joomla. With the System - Page Cache plugin switched on, a page with this module on it is not kept for the next visitor.
  • Without scripts. The icon is a link, the panel opens, and the lines and total are in the page.
  • Not tested. A signed-in customer, a site in another language, Joomla 5.4, Safari and Firefox, a store that works out tax by the visitor's country, and a cache outside Joomla.

Other ways to reach us

Ask the community