Skip to content

Hướng dẫn nâng cấp module shops 4.0.07 lên shops 4.0.09

Hồ Ngọc Triển edited this page Jul 23, 2014 · 8 revisions

Bước 1. Backgoup code, CSDL của module shops

Bước 2. Download shops 4.0.09, copy đè tất cả các file và thư mục lên hệ thống cũ.

Bước 3. Nâng cấp giao diện:

Nếu giao diện bạn đang dùng không phải là default hoặc modern, thực hiện tiếp hướng dẫn bên dưới.

Copy themes/default/modules/shops/compare.tpl, themes/default/modules/shops/print_pro.tpl sang theme đang dùng với đường dẫn tương ứng (ghi đè)

Copy themes/default/modules/shops/block.filter_product.tpl, themes/default/modules/shops/wishlist.tpl sang theme đang dùng với đường dẫn tương ứng

Mở themes/ten-theme/modules/shops/block.cart.tpl

Tìm

<!--  BEGIN: history -->

Thêm lên trên

<!-- BEGIN: wishlist -->
<p class="clearfix">
	<a title="{LANG.wishlist_product}" href="{WISHLIST}">{LANG.wishlist_product}</a> (<span id="wishlist_num_id">{NUM_ID}</span>)
</p>
<!-- END: wishlist -->	

Mở themes/ten-theme/modules/shops/block.search.tpl

Tìm và xóa

<div class="form-group">
	<label>{LANG.detail_source}</label>
	<select name="sourceid" id="sourceid" class="form-control input-sm">
		<option value="0"></option>
		<!-- BEGIN: loopsource -->
		<option {ROW.selected} value="{ROW.sourceid}">{ROW.title}</option>
		<!-- END: loopsource -->
	</select>
</div>

Mở themes/ten-theme/modules/shops/cart.tpl

Tìm và xóa

({unit_config})

Tìm

<td><a title="{title_pro}" href="{link_pro}">{title_pro}</a></td>

Thay bằng

<td>
	<a title="{title_pro}" href="{link_pro}">{title_pro}</a>
	<!-- BEGIN: display_group -->
	<p>
		<!-- BEGIN: group -->
		<span style="margin-right: 10px"><span class="text-muted">{group}</span></span>
		<!-- END: group -->
	</p>
	<!-- END: display_group -->
</td>

Tìm

<td class="money text-right"><strong>{product_price}</strong></td>

Thay bằng

<td class="money text-right"><strong>{PRICE.sale_format} {PRICE.unit}</strong></td>

Mở themes/ten-theme/modules/shops/detail.tpl

Tìm

<a href="{SRC_PRO_LAGE}" title="{TITLE}" rel="shadowbox">

Thay bằng

<a href="{SRC_PRO_LAGE}" title="{TITLE}" <!-- BEGIN: shadowbox -->rel="shadowbox"<!-- END: shadowbox -->>

Tìm

<!-- BEGIN: price -->
<li><p>
	{LANG.detail_pro_price}: <span class="{class_money}">{product_price} {money_unit}</span>
	<!-- BEGIN: discounts -->
	<span class="money">{product_discounts} {money_unit}</span>
	<!-- END: discounts -->
	/ 1 {pro_unit}
</p></li>
<!-- END: price -->

Thay bằng

<!-- BEGIN: price -->
<li><p>
	{LANG.detail_pro_price}:
	<!-- BEGIN: discounts -->
	<span class="money">{PRICE.sale_format} {PRICE.unit}</span> 
	<span class="discounts_money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: discounts -->
	<span class="money">{product_discounts} {money_unit}</span>
	
	<!-- BEGIN: no_discounts -->
	<span class="money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: no_discounts -->
</p></li>
<!-- END: price -->

Tìm và xóa

<!-- BEGIN: source -->
<li><strong>{LANG.detail_source}:</strong> <a href="{link_source}" title="{LANG.detail_source_search}">{source}</a></li>
<!-- END: source -->

Tìm

<!-- END: hometext -->

Thêm xuống dưới

<!-- BEGIN: custom -->
	<!-- BEGIN: loop -->
	<li><p><strong>{custom.lang}:</strong> {custom.title}</p></li>
	<!-- END: loop -->
<!-- END: custom -->

