Пример #1
0
 public function getDevices($id, $count, $offset, $orderBy, $order)
 {
     if (!isset($orderBy) or empty($orderBy)) {
         $orderBy = "name";
     }
     if (!isset($order) or empty($order)) {
         $order = "ASC";
     }
     if (!isset($count) or empty($count)) {
         $count = "10";
     }
     $product = new Object\Product\Listing();
     $product->setOffset($offset);
     $product->setLimit($count);
     $product->setOrderKey($orderBy);
     $product->setOrder($order);
     if (isset($id) and $id != "") {
         $product->setCondition("o_id='" . $id . "'");
     }
     $i = 0;
     foreach ($product as $key => $value) {
         $imagesArray = array();
         $return = array();
         $imagePropertis = array();
         for ($j = 0; $j < count($value->images->items); $j++) {
             $imagePropertis[$j] = array('imageId' => $value->images->items[$j]->Image->id, 'imageName' => $value->images->items[$j]->ImageName, 'filename' => $value->images->items[$j]->Image->filename, 'path' => $value->images->items[$j]->Image->path);
         }
         if ($value->is_small_product == 1) {
             $small_product = array("type" => $value->specificationLarge->items[0]->type, "quota" => $value->specificationLarge->items[0]->quota, "numberOfUsers" => $value->specificationLarge->items[0]->numberOfUsers, "typeUsage" => $value->specificationLarge->items[0]->typeUsage, "typePreferredNetwork" => $value->specificationLarge->items[0]->typePreferredNetwork, "fieldname" => $value->specificationLarge->items[0]->fieldname);
         } else {
             $small_product = array();
         }
         if ($value->is_large_product == 1) {
             $large_product = array("type" => $value->specificationLarge->items[0]->type, "quota" => $value->specificationLarge->items[0]->quota, "numberOfUsers" => $value->specificationLarge->items[0]->numberOfUsers, "typeUsage" => $value->specificationLarge->items[0]->typeUsage, "typePreferredNetwork" => $value->specificationLarge->items[0]->typePreferredNetwork, "fieldname" => $value->specificationLarge->items[0]->fieldname);
         } else {
             $large_product = array();
         }
         $products[$i] = array('o_id' => $value->o_id, 'o_key' => $value->o_key, 'name' => $value->name, 'slugName' => $value->slugName, 'price' => $value->price, 'images' => $imagePropertis, 'deviceModel' => $value->deviceModel, 'is_large_product' => $value->is_large_product, 'is_small_product' => $value->is_small_product, 'description' => $value->description, 'rrp' => $value->rrp, 'specification' => array("large_product" => $large_product, "small_product" => $small_product));
         $i++;
     }
     if ($i > 0) {
         $status = "success";
         $message = "success";
     } else {
         $status = "failed";
         $message = "data not found";
     }
     $arrayReturn = array("status" => $status, "message" => $message, "data" => $products);
     return $arrayReturn;
 }
Пример #2
0
<?php

$entries = new Object\Product\Listing();
$entries->setLimit("6");
$entries->setOrderKey("oo_id");
$entries->setOrder("desc");
//echo "<pre>"; print_r($this->product); die();
?>
<div class="main-latest">
    <?php 
foreach ($entries as $entry) {
    ?>
    <div class="col-xs-6 col-md-4 frame-product">
        <a href="<?php 
    echo $this->url(array($entry->o_key, $entry->o_id), "product-detail");
    ?>
">
            <div class="imagee-wrapper">

                        <?php 
    foreach ($entry->images as $image) {
        ?>
                            <img src="<?php 
        echo $image->Image;
        ?>
">
                        <?php 
    }
    ?>
                <hr></hr>
                <div class="image-overlay">