Giter Club home page Giter Club logo

happy-shop's Introduction

Happy Shop

This repository contains all the code about the tutorial: Building a Shopping Cart with Symfony 5.

'Shopping Cart View'

The tutorial describes the creation of a shopping cart with Symfony, from scratch and step by step:

Requirements

Getting started

Cloning the repository

$ git clone https://github.com/qferr/happy-shop
$ cd happy-shop/

Installing dependencies

$ composer install

Starting Docker Compose

$ docker-compose up -d

Loading fake Products

$ symfony console doctrine:fixtures:load

Launching the Local Web Server

$ symfony server:start -d

The server started on the port 8000. Open the website http://localhost:8000 in a browser.

Usage

Adding Products to the Cart

From the homepage, go to a product page by clicking on the View details button. Then set a quantity and click on the Add to Cart button.

Removing Products from the Cart

From the cart page, click on the Remove button for the product you want to remove.

Updating the quantity of products in the Cart

From the cart page, enter the desired quantity for the products and click on the Save button.

Clearing the Cart

From the cart page, click on the Clear button.

Purging Expired Carts

From the project directory, execute the following command in a terminal:

$ symfony console app:remove-expired-command

Testing

Configuring a Database for Tests

Create the database and update the database schema by executing the following command:

$ bin/console doctrine:database:create -e test
$ bin/console doctrine:migrations:migrate -e test

For now, the database is empty, load the products fixtures with:

$ bin/console doctrine:fixtures:load -e test

Executing tests

Run the tests with the following command:

$ bin/phpunit

happy-shop's People

Contributors

qferr avatar

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.