<!-- BEGIN: custom_lang -->
	<!-- BEGIN: loop -->
	<li><p><strong>{custom_lang.lang}:</strong> {custom_lang.title}</p></li>
	<!-- END: loop -->
<!-- END: custom_lang -->

Tìm và xóa

<!-- BEGIN: address -->
<li>
	<strong>{LANG.detail_product_address}:</strong> {address}
</li>
<!-- END: address -->

<!-- BEGIN: note -->
<li>
	<strong>{LANG.cart_note}:</strong> {note}
</li>
<!-- END: note -->

Tìm

<div id="ratedata">

Thêm lên trên

<div class="row">
<!-- BEGIN: group -->
	<!-- BEGIN: items -->
	<div class="col-md-6">
	{GROUP}
	</div>
	<!-- END: items -->
<!-- END: group -->
</div>

<div class="clearfix">&nbsp;</div>

Tìm

<button class="btn btn-default btn-sm disabled">{LANG.detail_share}:</button>

Thêm xuống dưới

<!-- BEGIN: allowed_print -->
<a rel="nofollow" href="{LINK_PRINT}" class="btn btn-default btn-sm" title="Print" id="click_print">
	<em class="fa fa-print fa-lg fb">&nbsp;</em>
</a>
<!-- END: allowed_print -->

Tìm

<span class="pull-left" style="margin: 6px 6px 0">{LANG.title_order}:</span>

Thay bằng

<span class="pull-left text-muted" style="margin: 6px 20px 0">{LANG.product_number}: <strong>{PRODUCT_NUMBER}</strong> {pro_unit}</span>

Tìm

<!-- END: order -->

Thêm xuống dưới

<!-- BEGIN: product_empty -->
<div class="pull-right" style="margin-top: 6px">
	<button class="btn btn-danger disabled">{LANG.product_empty}</button>
</div>
<!-- END: product_empty -->

Tìm

<nav>
	<ul>
		<li><a href="#section-1"><em class="fa fa-bars">&nbsp;</em><span>{LANG.product_detail}</span></a></li>
		<li><a href="#section-2"><em class="fa fa-picture-o">&nbsp;</em><span>{LANG.add_otherimage}</span></a></li>
		<!-- BEGIN: comment_tab -->
		<li><a href="#section-3"><em class="fa fa-comments-o">&nbsp;</em><span>{LANG.detail_comments}</span></a></li>
		<!-- END: comment_tab -->
	</ul>
</nav>

Thay bằng

<nav>
	<ul>
		<li><a href="#section-1"><em class="fa fa-bars">&nbsp;</em><span>{LANG.product_detail}</span></a></li>
		
		<!-- BEGIN: discount_title -->
		<li><a href="#section-4"><em class="fa fa-picture-o">&nbsp;</em><span>{LANG.discount_detail}</span></a></li>
		<!-- END: discount_title -->
		
		<!-- BEGIN: othersimg_title -->
		<li><a href="#section-2"><em class="fa fa-picture-o">&nbsp;</em><span>{LANG.add_otherimage}</span></a></li>
		<!-- END: othersimg_title -->
		
		<!-- BEGIN: comment_tab -->
		<li><a href="#section-3"><em class="fa fa-comments-o">&nbsp;</em><span>{LANG.detail_comments}</span></a></li>
		<!-- END: comment_tab -->
	</ul>
</nav>

Tìm

<div class="content">
	<section id="section-1">{DETAIL}</section>
	<section id="section-2">
		<!-- BEGIN: othersimg -->
		<div class="col-xs-6 col-md-3">
			<a href="{IMG_SRC_OTHER}" class="thumbnail" rel="shadowbox[miss]"><img src="{IMG_SRC_OTHER}" style="max-height: 100px" /></a>
		</div>
		<!-- END: othersimg -->
		<div class="clear">&nbsp;</div>

		<!-- BEGIN: no_otherimage -->
		{LANG.detail_no_otherimage}
		<!-- END: no_otherimage -->
	</section>
	<!-- BEGIN: comment -->
	<section id="section-3">
		<iframe src="{NV_COMM_URL}" onload = "nv_setIframeHeight( this.id )" id="fcomment" style="width: 100%; min-height: 300px; max-height: 1000px"></iframe>
	</section>
	<!-- END: comment -->
