コード例 #1
0
ファイル: session.inc.php プロジェクト: sleekshop/demoshop
 public function GetSession()
 {
     if ($_COOKIE['session'] == "") {
         $sr = new SleekShopRequest();
         $xml = $sr->get_new_session();
         $xml = new SimpleXMLElement($xml);
         $code = (string) $xml->code;
         self::SetSession($code);
     } else {
         $code = $_COOKIE['session'];
     }
     return $code;
 }
コード例 #2
0
ファイル: payment.inc.php プロジェクト: sleekshop/demoshop
 public function GetPaymentMethods()
 {
     $sr = new SleekShopRequest();
     $xml = $sr->get_payment_methods();
     $xml = new SimpleXMLElement($xml);
     $result = array();
     foreach ($xml->payment_method as $method) {
         $piecearray = array();
         $piecearray["id"] = (int) $method->id;
         $piecearray["name"] = (string) $method->name;
         foreach ($method->attributes->attribute as $attr) {
             $piecearray["attributes"][(string) $attr->attributes()->name] = (string) $attr;
         }
         $result[(string) $method->name] = $piecearray;
     }
     return $result;
 }
コード例 #3
0
ファイル: cart.inc.php プロジェクト: sleekshop/demoshop
 public function Refresh($session = "")
 {
     $sr = new SleekShopRequest();
     $xml = $sr->get_cart($session);
     $xml = new SimpleXMLElement($xml);
     $cart = self::get_cart_array($xml);
     setcookie("cart", serialize($cart));
     return $cart;
 }
コード例 #4
0
ファイル: categories.inc.php プロジェクト: sleekshop/demoshop
 public function GetCategories($id_parent = 0, $lang = DEFAULT_LANGUAGE)
 {
     $sr = new SleekShopRequest();
     $xml = $sr->get_categories($id_parent, $lang);
     $xml = new SimpleXMLElement($xml);
     $result = array();
     foreach ($xml->shopcategory as $shopcategory) {
         $piecearray = array();
         $piecearray["id"] = (int) $shopcategory->id;
         $piecearray["label"] = (string) $shopcategory->label;
         $piecearray["permalink"] = (string) $shopcategory->seo->permalink;
         $piecearray["title"] = (string) $shopcategory->seo->title;
         $piecearray["description"] = (string) $shopcategory->seo->description;
         $piecearray["keywords"] = (string) $shopcategory->seo->keywords;
         $piecearray["children"] = self::GetCategories($piecearray["id"], $lang);
         $result[] = $piecearray;
     }
     return $result;
 }
コード例 #5
0
ファイル: order.inc.php プロジェクト: sleekshop/demoshop
 public function DoPayment($id_order = 0, $args = array())
 {
     $sr = new SleekShopRequest();
     $xml = $sr->do_payment($id_order, $args);
     $xml = new SimpleXMLElement($xml);
     $result = array();
     $result["method"] = (string) $xml->method;
     $result["status"] = (string) $xml->status;
     $result["redirect"] = (string) $xml->redirect;
     return $result;
 }
コード例 #6
0
 public function SearchProducts($constraint = array(), $left_limit, $right_limit, $order_columns = array(), $order_type = "ASC", $lang = DEFAULT_LANGUAGE, $needed_attributes = array())
 {
     $sr = new SleekShopRequest();
     $xml = $sr->search_products($constraint, $left_limit, $right_limit, $order_columns, $order_type, $lang, $needed_attributes);
     $xml = new SimpleXMLElement($xml);
     $result["products"] = self::get_products_from_xml($xml);
     $result["count"] = (int) $xml->count;
     return $result;
 }
コード例 #7
0
ファイル: user.inc.php プロジェクト: sleekshop/demoshop
 public function VerifyUser($id_user = 0, $session_id = "")
 {
     $sr = new SleekShopRequest();
     $xml = $sr->verify_user($id_user, $session_id);
     $xml = new SimpleXMLElement($xml);
     $result = array();
     $result["status"] = (string) $xml->status;
     return $result;
 }