Shop - Installation and setup


Installation

  1. Add shop plugin (ssh://git@develop.outlast.hu:7999/ofw/plugin-shop.git) to plugins/shop submodule directory.
    In Sourcetree: right click on Submodules in project tree and choose Add Submodule… option.
  2. In /site/index.php add the plugin to the project. To do this, add the shop plugin to the next line $zajconf['plugin_apps'] = array('_project');.
    The result will be $zajconf['plugin_apps'] = array('shop');.
  3. You need to add outlast and user plugins (ssh://git@develop.outlast.hu:7999/ofw/plugin-outlast.git and ssh://git@develop.outlast.hu:7999/ofw/plugin-user.git). To add the plugins, follow the steps above. In /site/index.php shop plugin has to be before the outlast plugin, e.g. $zajconf['plugin_apps'] = array('shop', 'outlast', 'user');
  4. A MySQL database is necessary for the shop plugin. You can check your MySQL settings or create a new one in /site/index.php. After this step you have to update your database (/update/database).
  5. Add $this->zajlib->shop->start() to your default.ctl.php / __load() method
  6. At this point, you can try /admin url. If everything is fine, you’ll be asked to add a new user. Add a new user and log in. If something is wrong, first check if jquery is enabled – open /site/index.php and check line $zajconf['system_apps'] = array('_jquery', '_global');.
  7. After successful login, you will be redirected to add a new shop. Add a new shop and save. If you are not redirected, go to /admin/settings/shop/
  8. If there is an error about transaction.hu_HU.lang.ini, create a file called transaction.hu_HU.lang.ini in /plugins/_project/lang/ directory.
  9. As the last step, add a new currency, status and country in Settings and you have a shop up and running. It’s important to check at least one of the checkboxes for every new status!

Enable friendly URLs

SEO and user-friendly URLs are used throughout the shop to display products, categories, and other items. As typical for OFW, friendly URLs are routed through the __error() method, typically of the default controller. Here’s an example:

Set up templates

As you can see the shop has it’s own error method handler. This will search through everything and display the proper page if it finds the content. You’ll need the following templates in your view folder:

  • shop/category.html
  • shop/category_grid.html (optional)
  • shop/product.html
  • shop/search.html
  • shop/search_grid.html

Take a look Searching and Listing Products

You can also take a look at the examples currently in the shop plugin for a starting point. Then use the shop connections and data and the shop filters and tags documentation to set up the templates with everything you need.

Set up the ordering process

Here are the steps for setting up the rodering process:

Setting up the cron job

You need to set up an automatically running script at http://example.com/shop/autorun/ for each shop. On Linux, this is most easily done via cron. It should run every few minutes for busy shops, but at least once every 15 minutes or so.

What does the automatic script do?

  • disables products no longer in stock
  • verifies transactions (if transaction plugin is enabled)
  • updates automatically calculated prices (based on ECB exchange rates)
Outlast Web & Mobile Development (c) 2023 | Privacy Policy |