An E-Commerce package for Laravel with Grafite CMS. Take control of your content and how you sell it! Products, subscriptions, shipping, downloading and more!

Overview

Grafite Commerce

Grafite has archived this project and no longer supports or develops its code. We recommend using only as a source of ideas for your own code.

Commerce - An e-commerce package for Laravel apps using Grafite CMS

Build Status Packagist license

Commerce is a e-commerce package for Grafite CMS. It is an elegant solution for adding an e-commerce platform to your Grafite CMS instance. This means it can be added to existing apps, or fresh installs and setups of the Grafite CMS. You can control: products, subscriptions, transaction history, orders, and some year by year analytics. Utilizing the power of Stripe, you can spin up a store, where you can offer subscriptions, digital products for download, or even physical products for order shipments. Integrate any external services to handle shipping rates, and tracking number updates. Take control of the many things you make, and build the store you've always wanted.

Author(s):

Documentation

Installation

composer require grafite/commerce
composer require laravel/cashier

Don't worry about the laravel cashier installation, the only points of interest are specified below:

Add these to your config/app.php:

Grafite\Commerce\GrafiteCommerceModuleProvider::class,
Laravel\Cashier\CashierServiceProvider::class,

Setup

Then publish the vendor assets etc:

php artisan vendor:publish

Add the following to your app/Http/Kernel.php to the routeMiddleware array:

'isAjax' => \Grafite\Commerce\Http\Middleware\isAjax::class,

Add the following trait to the app/Models/User.php:

use Grafite\Commerce\Services\Concerns\hasFavorites;

Add the following to your app/Providers/RouteServiceProvider.php to the mapWebRoutes method inside the group method as a closure:

require base_path('routes/commerce.php');

Don't worry about the laravel cashier installation, the only points of interest are specified below:

Change your config/services.php to match the following:

'stripe' => [
    'model' => App\Models\UserMeta::class,
    'key' => env('STRIPE_KEY'),
    'secret' => env('STRIPE_SECRET'),
],

Now you need to add the Billable trait to the App\Models\UserMeta::class

use \Laravel\Cashier\Billable;

Then migrate!

php artisan migrate

If you wish to maintain consistency with the store accross your login, user settings etc you can set the extends to @extends('commerce-frontend::layouts.store') Views you may wish to change for optimal consistency:

views/
    auth/
        login.blade.php
        register.blade.php
        passwords/
            email.blade.php
            reset.blade.php
    user/
        password.blade.php
        settings.blade.php

Notes on Grafite CMS & Builder

Grafite Commerce is intented to be used with Grafite CMS so use outside of that context is to be done at your own risk. Similarly, though Grafite CMS is able to be added to any existing Laravel 5.6+ application, the documentation above is assuming you used the Grafite CMS setup command php artisan graifte:cms command, which is heavily integrated with Grafite Builder. If you did not, you may have to make adjustments that are not listed here.

LogisticService

The logistic service is published to your app specifically. The intention is for it to handle hooks on the various events that occur within your store purchase flow. The LogisticService handles the following events:

shipping($user)
getTaxPercent($user)
afterPurchase($user, $transaction, $cart, $result)
afterSubscription($user, $plan)
afterRefundRequest($transaction)
afterRefund($transaction)
cancelSubscription($user, $plan)
afterPlaceOrder($user, $transaction, $cart)
orderCreated($order)
shipOrder($order)
cancelOrder($order)

Extending

With any e-commerce platform there is a need to expand to fit your custom needs. With Grafite Commerce we have made this as easy as possible. We publish out the JavaScript files for cart interaction, and controllers and routes for general "browsing" of your store.


Public files:

  • js/store.js
  • js/card.js
  • js/purchases.js
  • css/shop.css

Within the public directory you will find a couple published CSS and JavaScript files which handle the elements of the Grafite Commerce experience. Feel free to change these as you desire but be mindful of URL changes since they may require route changes.

Controllers

There are a few controllers added to your app in the Grafite Commerce namespace. These are general controllers which you may wish to customize based on your app's setup. This is similar to Grafite CMS in the sense that you may wish to change certain parts. Be very mindful of how much you can impact the functionality of the Grafite Commerce store base by changing these files. Within the following namespace you should find these controllers which can be customized.

app/Http/Controllers/Commerce/
  • CardController.php
  • CartController.php
  • CheckoutController.php
  • FavoriteController.php
  • OrderController.php
  • PlanController.php
  • ProductController.php
  • ProfileController.php
  • PurchaseController.php
  • StoreController.php
  • SubscriptionController.php

Routes

Routes can be customized in the routes/commerce.php file. Be mindful of changes here that can impact your JavaScript files above.

Views

There are Grafite Commerce view files that are published your app which you can modify, however, if you wish to edit the package views then you will need to update them in the resources/commerce directory.

Admin UI

There are some very easy to use Admin components set up with Grafite Commerce but feel free to clone the repo and add as you please.

Config

Grafite Commerce has a handful of config options.

