Odoo 9 - ECommerce E.Commerce E.Com merce Syst System em Design Design Cours Course e Đại học CNTT CNTT – Bộ môn Thương Mại Điện Tử Tử
Purpose and Objectives
Phát triển Module UStore (website_sale version 2)
Danh sách các yêu cầu cần phát triển
Theme mới cho trang home & product detail Cài đặt chức năng zoom hình ảnh ở trang product detail Xây dựng chức năng whishlist_ajax (compare tự phát triển) Tất cả đóng gói trong module ecom_ustore và phát triển theo MVC
Development Steps
Display Ustore module on main page menu Template inherited (Qweb, HTML, CSS) Display on customize menu JavaScript with Jquery Odoo Web Controller Ajax Dev
Step 0 – Create new module
ecom_ustore File: __openerp__
{ 'name': "ECommerce UStore", 'version': '1.1', 'description': """ A simple Mobile UStore """, 'depends': ['website'], 'data': ['views/layout.xml'],
}
Step 1 – Menu display
U Store /ustore 50
http://127.0.0.1:8069/ustore
Step 2- Controller for mainpage from openerp import http from openerp.http import request from openerp import tools
class uStore(http.Controller): @http.route('/ustore/', auth='public', website=True)
def initlayout(self, page=0, category=None, search='', ppg=False, **post): return http.request.render(' ecom_ustore.mainpage')
Step 3- New template for shop
Design template or reuse free template HTML template generated from PSD
Step 3- New template for shop (cont)
Copy css, javascript into static folder
Step 3- New template for shop(cont)
Convert html to xhtml format
http://www.csgnetwork.com/cvthtml2xhtml.html
Remove
Replace src="images/ by src="/ecom_ustore/static/images/
(control + F)
(control + F)
Copy needed parts to View (layout.xml)
Step 4- Clone Odoo Ecommerce to UStore(cont)
Clone controller Clone View
A Miracle with Odoo Web Edit content onpage by Snippet Add this tag in any possition
https://www.odoo.com/documentation/9.0/howtos/themes.html
Step bonus
Add snippet below 30% banner
Homework
Homework 1: Phát triển module Ustore (UIT Store) Homework 2: Cài đặt module Whishlist & compare. Yêu cầu: Sử dụng theme khác so với theme default của Website_sale (làm mới trang store& trang chi tiết. Các trang còn lại có thể dùng lại của odoo) Tự triển khai chức năng zoom hình ảnh, wishlist, compare Hoàn thiện tất cả các chức năng cần có của một website bán hàng Tham khảo website_sale