</div>

Thay bằng

<div class="content">
	<section id="section-1">{DETAIL}</section>
	
	<!-- BEGIN: discount_content -->
	<section id="section-4">
		<h3>{DISCOUNT.title}</h3>
		<p>{DISCOUNT.begin_time}{DISCOUNT.end_time}, {DISCOUNT.text}</p>
		<ul>
			<!-- BEGIN: items -->
			<li>{ITEMS}</li>
			<!-- END: items -->
		</ul>
	</section>
	<!-- END: discount_content -->
	
	<!-- BEGIN: othersimg -->
	<section id="section-2">
		<!-- BEGIN: loop -->
		<div class="col-xs-6 col-md-3">
			<a href="{IMG_SRC_OTHER}" class="thumbnail" rel="shadowbox[miss]"><img src="{IMG_SRC_OTHER}" style="max-height: 100px" /></a>
		</div>
		<!-- END: loop -->
		<div class="clear">&nbsp;</div>
	</section>
	<!-- END: othersimg -->
	<!-- BEGIN: comment -->
	<section id="section-3">
		<iframe src="{NV_COMM_URL}" onload = "nv_setIframeHeight( this.id )" id="fcomment" style="width: 100%; min-height: 300px; max-height: 1000px"></iframe>
	</section>
	<!-- END: comment -->
</div>

Mở themes/ten-theme/modules/shops/email_new_order.tpl

Tìm

<p>
	&nbsp;
</p>

Thay bằng

<p>{LANG.order_email_review}</p>

Mở themes/ten-theme/modules/shops/main_procate.tpl

Tìm

<div class="caption text-center">

Thêm lên trên

<div class="info_pro">
	<!-- BEGIN: new -->
	<span class="label label-success newday">{LANG.newday}</span>
	<!-- END: new -->
	<!-- BEGIN: discounts -->
	<span class="label label-danger">-{PRICE.discount_percent}%</span>
	<!-- END: discounts -->
</div>

Tìm

<!-- BEGIN: price -->
<p class="price">
	<span class="{class_money}">{product_price} {money_unit}</span>
	<!-- BEGIN: discounts -->
	<br />
	<span class="money">{product_discounts} {money_unit}</span>
	<!-- END: discounts -->
</p>
<!-- END: price -->

Thay bằng

<!-- BEGIN: price -->
<p class="price">
	<!-- BEGIN: discounts -->
	<span class="money">{PRICE.sale_format} {PRICE.unit}</span>
	<span class="discounts_money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: discounts -->
	
	<!-- BEGIN: no_discounts -->
	<span class="money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: no_discounts -->
</p>
<!-- END: price -->

Tìm

 <a href="{LINK}" title="{TITLE}" ><button type="button" class="btn btn-primary btn-xs">{LANG.detail_product}</button></a>

Thay bằng

<!-- BEGIN: product_empty -->
<button class="btn btn-danger disabled btn-xs">{LANG.product_empty}</button>
<!-- END: product_empty -->

<!-- BEGIN: wishlist -->
<a href="javascript:void(0)" title="{TITLE}" ><button type="button" onclick="wishlist({ID}, this)" class="btn btn-primary btn-xs <!-- BEGIN: disabled -->disabled<!-- END: disabled -->">{LANG.wishlist}</button></a>
<!-- END: wishlist -->

Tìm

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
    $(document).ready(function() {$("[data-rel='tooltip']").tooltip();});
</script>
<!-- END: tooltip_js -->

Thay bằng

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
	$(document).ready(function() {$("[data-rel='tooltip']").tooltip({
		placement: "bottom",
		html: true,
		title: function(){return '<p class="text-justify">' + $(this).data('content') + '</p><div class="clearfix"></div>';}
	});});
</script>
<!-- END: tooltip_js -->

Mở themes/ten-theme/modules/shops/main_product.tpl

Tìm

<div class="caption text-center">

Thêm lên trên

<div class="info_pro">
	<!-- BEGIN: new -->
	<span class="label label-success newday">{LANG.newday}</span>
	<!-- END: new -->
	<!-- BEGIN: discounts -->
	<span class="label label-danger">-{PRICE.discount_percent}%</span>
	<!-- END: discounts -->
</div>

Tìm

<!-- BEGIN: price -->
<p class="price">
	<span class="{class_money}">{product_price} {money_unit}</span>
	<!-- BEGIN: discounts -->
	<br />
	<span class="money">{product_discounts} {money_unit}</span>
	<!-- END: discounts -->
</p>
<!-- END: price -->

Thay bằng

<!-- BEGIN: price -->
<p class="price">
	<!-- BEGIN: discounts -->
	<span class="money">{PRICE.sale_format} {PRICE.unit}</span>
	<span class="discounts_money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: discounts -->
	
	<!-- BEGIN: no_discounts -->
	<span class="money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: no_discounts -->
</p>
<!-- END: price -->

Tìm

<a href="{LINK}" title="{TITLE}" ><button type="button" class="btn btn-primary btn-xs">{LANG.detail_product}</button></a>

Thay bằng

<!-- BEGIN: product_empty -->
<button class="btn btn-danger disabled btn-xs">{LANG.product_empty}</button>
<!-- END: product_empty →

<!-- BEGIN: wishlist -->
<a href="javascript:void(0)" title="{TITLE}" ><button type="button" onclick="wishlist({ID}, this)" class="btn btn-primary btn-xs <!-- BEGIN: disabled -->disabled<!-- END: disabled -->">{LANG.wishlist}</button></a>
<!-- END: wishlist -->

Tìm

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
    $(document).ready(function() {$("[data-rel='tooltip']").tooltip();});
</script>
<!-- END: tooltip_js -->

Thay bằng

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
	$(document).ready(function() {$("[data-rel='tooltip']").tooltip({
		placement: "bottom",
		html: true,
		title: function(){return '<p class="text-justify">' + $(this).data('content') + '</p><div class="clearfix"></div>';}
	});});
</script>
<!-- END: tooltip_js -->

Mở themes/ten-theme/modules/shops/order.tpl

Tìm

<td><a title="{title_pro}" href="{link_pro}">{title_pro}</a></td>

Thay bằng

<td>
	<a title="{title_pro}" href="{link_pro}">{title_pro}</a>
	<!-- BEGIN: display_group -->
		<p>
		<!-- BEGIN: group -->
		<span class="text-muted" style="margin-right: 10px">{group}</span>
		<!-- END: group -->
		</p>
	<!-- END: display_group -->
</td>

Tìm

<!-- BEGIN: price2 -->
<td class="money" align="right"><strong>{product_price}</strong></td>
<!-- END: price2 -->

Thay bằng

<td class="money" align="right"><strong>{PRICE.sale_format}</strong></td>

Mở themes/ten-theme/modules/shops/payment.tpl

Tìm

<td><a title="{product_name}" href="{link_pro}">{product_name}</a></td>

Thay bằng

<td>
	<a title="{product_name}" href="{link_pro}">{product_name}</a>
	<!-- BEGIN: display_group -->
	<p>
		<!-- BEGIN: group -->
		<span class="text-muted" style="margin-right: 10px">{group}</span>
		<!-- END: group -->
	</p>
	<!-- END: display_group -->
</td>

Tìm

<div class="alert alert-info">
	{intro_pay}
</div>

Thay bằng

<div class="panel panel-default">
	<div class="panel-body">
		{intro_pay}
	</div>
</div>

Mở themes/ten-theme/modules/shops/search_all.tpl

Tìm và xóa

<div class="col-xs-6">
	<select name="sourceid" id="sourceid1" class="form-control">
		<option value="0">{LANG.source_title}</option>
		<!-- BEGIN: loopsource -->
		<option {ROW.selected} value="{ROW.sourceid}">{ROW.title}</option>
		<!-- END: loopsource -->
	</select>
</div>

Tìm

<div class="caption text-center">

Thêm lên trên

<div class="info_pro">
	<!-- BEGIN: newday -->
	<span class="label label-success newday">{LANG.newday}</span>
	<!-- END: newday -->
	<!-- BEGIN: discounts -->
	<span class="label label-danger">-{PRICE.discount_percent}%</span>
	<!-- END: discounts -->
</div>

Tìm

<!-- BEGIN: price -->
<p class="price">
	<span class="{class_money}">{product_price} {money_unit}</span>
	<!-- BEGIN: discounts -->
	<br />
	<span class="money">{product_discounts} {money_unit}</span>
	<!-- END: discounts -->
</p>
<!-- END: price -->

Thay bằng

<!-- BEGIN: price -->
<p class="price">
	<!-- BEGIN: discounts -->
	<span class="money">{PRICE.sale_format} {PRICE.unit}</span>
	<span class="discounts_money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: discounts -->
	
	<!-- BEGIN: no_discounts -->
	<span class="money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: no_discounts -->
</p>
<!-- END: price -->

Tìm

<a href="{LINK}" title="{TITLE}" ><button type="button" class="btn btn-primary btn-xs">{LANG.detail_product}</button></a>

Thay bằng

<!-- BEGIN: product_empty -->
<button class="btn btn-danger disabled btn-xs">{LANG.product_empty}</button>
<!-- END: product_empty -->

<!-- BEGIN: wishlist -->
<a href="javascript:void(0)" title="{TITLE}" ><button type="button" onclick="wishlist({ID}, this)" class="btn btn-primary btn-xs <!-- BEGIN: disabled -->disabled<!-- END: disabled -->">{LANG.wishlist}</button></a>
<!-- END: wishlist -->

Tìm

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
    $(document).ready(function() {$("[data-rel='tooltip']").tooltip();});
</script>
<!-- END: tooltip_js -->

Thay bằng

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
	$(document).ready(function() {$("[data-rel='tooltip']").tooltip({
		placement: "bottom",
		html: true,
		title: function(){return '<p class="text-justify">' + $(this).data('content') + '</p><div class="clearfix"></div>';}
	});});
</script>
<!-- END: tooltip_js -->

Mở themes/ten-theme/modules/shops/view_gird.tpl

Tìm

<h1>{CAT_NAME}</h1>

Thêm bên dưới

<!-- BEGIN: image -->
<img src="{IMAGE}" class="img-responsive" alt="{CAT_NAME}">
<!-- END: image -->

Tìm

<div class="caption text-center">

Thêm bên trên

<div class="info_pro">
	<!-- BEGIN: new -->
	<span class="label label-success newday">{LANG.newday}</span>
	<!-- END: new -->
	<!-- BEGIN: discounts -->
	<span class="label label-danger">-{PRICE.discount_percent}%</span>
	<!-- END: discounts -->
</div>

Tìm

<!-- BEGIN: price -->
<p class="price">
	<span class="{class_money}">{product_price} {money_unit}</span>
	<!-- BEGIN: discounts -->
	<br />
	<span class="money">{product_discounts} {money_unit}</span>
	<!-- END: discounts -->
</p>
<!-- END: price -->

Thay bằng

<!-- BEGIN: price -->
<p class="price">
	<!-- BEGIN: discounts -->
	<span class="money">{PRICE.sale_format} {PRICE.unit}</span>
	<span class="discounts_money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: discounts -->
	
	<!-- BEGIN: no_discounts -->
	<span class="money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: no_discounts -->
</p>
<!-- END: price -->

Tìm

<a href="{link_pro}" title="{title_pro}" ><button type="button" class="btn btn-primary btn-xs">{LANG.detail_product}</button></a>

Thay bằng

<!-- BEGIN: product_empty -->
<button class="btn btn-danger disabled btn-xs">{LANG.product_empty}</button>
<!-- END: product_empty -->

<!-- BEGIN: wishlist -->
<a href="javascript:void(0)" title="{title_pro}" ><button type="button" onclick="wishlist({id}, this)" class="btn btn-primary btn-xs <!-- BEGIN: disabled -->disabled<!-- END: disabled -->">{LANG.wishlist}</button></a>
<!-- END: wishlist -->

Tìm

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
    $(document).ready(function() {$("[data-rel='tooltip']").tooltip();});
</script>
<!-- END: tooltip_js -->

Thay bằng

<!-- BEGIN: tooltip_js -->
<script type="text/javascript">
	$(document).ready(function() {$("[data-rel='tooltip']").tooltip({
		placement: "bottom",
		html: true,
		title: function(){return '<p class="text-justify">' + $(this).data('content') + '</p><div class="clearfix"></div>';}
	});});
</script>
<!-- END: tooltip_js -->

Mở themes/ten-theme/modules/shops/view_list.tpl

Tìm

<h1>{CAT_NAME}</h1>

Thêm bên dưới

<!-- BEGIN: image -->
<img src="{IMAGE}" class="img-responsive" alt="{CAT_NAME}">
<!-- END: image -->

Tìm

<strong><a title="{title_pro}" href="{link_pro}">{title_pro}</a></strong>

Thêm bên dưới

<!-- BEGIN: new -->
<span class="label label-success">{LANG.newday}</span>
<!-- END: new -->

Tìm

<!-- BEGIN: price -->
{LANG.title_price} : <strong class="{class_money}">{product_price} {money_unit}</strong>
<!-- BEGIN: discounts -->
&nbsp; <span class="money">{product_discounts} {money_unit}</span>
<!-- END: discounts -->
<br />
<!-- END: price -->

Thay bằng

<!-- BEGIN: price -->
	{LANG.title_price} : 
	<!-- BEGIN: discounts -->
	<span class="money">{PRICE.sale_format} {PRICE.unit}</span>
	<span class="discounts_money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: discounts -->
	
	<!-- BEGIN: no_discounts -->
	<span class="money">{PRICE.price_format} {PRICE.unit}</span>
	<!-- END: no_discounts -->
<!-- END: price -->

Tìm

<!-- END: contact -->

Thêm bên dưới

<!-- BEGIN: discounts -->
(-{PRICE.discount_percent}%)
<!-- END: discounts -->

Tìm

<a href="{link_pro}" title="{title_pro}"><button class="btn btn-primary btn-xs">{LANG.detail_product}</button></a>

Thay bằng

<!-- BEGIN: product_empty -->
<button class="btn btn-danger disabled btn-xs">{LANG.product_empty}</button>
<!-- END: product_empty -->

<!-- BEGIN: wishlist -->
<a href="javascript:void(0)" title="{title_pro}" ><button type="button" onclick="wishlist({id}, this)" class="btn btn-primary btn-xs <!-- BEGIN: disabled -->disabled<!-- END: disabled -->">{LANG.wishlist}</button></a>
<!-- END: wishlist -->

Bước 4. Nâng cấp cơ sở dữ liệu

  • Tạo file update.php tại thư mục gốc (ngang hàng với mainfile.php) với nội dung sau:
<?php

/**
 * @Project NUKEVIET 4.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2014 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 31/05/2010, 00:36
 */

define( 'NV_SYSTEM', true );

require str_replace( DIRECTORY_SEPARATOR, '/', dirname( __file__ ) ) . '/mainfile.php';
$query = array();
$data = array();
try
{
	$data['active_guest_order'] = 0;
	$data['active_guest_order'] = 1;
	$data['active_wishlist'] = 1;
	$data['tags_alias'] = 0;
	$data['auto_tags'] = 1;
	$data['tags_remind'] = 0;
	
	$result = $db->query( 'SELECT lang, setup FROM ' . $db_config['prefix'] . '_setup_language WHERE setup = 1' );
	while( $row = $result->fetch( ) )
	{
		$result2 = $db->query( "SELECT title, module_data FROM " . $db_config['prefix'] . "_" . $row['lang'] . "_modules WHERE module_file='shops'" );
		while( $row2 = $result2->fetch( ) )
		{
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_catalogs DROP thumbnail";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_catalogs ADD newday TINYINT(4) NOT NULL DEFAULT '3' AFTER numlinks";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_catalogs ADD form VARCHAR(50) NOT NULL DEFAULT '' AFTER newday";
			
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_group DROP thumbnail";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_group DROP numlinks, DROP admins";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_group ADD in_order TINYINT(2) NOT NULL DEFAULT '0' AFTER numpro";
			
			$query[] = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $row2['module_data'] . "_items_group (
			  pro_id int(11) unsigned NOT NULL default '0',
			  group_id int(11) unsigned NOT NULL default '0',
			  PRIMARY KEY (pro_id, group_id)
			) ENGINE=MyISAM";
			
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_rows DROP group_id, DROP source_id";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_rows CHANGE product_price product_price FLOAT NOT NULL DEFAULT '0', CHANGE product_discounts discount_id SMALLINT(6) NOT NULL DEFAULT '0'";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_rows ADD custom TEXT NOT NULL AFTER showprice";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_rows DROP " . $row['lang'] . "_description, DROP " . $row['lang'] . "_keywords, DROP " . $row['lang'] . "_note, DROP " . $row['lang'] . "_address";
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_rows ADD " . $row['lang'] . "_custom TEXT NOT NULL AFTER " . $row['lang'] . "_promotional";
			
			$query[] = "DROP TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_sources";
			
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_block_cat DROP thumbnail";
			
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_orders ADD listgroup TEXT NOT NULL AFTER listprice";
			
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_money_" . $row['lang'] . " ADD round VARCHAR(10) NOT NULL";
			
			$query[] = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $row2['module_data'] . "_discounts (
			  did smallint(6) NOT NULL AUTO_INCREMENT,
			  title varchar(100) NOT NULL DEFAULT '',
			  weight smallint(6) NOT NULL DEFAULT '0',
			  add_time int(11) unsigned NOT NULL DEFAULT '0',
			  edit_time int(11) unsigned NOT NULL DEFAULT '0',
			  begin_time int(11) unsigned NOT NULL DEFAULT '0',
			  end_time int(11) unsigned NOT NULL DEFAULT '0',
			  config text NOT NULL,
			  PRIMARY KEY (did),
			  KEY begin_time (begin_time,end_time)
			) ENGINE=MyISAM";
			
			$query[] = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $row2['module_data'] . "_wishlist (
			  wid smallint(6) NOT NULL AUTO_INCREMENT,
			  user_id int(11) unsigned NOT NULL default '0',
			  listid text DEFAULT '',
			  PRIMARY KEY (wid)
			) ENGINE=MyISAM";
			
			$query[] = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $row2['module_data'] . "_tags (
				 tid mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
				 PRIMARY KEY (tid)
				) ENGINE=MyISAM";
			
			$query[] = "CREATE TABLE IF NOT EXISTS " . $db_config['prefix'] . "_" . $row2['module_data'] . "_tags_id (
				 id int(11) NOT NULL,
				 tid mediumint(9) NOT NULL,
				 UNIQUE KEY sid (id,tid)
				) ENGINE=MyISAM";
			
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_tags ADD " . $row['lang'] . "_numpro mediumint(8) NOT NULL DEFAULT '0',
			 ADD " . $row['lang'] . "_alias varchar(255) NOT NULL DEFAULT '',
			 ADD " . $row['lang'] . "_image varchar(255) DEFAULT '',
			 ADD " . $row['lang'] . "_description text,
			 ADD " . $row['lang'] . "_keywords varchar(255) DEFAULT '',
			 ADD UNIQUE(" . $row['lang'] . "_alias)";
			 
			$query[] = "ALTER TABLE " . $db_config['prefix'] . "_" . $row2['module_data'] . "_tags_id ADD " . $row['lang'] . "_keyword varchar(65) NOT NULL";
			
			foreach( $data as $config_name => $config_value )
			{
				$query[] = "INSERT INTO " . NV_CONFIG_GLOBALTABLE . " (lang, module, config_name, config_value) VALUES('" . $row['lang'] . "', " . $db->quote( $row2['title'] ) . ", " . $db->quote( $config_name ) . ", " . $db->quote( $config_value ) . ")";
			}
		}
	}

	try
	{
		$i = 0;
		foreach( $query as $sql )
		{
			$db->query( $sql );
			$i++;
		}
	}
	catch( PDOException $e )
	{
		echo "Có lỗi xảy ra tại câu truy vấn:<br />" . $query[$i] . "<br />Chi tiết lỗi: " . $e->getMessage( ) . "<br />";
		trigger_error( $e->getMessage( ) );
	}

	die( 'Thuc hien xong' );
}
catch( PDOException $e )
{
	die( $e->getMessage( ) );
}
  • Đăng nhập quản trị site, truy cập đường dẫn http://domain.com/update.php, với http://domain.com là tên miền của bạn.
  • Sau khi nhận được thông báo "Thực hiện xong", xóa file này ra khỏi hệ thống.
  • Nâng cấp thành công.