Git Product home page Git Product logo

cake-shop's Introduction

shop Plugin

for cakePHP 1.3

eCommerce platform

Installation

  1. Mettre le contenu du plugin dans un dossier newsletter dans app/plugins/
  2. Ajouter les plugins suivant dans "app/plugins" :
  3. Créé la Bd en exécutants les SQL suivant :
    • app\plugins\shop\database.sql
    • app\plugins\paypal_ipn\paypal_ipn.sql
    • le sql retourné par /langviews.php

Configuration

app\config\plugins\shop.php

Configuration de base :

 <?php
     Configure::write('Shop.payment.paypal', array(
         //this is often an email
         'business'=>'[email protected]',
         'devMode'=> true,
     ));
     
     Configure::write('Shop.currencies', array('cad','usd'));
     Configure::write('Shop.currency', 'cad');
     Configure::write('Shop.shippingTypes', array(
         'default'=>array(
             'price'=>50,
             'tax_applied'=>true,
             'descr'=>,
     )));
     
     Configure::write('Shop.emailAdmin', array('to'=>array('[email protected]')));
     Configure::write('Shop.dev.emailAdmin', array('to'=>array('[email protected]')));
     
     Configure::write('Shop.countries', array('CA','US'));
     
     Configure::write('Shop.defaultCountry', 'CA');
     Configure::write('Shop.defaultRegion', 'QC');
 ?>

voir /libs/shop_config.php pour plus d'information

Behavior Shop.Product

Ajouter le behavior "Shop.Product" dans le ou les models qui vont être des produits

var $actsAs = array('Shop.Product');

Intégration

Lien mon panier

Ajouter le helper "Shop.Cart"

var $helpers = array("Shop.Cart");

Pour avoir le nombre d'item le component "Shop.CartMaker" est nécessaire

 <?php 
   echo $this->Cart->cartLink(array('label' => __("Your cart (%nbItem%)",true))); 
 ?>
 <?php 
   //using html in the label
   echo $this->Cart->cartLink(array(
     'label' => __("Your cart <span>%nbItem%</span>",true),
     'escape' => false,
   )); 
 ?>

Afficher le prix

Dans view d'un produit

<?php echo $this->Shop->fullprice(); ?>

Ailleur :

 <?php echo $this->Shop->fullprice($variable_contenant_le_data_du_produit); ?>

Lien Acheter

Dans view d'un produit

 <?php echo $this->Cart->buyLink(array('label'=>__('Add to your cart',true))) ?>

Ailleur :

 <?php echo $this->Cart->buyLink(array('label'=>__('Add to your cart',true),'model'=>'MODEL','id'=>'ID')) ?>

Bouton Acheter avec quantité ou autres options

 <?php if($this->Shop->productDispo()){ ?>
   <?php echo $this->Form->create('ShopCart',array('url'=>$this->Cart->buyUrl(array('routed'=>false)))); ?>
   <?php echo $this->Cart->qteInput(array('label'=>__('Quantité',true))); ?>
   <?php echo $this->Form->submit(__('Add to your cart',true)); ?>
   <?php echo $this->Form->end(); ?>
 <?php } ?>

Admin

Pour ajouter les champs de eCommerce dans les view Add et Edit d'un model

Ajouter le helper "Shop.Shop" dans le controller :

var $helpers = array("Shop.Shop");

À l'intérieur des formulaires des views :

 <?php
   echo $this->Shop->editForm();
 ?>

cake-shop's People

Contributors

hrv52 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.