shopping_cart_action Class Reference

Traitement des action sur le shopping cart par l'intermediaire d'une fonction. More...

Inherits shoppingCart.

List of all members.

Public Member Functions

Static Public Member Functions

Public Attributes

  • $cart
    Panier d'achat client.

Static Protected Attributes

  • static $actionCart = array('load','resetCart','update_product','add_product','add_buy_now','buy_now')

Private Member Functions


Detailed Description

Traitement des action sur le shopping cart par l'intermediaire d'une fonction.

Definition at line 14 of file shopping_cart_action.php.


Constructor & Destructor Documentation

shopping_cart_action::__construct (  ) 

Definition at line 26 of file shopping_cart_action.php.

00026                          {
00027   }


Member Function Documentation

shopping_cart_action::add2_product (  )  [private]

Specifique aca + major oscss generation d'un coupon de la valeur * qty produits.

Definition at line 108 of file shopping_cart_action.php.

00108                                  {
00109     global $page;
00110     if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
00111     $module=$page->new_class('product');
00112     $module=$module->ret_modules();
00113     $product_info =$module['portefeuil']->new_coupon_for_id((int)$_POST['products_id'],tep_output_string_protected($_POST['products_quantity']));
00114     }
00115 
00116   }

shopping_cart_action::add_buy_now (  )  [private]

Definition at line 64 of file shopping_cart_action.php.

00064                                 {
00065     global $cart;
00066     if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
00067       if (tep_has_product_attributes($_POST['products_id'])) {
00068         tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_POST['products_id']));
00069       } else {
00070         $cart->add_cart($_POST['products_id'], $cart->get_quantity($_POST['products_id'])+(int)tep_output_string_protected($_POST['products_quantity']));
00071       }
00072     }
00073   }

shopping_cart_action::add_product (  )  [private]

Definition at line 55 of file shopping_cart_action.php.

00055                                 {
00056     global $cart;
00057     if (isset($_POST['products_id']))
00058       $cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], @$_POST['id']))+(int)tep_output_string_protected($_POST['products_quantity']), @$_POST['id']);
00059   }

shopping_cart_action::addActionExe ( action  )  [static]

add action for customers

Definition at line 33 of file shopping_cart_action.php.

00033                                               {
00034     if(!in_array($action, self::$actionCart)) array_push(self::$actionCart,$action);
00035   }

shopping_cart_action::buy_now (  )  [private]

Definition at line 78 of file shopping_cart_action.php.

00078                             {
00079     global $cart;
00080     if (isset($_GET['products_id'])) {
00081       if (tep_has_product_attributes($_GET['products_id'])) {
00082         tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id']));
00083       } else {
00084         $cart->add_cart($_GET['products_id'], $cart->get_quantity($_GET['products_id'])+1);
00085       }
00086     }
00087   }

shopping_cart_action::cust_order (  )  [private]

Definition at line 92 of file shopping_cart_action.php.

00092                                {
00093     global $cart;
00094     if (tep_session_is_registered('customer_id') && isset($_GET['pid'])) {
00095       if (tep_has_product_attributes($_GET['pid'])) {
00096         tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['pid']));
00097       } else {
00098         $cart->add_cart($_GET['pid'], $cart->get_quantity($_GET['pid'])+1);
00099       }
00100     }
00101   }

shopping_cart_action::init ( action  ) 

Execution des action liée au panier.

NOTE: Les moduels complementaire, sotn appelé par la class order total, qui fournis les metodes de modification Les module ssont prioritaire par rapport au core

Parameters:
$action boolean $_GET['noredirect'] block la redirection apres ajout au panier

force login for shopping cart

chargement des order total , pour calcul cout , reduction.etc

Execution des actions des modules order_totals Si action, pas de suite , redirect contenu dans l'action Les action des modules ot_xxx doivent avoir une methode shopping_cart_action

Definition at line 138 of file shopping_cart_action.php.

00138                                {
00139     global $page, $cart;
00140     $this->action=$action;
00141 
00142     if(!in_array($this->action,self::$actionCart))return;
00143 
00145     if (!_cst_bool('NO_SHOPPING_CART_FOR_GUEST') && !tep_session_is_registered('customer_id') ) {
00146       $navigation=navigation_history::getInstance();
00147       $navigation->set_snapshot();
00148       tep_redirect(FILENAME_LOGIN);
00149     }
00150 
00152     if( ($order_total_modules=$page->return_object('order_total_modules')) ===false){
00153       if(!class_exists('order_total')) require(DIR_WS_CLASSES . 'order_total.php');
00154       $order_total_modules = new order_total(false);
00155       $page->add_object('order_total_modules',$order_total_modules);
00156     }
00157 
00158 
00159     if (_cst_bool('DISPLAY_CART')) {
00160       $goto =  FILENAME_SHOPPING_CART;
00161       $parameters = array('action', 'cPath', 'products_id', 'pid');
00162     } else {
00163       $b=basename($_SERVER['REQUEST_URI']);
00164       $goto = substr($b,0,strpos($b,'?') ) ;
00165       $parameters = array('action', 'pid','language');
00166       unset($b);
00167     }
00168 
00174     $href=$order_total_modules->shopping_cart_action();
00175 
00176     if(!$href)
00177       switch ($action) {
00178         default:
00179           $this->$action();
00180           if(!isset($_GET['noredirect']))  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
00181       }
00182   }

shopping_cart_action::resetCart (  )  [private]

Definition at line 122 of file shopping_cart_action.php.

00122                               {
00123     global $cart;
00124 
00125     $cart->reset(true);
00126   }

shopping_cart_action::update_product (  )  [private]

Definition at line 40 of file shopping_cart_action.php.

00040                                    {
00041     global $cart;
00042     for ($i=0, $n=sizeof($_POST['products_id']); $i<$n; $i++) {
00043       if (isset($_POST['cart_delete']) && in_array($_POST['products_id'][$i], (is_array($_POST['cart_delete']) ? $_POST['cart_delete'] : array()) )) {
00044           $cart->remove($_POST['products_id'][$i]);
00045       } else {
00046         $attributes = (isset($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '');
00047         $cart->add_cart($_POST['products_id'][$i], (int)tep_output_string_protected($_POST['cart_quantity'][$i]), $attributes, false);
00048       }
00049     }
00050   }


Member Data Documentation

shopping_cart_action::$actionCart = array('load','resetCart','update_product','add_product','add_buy_now','buy_now') [static, protected]

Definition at line 24 of file shopping_cart_action.php.

shopping_cart_action::$cart

Panier d'achat client.

Definition at line 19 of file shopping_cart_action.php.

Referenced by add_buy_now(), add_product(), buy_now(), cust_order(), init(), resetCart(), and update_product().


The documentation for this class was generated from the following file: