Block Tìm kiếm nhanh cho shops Nukeviet

Tìm kiếm nhanh cho shops Nukeviet
Buy
global.block_search_fast.php
  • Version: 4.5.00
  • Compatible with: NukeViet 4.0 RC 1,2, NukeViet 4.0 RC 3, NukeViet 4.0 Official, NukeViet 4.1 Beta 1, NukeViet 4.1 Beta 2, NukeViet 4.1 Official, NukeViet 4.2, NukeViet 4.3, NukeViet 4.4, NukeViet 4.5
  • Price: 100.000 VND
  • Buy: 0
  • Download: 0
Bước 1: tải file block về cài đặt tự động
Bước 2: mở modules/shops/theme.php kéo xuống dưới cùng thêm đoạn sau
/** * @param main_search_fast * @return string */function main_search_fast( $data_content ){    global $global_config, $module_info, $nv_Request, $module_info, $global_config, $lang_module, $module_file, $module_name,$pro_config;    $xtpl = new XTemplate( 'block.search_fast.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file );    $xtpl->assign( 'LANG', $lang_module );    $xtpl->assign( 'TEMPLATE', $module_info['template'] );    $xtpl->assign( 'NV_BASE_SITEURL', NV_BASE_SITEURL );    $a = 1;    if( ! empty( $data_content ) )    {        foreach( $data_content as $data )        {            if( $data['homeimgthumb'] == 1 )            {                $data['thumb'] = NV_BASE_SITEURL . NV_FILES_DIR . '/' . $module_name . '/' . $data['homeimgfile'];            }            elseif( $data['homeimgthumb'] == 2 )            {                $data['thumb'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_name . '/' . $data['homeimgfile'];            }            elseif( $data['homeimgthumb'] == 3 )            {                $data['thumb'] = $data['homeimgfile'];            }            else            {                $data['thumb'] = NV_BASE_SITEURL . 'themes/' . $module_info['template'] . '/images/' . $module_file . '/no-image.jpg';            }            $price = nv_get_price($data['id'], $pro_config['money_unit']);            if ($pro_config['active_price'] == '1') {                if ($data['showprice'] == '1' && !empty($data['product_price'])) {                    $xtpl->assign('PRICE', $price);                    if ($price['discount_percent'] > 0) {                        $xtpl->parse('search_content.data.loop.price.discounts');                        $xtpl->parse('search_content.data.loop.price.discounts.standard');                    } else {                        $xtpl->parse('search_content.data.loop.price.no_discounts');                    }                    $xtpl->parse('search_content.data.loop.price');                } else {                    $xtpl->parse('search_content.data.loop.contact');                }            }            $xtpl->assign( 'DATA', $data );            $xtpl->parse( 'search_content.data.loop' );        }        $xtpl->parse( 'search_content.data' );    }    $xtpl->parse( 'search_content' );    return $xtpl->text( 'search_content' );}
Bước 3: Mở file modules\shops\funcs\ajax.php tìm đoạn
if (!defined('NV_IS_MOD_SHOPS')) {    die('Stop!!!');}
thêm vào dưới
$action = $nv_Request->get_string( 'action', 'get', '' );if( $action == 'get_product' ){    $json = array();    $title = nv_substr( $nv_Request->get_title('title', 'get', '', 0 ), 0, 64 );    $title = nv_strtoupper( $title );    $numrow = $nv_Request->get_int( 'numrow', 'get', 0 );    $numrow = ( $numrow > 0 && $numrow < 100 ) ? $numrow : 5;    if( ! empty( $title ) )    {        $and = '';        if( ! empty( $title ) )        {            $alias = change_alias( $title );            if( preg_match( '/[^a-zA-Z0-9[:space:]]/', $title ) )            {                $title = nv_htmlspecialchars( $title );                $and .= " (" . NV_LANG_DATA . "_title REGEXP '" . $db->dblikeescape( $title ) . "' OR " . NV_LANG_DATA . "_alias REGEXP '" . $db->dblikeescape( $alias ) . "' OR product_code=". $db->quote( $title ) .")";            }            else            {                $title = nv_htmlspecialchars( $title );                $and .= " (" . NV_LANG_DATA . "_title LIKE '%" . $db->dblikeescape( $title ) . "%' OR " . NV_LANG_DATA . "_alias LIKE '%" . $db->dblikeescape( $alias ) . "%' OR product_code=". $db->quote( $title ) .")";            }           }        $sql = 'SELECT id, listcatid,' . NV_LANG_DATA . '_title title, ' . NV_LANG_DATA . '_alias alias, product_price, homeimgfile, homeimgthumb, product_code, product_number, product_price, money_unit, showprice,' . NV_LANG_DATA . '_gift_content, gift_from, gift_to FROM ' . $db_config['prefix'] . '_' . $module_data . '_rows          WHERE ' . $and . '        ORDER BY title DESC LIMIT 0, ' . $numrow;        $result = $db->query( $sql );        $data = array();        while( $rows = $result->fetch() )        {            $rows['link'] = nv_url_rewrite( NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_array_shops_cat[$rows['listcatid']]['alias'] . '/' . $rows['alias'] . $global_config['rewrite_exturl'], true );            $data[] = $rows;        }        $json['template'] = main_search_fast($data);    }    header( 'Content-Type: application/json' );    echo json_encode( $json );    exit();}
Bước 4: kích hoạt block search_fast

Đối với bạn nào đang sử dụng shops mặc định có thể tải file thứ 2 (Tìm kiếm nhanh tải về chép đè) về chép đè
License:
Type:
Blocks
Add time:
12/07/2022
Update time:
12/07/2022
Rating:
No rankNo rankNo rankNo rankNo rank
Ranking

Current rating: No rank. Please click on the star below to submit a review!

Click to rate applications

You did not use the site, Click here to remain logged. Timeout: 60 second