Giter Site home page Giter Site logo

polavi-project / ecommerce Goto Github PK

View Code? Open in Web Editor NEW
40.0 3.0 22.0 12.18 MB

A powerful and lightweight eCommerce platform using ReactJs, Graphql, PHP, and Mysql.

Home Page: https://polavi.com/

License: Open Software License 3.0

PHP 61.30% JavaScript 36.76% CSS 1.94%
php react ecommerce-platform graphql ecommerce ecommerce-store ecommerce-website reactjs es6 dynamic-import

ecommerce's Introduction

Polavi

A powerful and lightweight eCommerce platform using ReactJs, Graphql, PHP and Mysql.

Features

Polavi backend screenshot

  • Catalog management
    • Category
    • Product
      • Product type and attributes
      • Advance pricing
        • Customer group price
        • Tier price
      • Product custom options - Add custom option to product with extra price
      • Product variants
  • Coupon management
    • Multi type of discount
      • Fixed discount to entire order
      • Percentage discount to entire order
      • Fixed discount to specific products
      • Percentage discount to specific products
      • Buy X get Y
      • Free shipping
    • Complex order and customer condition
  • Order management
  • Customer management

Demo

Demo store

Getting Started

Installation

Please check here for more detail.

Middleware system

declare(strict_types=1);

namespace Polavi\Middleware;

use function Polavi\generate_url;
use Polavi\Services\Http\Request;
use Polavi\Services\Http\Response;
use Polavi\Services\Routing\Router;

class RoutingMiddleware extends MiddlewareAbstract
{
    public function __invoke(Request $request, Response $response, $delegate = null)
    {
        $code = $this->getContainer()->get(Router::class)->dispatch();
        if($code == 404)
            $response->setStatusCode(404);
        else if($code == 405)
            $response->setContent('Method Not Allowed')->setStatusCode(405);
        else {
            $response->addState("currentRoute", $request->attributes->get("_matched_route"));
            $response->addState("currentRouteArgs", $request->attributes->get("_route_args"));
            $response->addState("currentUrl", generate_url($request->attributes->get("_matched_route"), $request->attributes->get("_route_args")));
        }

        return $delegate;
    }
}

Client rendering approach with es6 module dynamic import.

$response->addWidget(
    'category_edit_general',
    'admin_category_edit_inner_left',
    10,
    get_js_file_url("production/catalog/category/edit/general.js", true),
    [
        "id"=>"category_edit_general", 
        "data" => $result->data['generalInfo']
    ]
);

ReactJs template with Area and Widget

$response->addWidget(
    'admin_content',
    'container',
    20,
    get_js_file_url("production/area.js", true),
    [
        "id"=> "content_wrapper",
        "className"=> "content-wrapper"
    ]
);

// Adding a widget to Area
$response->addWidget(
    'admin_footer',
    'content_wrapper',
    20,
    get_js_file_url("production/cms/footer.js", true)
);

Loading data with Graphql and Promise

$this->getContainer()
    ->get(GraphqlExecutor::class)
    ->waitToExecute([
        "query"=>"{generalInfo: category(id: {$request->get('id')} language:{$request->get('language', get_default_language_Id())}){name status description include_in_nav position}}"
    ])
    ->then(function($result) use ($response) {
        /**@var \GraphQL\Executor\ExecutionResult $result */
        if(isset($result->data['generalInfo'])) {
            $response->addWidget(
            'category_edit_general',
            'admin_category_edit_inner_left',
            10,
            get_js_file_url("production/catalog/category/edit/general.js", true),
            [
                "id"=>"category_edit_general", 
                "data" => $result->data['generalInfo']]
            );
        }
    });

Prerequisites

Apache server, PHP 7.3, Mysql 5.6 and 1 free SendGrid account for transactional email Please check here for more detail.

Built With

  • Symfony - Some component from Symfony like HttpFoundation, EventDispatcher
  • React - All of html will be rendered by using ReactJs
  • Graphql-php - A great php framework for graphql
  • Promises - Promises/A+ library for PHP

Contributing

Contributions are welcome and appreciated. I am looking for any feedback or suggestion to improve this project. You can:

  • Submit a bug/issue or suggestion
  • Use this feedback page if you have any idea or feedback about this project
  • Submit a PR

Support / Discussion

If you are facing any problem or just want to discuss about this project, I invite you to join my Discord channel here

ecommerce's People

Contributors

cfoxeny avatar polavi-project avatar treoden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ecommerce's Issues

Error when select shipping method before providing address

Steps:

  1. Go to checkout page
  2. Select shipping address before providing address

Result
Error message show up: "Something wrong. Please try again"

Expected result

  1. Shipping method should not be show up until user provide shipping address
  2. No error message when user select shipping address

Order filter not working

Reproduce
From order list in backend, input value to filter form and hit Enter.

Expected result
Order list should be reloaded with matched orders

Actual result
Nothing happens

Product grid filter not working

Go to backend and navigate to product list
Apply some filter

Expected result
Reload list of product and display matched products

Actual result
Product list does not update after reload

Product edit screen looks like error

Hi,

I tried to create 1 product and then edit it. In editing screen I can not see product general information like when I create it. It shows "Attribute", "Advance price" , "Custom Options", "SEO" and "Images"

Thanks

Google analytics support

Similik is Client-Side Rendering (csr). We need to develop a Reacjs Component to support Google analytics

Can not create address from my account

Reproduce

  • Login and go to my account
  • Try to add new address

Expected result

  • Address created successfully
  • Success message display

Actual result

  • Error display and no address created

Notification is not displayed

Steps to reproduce

  • Go to Admin->Setting->Catalog
  • Save the setting form

Expected result
Notification should display when form setting is saved successfully

Actual result
No message displayed in screen

Admin logout return blank page

Reproduce steps

  • Login to admin
  • Logout

Expected result

  • Logout account
  • Redirect to admin login page

Actual result

  • Logout account
  • Blank page display, user was not redirected back to login page

[Coupon] Order amount condition does not works

Reproduce

  • Create a coupon discount 10% to entire order
  • Set condition is : Oder amount higher or equal $100
  • Add a product with price less than $100 to cart
  • Apply coupon

Expected result

  • Coupon could not be apply and display error message "Invalid coupon"
    Actual result
  • Coupon applied with 10% discount to the cart

[Coupon] Must have product condition is not working

Reproduce

Create a coupon discount 10% to entire order
Set condition is : Order must contain sku "abc"
Add a "not abc" product to cart
Apply coupon

Expected result

Coupon could not be apply and display error message "Invalid coupon"
Actual result
Coupon applied with 10% discount to the cart

Can add more than available qty to shopping cart

Steps:

  • Create a product with quantity is 10, manage stock: Yes
  • Go to frontend and add 11 item to cart
    Result
  • Product is added to shopping cart
    Expected result
  • Display message saying not enough stock
  • Product is not added to shopping cart

[Coupon] Minimum quantity condition does not work

Reproduce

Create a coupon discount 10% to entire order
Set condition is : Minimum quantity in cart is 5
Add 4 products to your cart
Apply coupon
Expected result

Coupon could not be apply and display error message "Invalid coupon"
Actual result
Coupon applied with 10% discount to the cart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.