diff --git a/addons/website_sale/static/src/js/website.tour.shop.js b/addons/website_sale/static/src/js/website.tour.shop.js new file mode 100644 index 00000000000..9b2e67e9698 --- /dev/null +++ b/addons/website_sale/static/src/js/website.tour.shop.js @@ -0,0 +1,49 @@ +(function () { + 'use strict'; + + var website = openerp.website; + + var render = website.tour.render; + + website.EditorShopTour = website.EditorTour.extend({ + id: 'shop_tour', + name: "Shop", + init: function (editor) { + var self = this; + var $body = $(document.body); + self.steps = [ + { + stepId: 'welcome-shop', + orphan: true, + backdrop: true, + title: "e-commerce", + content: "Welcome to the e-commerce. This tutorial will help you to create a product.", + template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }), + }, + ]; + return this._super(); + }, + }); + + website.EditorBar.include({ + start: function () { + var menu = $('#help-menu'); + var shopTour = new website.EditorShopTour(this); + var $menuItem = $($.parseHTML('
  • '+shopTour.name+'
  • ')); + var url = new website.UrlParser(window.location.href); + $menuItem.click(function () { + shopTour.reset(); + shopTour.start(); + if (url.pathname !== '/shop') { + window.location.replace('/shop?shop-tutorial=true'); + } + }); + if (url.search.indexOf('?shop-tutorial=true') === 0) { + shopTour.start(); + } + menu.append($menuItem); + return this._super(); + }, + }); + +}()); diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml index 668a982b360..1c12a67b5a9 100644 --- a/addons/website_sale/views/website_sale.xml +++ b/addons/website_sale/views/website_sale.xml @@ -14,6 +14,11 @@ + + + + +