Kênh 360 Công Nghệ Kênh 360 Công Nghệ

Trang chủ - PrestaShop - Hướng dẫn - Cách tạo thêm trang cho Prestashop

Cách tạo thêm trang cho Prestashop

Không khó để tạo thêm trang cho website thương mại điện tử Prestashop, chỉ cần viết code 1 file php và 1 file template tpl cùng tên là bạn có thể tạo thêm 1 trang mới.

Trong file php bạn cần chèn đoạn code sau và thay đổi tên file extrapage.tpl theo ý bạn

File extrapage.php

Code:

 <?php

include(dirname(__FILE__).'/config/config.inc.php');
include(
dirname(__FILE__).'/header.php');

$data = array_map(array('Tools', 'safeOutput'), Configuration::getMultiple(array('PS_SHOP_NAME', 'PS_SHOP_PHONE', 'PS_SHOP_ADDR1', 'PS_SHOP_ADDR2', 'PS_SHOP_CODE', 'PS_SHOP_CITY', 'PS_SHOP_COUNTRY', 'PS_SHOP_DETAILS')));
$smarty->display(_PS_THEME_DIR_.'extrapage.tpl');

include(
dirname(__FILE__).'/footer.php');

?>

Trong file extrapage.tpl chèn đoạn code sau vào đầu trang và viết nội dung trang sau đoạn code này

Code:.

{capture name=path}{l s='extra page'}{/capture}
{include file
=$tpl_dir./breadcrumb.tpl}
<!--your code-->

Lưu file extrapage.php vào thư mục root của site. Ví dụ: /prestashop/extrapage.php và lưu file tpl vào thư mục theme. Ví dụ: /themes/extrapage.tpl.

Bài viết có tham khảo jhnstck từ pretashop forums



Tin liên quan:
Tin mới hơn:
Tin cũ hơn:

Lần cập nhật cuối ( Thứ bảy, 15 Tháng 8 2009 19:28 )  

Kênh 360 công nghệ

  • Nổi bật
  • Tin mới
  • Game mới
  • PrestaShop Guide
  • PrestaShop

Có thể bạn quan tâm

Download nhiều nhất

11/12
Download PES 2011 - FIFA 11
693
18/12
binkw32 dll
175
18/12
TeamViewerQS
49
English French German Japanese Korean