Key Description
name The name of the store
currency The currency for your store, in relation to products
taxes_include_shipping Whether or not you want the taxes to include the shipping rate
store_url_prefix The store URL prefix (if changed you MUST update the published JS files as well)
currencies Available currencies for subscription plan generating
subscriptions If you want to enable/disable subscriptions as items in the store
forms Forms config for commerce components

General Requirements

  1. PHP 7.1.3+
  2. MySQL 5.7+

More Specific Requirements

  1. OpenSSL
  2. Laravel 5.6+
  3. Grafite CMS 3.0+
  4. Stripe Account

Compatibility and Support

Laravel Version Package Tag Supported
5.6.x 2.0.x no
5.4.x - 5.5.x 1.0.x no

License

Grafite Commerce is open-sourced software licensed under the MIT license

Bug Reporting and Feature Requests

Please add as many details as possible regarding submission of issues and feature requests

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Setup error

    Setup error

    I setup the Commerce as the document(https://docs.grafite.ca/commerce/) say,found these problems:

    1. there is no file app/Modules/UserModel.php

    use Grafite\Commerce\Services\Concerns\hasFavorites;

    2 . php artisan vendor:publish ,get error: Uncaught ErrorException: require(xxxx\routes/commerce.php): failed to open stream: No such file or directory in xxxx\app\Providers\RouteServiceProvider.php:59 and i don't find commerce.php in route directory

    Regards hqin

    opened by hqin2013 9
  •  Class Quazar\StoreController does not exist after fresh install

    Class Quazar\StoreController does not exist after fresh install

    Installation went smoothly, after trying to navigate to a view was hitting a 404 page, and then after running php artisan route:list -vvv this is the error I get

    [ReflectionException (-1)]
      Class Quazar\StoreController does not exist
    
    
    Exception trace:
     () at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/Container.php:729
     ReflectionClass->__construct() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/Container.php:729
     Illuminate\Container\Container->build() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/Container.php:608
     Illuminate\Container\Container->resolve() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/Container.php:575
     Illuminate\Container\Container->make() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:728
     Illuminate\Foundation\Application->make() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Routing/Route.php:217
     Illuminate\Routing\Route->getController() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Routing/Route.php:747
     Illuminate\Routing\Route->controllerMiddleware() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Routing/Route.php:708
     Illuminate\Routing\Route->gatherMiddleware() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:151
     Illuminate\Foundation\Console\RouteListCommand->getMiddleware() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:114
     Illuminate\Foundation\Console\RouteListCommand->getRouteInformation() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:86
     Illuminate\Foundation\Console\RouteListCommand->Illuminate\Foundation\Console\{closure}() at n/a:n/a
     array_map() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Support/Collection.php:732
     Illuminate\Support\Collection->map() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:87
     Illuminate\Foundation\Console\RouteListCommand->getRoutes() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Foundation/Console/RouteListCommand.php:75
     Illuminate\Foundation\Console\RouteListCommand->fire() at n/a:n/a
     call_user_func_array() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
     Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
     Illuminate\Container\BoundMethod::callBoundMethod() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
     Illuminate\Container\BoundMethod::call() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Container/Container.php:539
     Illuminate\Container\Container->call() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Console/Command.php:182
     Illuminate\Console\Command->execute() at /home/vagrant/projects/personal/quarx/vendor/symfony/console/Command/Command.php:264
     Symfony\Component\Console\Command\Command->run() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Console/Command.php:167
     Illuminate\Console\Command->run() at /home/vagrant/projects/personal/quarx/vendor/symfony/console/Application.php:869
     Symfony\Component\Console\Application->doRunCommand() at /home/vagrant/projects/personal/quarx/vendor/symfony/console/Application.php:223
     Symfony\Component\Console\Application->doRun() at /home/vagrant/projects/personal/quarx/vendor/symfony/console/Application.php:130
     Symfony\Component\Console\Application->run() at /home/vagrant/projects/personal/quarx/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122
     Illuminate\Foundation\Console\Kernel->handle() at /home/vagrant/projects/personal/quarx/artisan:35
    
    opened by artemartemov 5
  • missing routes/quazar.php

    missing routes/quazar.php

    i get this error when traying to run php artisan vendor:publish

    App\Providers\RouteServiceProvider::App\Providers\{closure}(): Failed opening required '/home/u432927737/public_html/taspagrafer _site/routes/quazar.php' (include_path='.:/opt/alt/php71/usr/share/pear') i can't find routes/quazar.php in my routes folder.

    opened by therobb 1
  • Just an FYI

    Just an FYI

    In the website documentation on https://docs.quarxcms.com/quazar/

    this line: require base_path('routes/quazar.php'); Should be after the php artisan vendor:publish

    opened by bgies 1
  • CMS package doesn't support cms.db-prefix for the table user_meta

    CMS package doesn't support cms.db-prefix for the table user_meta

    If I fix the class CreateUserMetaTable to use Schema::create(config('cms.db-prefix', '').'user_meta', function (Blueprint $table) { I will go on this issue:

    In UserService.php line 176:

    We were unable to generate your profile, please try again later.

    The fix from this commit make's a perfect php artisan migrate:fresh --seed

    opened by brBart 0
  • Fix details field formmaker issue

    Fix details field formmaker issue

    There appears to be an old (I think) function which, because it matches the name of the "details" column, confuses the Laracogs FormMaker to the point where details are getting erased on every save. This means that product details get erased on every update.

    opened by jimhlad 0
Releases(v0.0.1)
  • v0.0.1(Mar 3, 2017)

Owner
Grafite Inc
We're passionate about open source code and software products.
Grafite Inc
An eCommerce website is an online store where you can buy or sell products online. An eCommerce offers a professional online store builder that helps you launch your eCommerce business quickly and successfully.

An eCOMMERCE-SITE An eCommerce website is an online store where you can buy or sell products online. An eCommerce offers a professional online store b

UTTKARSH PARMAR 2 Aug 8, 2022
AbanteCart is a free PHP based eCommerce solution for merchants to provide ability creating online business and sell products online quick and efficient.

AbanteCart is a free PHP based eCommerce solution for merchants to provide ability creating online business and sell products online quick and efficient. AbanteCart application is built and supported by experienced enthusiasts that are passionate about their work and contribution to rapidly evolving eCommerce industry. AbanteCart is more than just a shopping cart, it is rapidly growing eCommerce platform

AbanteCart 129 Nov 15, 2022
PHP 7+ Payment processing library. It offers everything you need to work with payments: Credit card & offsite purchasing, subscriptions, payouts etc. - provided by Forma-Pro

Supporting Payum Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our

Payum 1.7k Jan 5, 2023
Subscriptions core package for WooCommerce

WooCommerce Subscriptions Core This package adds core subscriptions functionality to your WooCommerce store. Dependencies WooCommerce WooCommerce Subs

Automattic 43 Dec 20, 2022
Drag and Drop Website Builder and CMS with E-commerce

Microweber: Drag-and-Drop CMS Current version: 1.2 running on Laravel 8! Download | What is Microweber? | Core features of Microweber | Requirements |

Microweber 2.6k Dec 28, 2022
E-commerce solution for October CMS

oc-mall E-commerce solution for October CMS oc-mall is a fully featured online shop solution for October CMS. Manage Products and Variants Virtual pro

OFFLINE GmbH 158 Jan 2, 2023
Laravel eCommerce Pre Order Extension allows the customers and guest users to pre-order the upcoming product and out of stock products.

Introduction Bagisto Pre-order add-on allows the customer to pre-order products which are not yet available at the online store. With the help of Bagi

Bagisto 3 May 31, 2022
GetCandy is a package that brings functionality akin to Shopify and other e-commerce platforms to Laravel.

GetCandy is a set of Laravel packages that bring functionality akin to Shopify and other e-commerce platforms to Laravel. You have complete freedom to

GetCandy 7 Oct 27, 2022
Aimeos is THE professional, full-featured and high performance e-commerce package for Laravel

Aimeos Slim package ⭐ Star us on GitHub — it helps! Aimeos is THE professional, full-featured and high performance e-commerce package for Laravel! You

Aimeos 101 Sep 14, 2022
Commerce GrappQL Package for Laravel

Sailwork Commerce Package for Laravel Document Please read document in here: Document Installation You can install the package via composer: composer

Sail Work 6 May 10, 2021
A Magento 1.9's module to export products informations, inside a chosen date range, to a .XLSX file.

Magento 1.9 Export products module A magento 1.9 module to export products informations to a .XLSX file. Module informations Package/Namespace: "Mathe

Matheus Delazeri 3 Oct 12, 2021
A developer-friendly e-commerce foundation for your Laravel app

laravel-shopr A developer-friendly e-commerce foundation for your Laravel app. All the features you need for your webshop but without sacrificing you

Happy Pixels AB 208 Nov 2, 2022
Zen Cart® is a full-function e-commerce application for your website.

Zen Cart® - The Art of E-Commerce Zen Cart® was the first Open Source e-Commerce web application to be fully PA-DSS Certified. Zen Cart® v1.5.8 is an

Zen Cart 304 Jan 6, 2023
Integrated online shop based on Laravel LTS and the Aimeos e-commerce framework

⭐ Star us on GitHub — it motivates us a lot! ?? Aimeos Laravel ecommerce platform Aimeos is THE professional, full-featured and high performance e-com

Aimeos 3k Jan 5, 2023
Miolica: an e-commerce application that uses React.js as the frontend and Laravel as the backend

Miolica: an e-commerce application that uses React.js as the frontend and Laravel as the backend

Valll 5 Apr 20, 2022
Laravel FREE E-Commerce Software

Laravel FREE E-Commerce Software

Jeff Simons Decena 1.7k Dec 24, 2022
A free open source e-commerce platform for online merchants based on customised version of Laravel.

A free open source e-commerce platform for online merchants based on customised version of Laravel.

Ace Vinayak 58 Oct 19, 2022
E-Commerce Laravel Project

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Mohamed Fadl 2 Dec 10, 2022
A e-commerce website with Laravel, Vue

A eCommerce using Laravel Version: 1.0 Release of the Laravel eCommerce. Technologies and libraries Laravel 7+, PHP 7+. JavaScript & VueJS Framework.

Jackson Zhang 1 Nov 4, 2021