growtask/simflex-catalog

Catalog plugin for Simflex

dev-master 2024-06-11 07:24 UTC

This package is auto-updated.

Last update: 2024-11-11 08:18:36 UTC


README

Installation

  1. composer require growtask/simflex-catalog
  2. Add all components to routes.php
  3. Init PriceManager in Init.php:
Container::set('price', new PriceManager());
  1. Init sessions:
if (SF_LOCATION == SF_LOCATION_SITE) {
    \App\Extensions\Catalog\CategoryAssist::loadCounts();

    $user = Container::getUser();
    \App\Extensions\Catalog\SessionAssist::$cart = \App\Extensions\Catalog\Model\Cart::getOrInsert(
        $user ? $user->user_id : 0
    );
    \App\Extensions\Catalog\SessionAssist::$fav = \App\Extensions\Catalog\Model\Fav::getOrInsert(
        $user ? $user->user_id : 0
    );
    \App\Extensions\Catalog\SessionAssist::$compare = \App\Extensions\Catalog\Model\Compare::getOrInsert(
        $user ? $user->user_id : 0
    );
}