Exemplo n.º 1
0
 public static function loadGroupByLang()
 {
     $shopId = Context::getContext()->shop->id;
     $langId = intval($_POST['langId']);
     $itemId = intval($_POST['itemId']);
     $item = GroupCategoryLibraries::getGroupLangById($itemId, $langId, $shopId);
     // DB::getInstance()->getRow("Select * From "._DB_PREFIX_."flexiblecustom_modules_lang Where module_id = ".$itemId." AND id_lang = ".$langId." AND id_shop = ".$shopId);
     $response = new stdClass();
     if ($item) {
         $response->name = $item['name'];
         $response->banner = $item['banner'];
         $response->banner_link = $item['banner_link'];
     } else {
         $response->name = '';
         $response->banner = '';
         $response->banner_link = '';
     }
     die(Tools::jsonEncode($response));
 }
Exemplo n.º 2
0
 public function getAllGroup()
 {
     $langId = Context::getContext()->language->id;
     $shopId = Context::getContext()->shop->id;
     $items = DB::getInstance()->executeS("Select DISTINCT g.*, s.name as styleName From " . _DB_PREFIX_ . "groupcategory_groups as g Left Join " . _DB_PREFIX_ . "groupcategory_styles as s On s.id = g.style_id Where g.id_shop = " . $shopId . " Order By g.position, g.ordering");
     $listGroup = '';
     if ($items) {
         foreach ($items as $item) {
             $itemLang = GroupCategoryLibraries::getGroupLangById($item['id'], $langId, $shopId);
             if ($item['status'] == "1") {
                 $status = '<a title="Enabled" class="list-action-enable action-enabled lik-group-status" item-id="' . $item['id'] . '" value="' . $item['status'] . '"><i class="icon-check"></i></a>';
             } else {
                 $status = '<a title="Disabled" class="list-action-enable action-disabled lik-group-status" item-id="' . $item['id'] . '" value="' . $item['status'] . '"><i class="icon-check"></i></a>';
             }
             $listGroup .= '<tr id="gr_' . $item['id'] . '"><td class="center">' . $item['id'] . '</td><td><a class="cat-group" href="javascript:void(0)" item-id="' . $item['id'] . '">' . $itemLang['name'] . '</a></td><td class="center">' . GroupCategoryLibraries::getCategoryLangNameById($item['categoryId'], $langId, $shopId) . '</td><td class="center">' . Hook::getNameById($item['position']) . '</td><td class="center">' . $item['styleName'] . '</td><td class="pointer dragHandle center" ><div class="dragGroup"><div class="positions">' . $item['ordering'] . '</div></div></td><td class="center">' . $status . '</td><td class="center"><a href="javascript:void(0)" item-id="' . $item['id'] . '" class="lik-group-edit"><i class="icon-edit"></i></a>&nbsp;<a href="javascript:void(0)" item-id="' . $item['id'] . '" class="lik-group-delete"><i class="icon-trash" ></i></a></td></tr>';
         }
     }
     return $listGroup;
 }