Shop

The shop plugin is an online store: a product catalogue with categories, manufacturers, attributes and product sets, a basket, an order flow (delivery, payment, finish) and the customer's order history. It ships with yf in plugins/shop/ today and will move to the plugins repository as a separate package, with the same class names, table names, templates and routes, so a site that uses it keeps working.

The store pages

The user module shop serves the store: ?object=shop lists the categories and products, the basket and the order steps are actions of the same module (shop/basket, shop/order). Its sitemap hook (_site_map_items()) adds the store pages to /sitemap.xml, and its meta tag hook gives the product pages their title and description.

Extending it on a site

  • Classes keep the yf_ prefix: a site changes the store with class shop extends yf_shop in its own modules/ folder, as with any framework module.
  • Templates live in plugins/shop/templates/user/shop/; a site overrides one by putting a file of the same path in its own templates folder (the template manager shows the layers).
  • Product images go below the uploads folder, shop/products/ by default (shop.PROD_IMG_DIR).
  • The plugin's tables all start with shop_; the installer creates them from plugins/shop/share/db/.