lbCartPlugin
1.0.11stable
for sf 1.4sf 1.3 and Doctrine
MIT
Plus qu'un panier commercial, le "cart" de lbCartPlugin vous permettra de mettre n'importe quel objet ayant le comportement ( actAs ) Cartable dans votre panier. Ainsi, il peut servir pour l'utilisateur à référencer des contacts, des livres, des films, n'importe quel objet présent sur le site finalement, qu'il soit monnayé ou non !
De plus, ce plugin enregistrant les données ajoutées au panier dans une table vous permettront de faire une analyse des produits généralement associés et de pouvoir ainsi faire du cross marketing et proposer ainsi des objets susceptibles d'intéresser l'utilisateur, qu'ils soient commerciaux ou non.
Les multiples paramètres de configuration vous permettront de régler le panier exactement comme vous le voulez, en fonctionnalité comme en apparence.
Vous aurez bientôt accès à un tutoriel vidéo afin de voir un apercu rapide de ce que ca donne sur le site http://leny-bernard.com/fr/afficher/article/lbcartplugin.
Developers
| Name |
Status |
Email |
Leny Bernard |
lead |
moc.liamg <<ta>> dranreb.ynel
|
License
Copyright (c) 2008 Leny Bernard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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.
#sfMultipleAjaxUploadGalleryPlugin v1.1
More than a simple commercial cart, the "cart" of lbCartPlugin will receive any object with behavior (actAs) Cartable. Thus, it can be used for the user to reference contacts, books, movies, and any object present on the site, whether commercial or not!
In addition, this plugin recording the data added to the cart in a table will help you make an analysis of products typically associated and thus be able to do cross marketing and so provide items of interest to the user, whether commercial or not.
The several configuration settings will allow you to adjust the cart just as you want, as design as feature.
You will soon have access to a video tutorial to see a quick overview of what happens on the site http://leny-bernard.com/fr/afficher/article/lbcartplugin.
Requirements and advices
- You have to install the sfJqueryReloadedPlugin to be able to have the jquery helper for ajax functions
- The cart get all the functionnalities when binded with users. For now, the first version just support the sfGuardUser model, so i suggest you to install sfDoctrineGuardPlugin
Tutorial :
you will soon be able to watch a screencast here : Video
you can follow the instructions below
you can follow the instructions in my website :
in english :
http://leny-bernard.com/en/show/article/lbcartplugin
or in french :
http://leny-bernard.com/fr/afficher/article/lbcartplugin
Installation:
In order to install the plugin lbcartplugin :
Type one of these symfony commands :
plugin:install lbcartplugin
OR
Download the file here
Then extract its content in the plugins directory of your project and then add this line in the config/ProjectConfiguration.class.php
$this->enablePlugins('sfDoctrinePlugin','sfJqueryReloadedPlugin','lbCartPlugin');
Get the plugin's resources by typing :
symfony publish-assets
Then clear the cache :
symfony cc
A last task to do is to enable the cart module (frontend) in the /apps/frontend/settings.yml config's folder.
all:
.settings:
enabled_modules: [default, cart]
You can now access to the cart and get its awesome functionnalities.
But for now, you can't add any objects in your cart.
and fill up the correct configuration fields
2 Steps remaining :
actAs : Cartable :~
You have to add the Cartable behaviour to the objects you want to be carted
For example, if you have a model named Film :
Film:
actAs:
Cartable: ~
Timestampable: ~
columns:
user_id:
type: integer
fixed: false
unsigned: false
primary: false
autoincrement: false
This Cartable behaviour will automatically create a TITLE, a DESCRIPTION, an AMOUNT, a PHOTO and a CURRENCY linked to the currency table which store the whole world's devises
Just set a user_id with (or not) the correct relation
- Redefine your own configuration in your app.yml
HERE IS THE DEFAULT CONFIGURATION
app.yml :
all:
lbCartPlugin:
user_class: sfGuardUser # [sfGuardUser,member]
login_field: username # if you use another user class, define here the login field (Mandatory)
login_strict_mode: 1 # 0 => the user haven't to be logged, 1 => he have to be (the cart won't be displayed and won't works).
object_classes_names: # set all the objects you've setted up the Cartable behaviour, usefull for a manual cart add (in backend for example)
- film
- serie
css: /lbCartPlugin/css/cart.css # set here your own style file
images_path: /lbCartPlugin/images/ # set here your home path which will contain your 4 next button's images
images: # define the name of the button's image
add: add_48.png
show: show_48.png
delete: delete_48.png
loader: ajax-loader.gif
labels: # define the button's title attributes
add: + Ajouter à mes favoris
show: Afficher mon panier
delete: Vider mon panier
loader: Enregistrement en cours
*user_class
The user_class_configuration define the kind of users used in your application.
For this first version, you can use sfGuardUser or Member.
If you choose Member, you just have to set a user attribute (in session) named as you mentioned in the login_field configuration item.
Thus, if the user is connected (if not, define this function : $user->isAuthenticated()), we have to get the login by this function $user->getAttribute('login');
Then Build all and load for the currencies :
symfony build --all --and-load --no-confirmation
=== HOW TO USE ===
Now, you will have to include the buttons in the view.
You can add the component by adding those lines :
<?php include_component('cart', 'editbox', array('model' => 'film','id' => $myObject->getId(),'actions'=>array('add','delete','show'))) ?>
You can set the buttons to display by passing an an array named "actions".
The plugin is in a beta mode, some configurations will follow.