2017 © Pedro Peláez
 

symfony-bundle cart-bundle

WTF: Simple Cart Ecommerce Managment

image

jordscream/cart-bundle

WTF: Simple Cart Ecommerce Managment

  • Wednesday, April 27, 2016
  • by jordscream
  • Repository
  • 1 Watchers
  • 9 Stars
  • 131 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

WTFCartBundle, (*1)

WTF ! Simple Cart Ecommerce Managment !, (*2)

Simple: - You have product/item in your project - You want to add and delete products in a ecommerce Cart - You want to have a simple block which displays products in a cart - You want cart entities managment, (*3)

This WTF Bundle is done for you!, (*4)

Symfony 2.3.* Compatible

Step 1: Download WTFCartBundle using composer

Add WTFCartBundle in your composer.json:, (*5)

{
    "require": {
        "jordscream/cart-bundle": "*"
    }
}

Now tell composer to download the bundle by running the command:, (*6)

``` bash $ php composer.phar update jordscream/cart-bundle, (*7)


Composer will install the bundle to your project's `vendor/jordscream` directory. ### Step 2: Enable the bundle Enable the bundle in the kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new WTF\CartBundle\WTFCartBundle(), new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(), ); }

Now add the config.yml the bundle configuration, (*8)

``` yaml, (*9)

wtf_cart: item_class: App\ProductBundle\Entity\Product (put your Product entity) user_class: WTF\UserBundle\Entity\User (put your User entity), (*10)


Update the database and deploy assets web ``` bash $ php app/console doctrine:schema:update --force --complete $ php app/console assets:install web

IMPORTANT:

Define the method __toString in your entity Product, (*11)

USAGE:

To display cart summary:, (*12)

``` twig {{ render(controller("WTFCartBundle:Cart:cart")) }}, (*13)


To add a cart add button in your product ``` twig {% include "WTFCartBundle:Cart:button.html.twig" with {'itemId' : product.id} %}

-- WTF Simple --, (*14)

TODO:

  • page cart detail
  • clear cart button
  • unit test
  • PR :)

The Versions

27/04 2016

dev-master

9999999-dev http://wtf.com

WTF: Simple Cart Ecommerce Managment

  Sources   Download

MIT

The Requires

 

shop ecommerce cart wtf