mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-28 02:31:59 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" ?><svg id="solid" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><title/><path d="M407.951,343.116a7.2,7.2,0,0,1,.048.733c.121,13.4-15.891,29.5-41.725,41.981C345.344,395.944,309.222,408,256,408s-89.344-12.056-110.274-22.17C119.892,373.348,103.88,357.246,104,343.849a7.2,7.2,0,0,1,.048-.733L115.1,243.624a7,7,0,0,1,9.82-5.615L242.911,290.9a32.043,32.043,0,0,0,26.179,0l117.986-52.89a7,7,0,0,1,9.82,5.615ZM474.988,153.4l-205.9-92.3a32.037,32.037,0,0,0-26.179,0l-205.9,92.3a16,16,0,0,0,0,29.2l205.9,92.3a32.043,32.043,0,0,0,26.179,0L440,198.284v59.874A15.98,15.98,0,0,0,432,272V376h32V272a15.98,15.98,0,0,0-8-13.842V191.111l18.987-8.511a16,16,0,0,0,0-29.2Z" style="fill:#3b3b3b"/></svg>
|
||||
|
After Width: | Height: | Size: 713 B |
Binary file not shown.
|
After Width: | Height: | Size: 295 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 753 KiB |
|
|
@ -0,0 +1,44 @@
|
|||
odoo.define('website_sale_slides.course.join.widget', function (require) {
|
||||
"use strict";
|
||||
|
||||
var CourseJoinWidget = require('@website_slides/js/slides_course_join')[Symbol.for("default")].courseJoinWidget;
|
||||
const wUtils = require('website.utils');
|
||||
|
||||
CourseJoinWidget.include({
|
||||
init: function (parent, options) {
|
||||
this._super.apply(this, arguments);
|
||||
this.productId = options.channel.productId || false;
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Handlers
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* When the user joins the course, if it's set as "on payment" and the user is logged in,
|
||||
* we redirect to the shop page for this course.
|
||||
*
|
||||
* @param {MouseEvent} ev
|
||||
* @override
|
||||
* @private
|
||||
*/
|
||||
_onClickJoin: function (ev) {
|
||||
ev.preventDefault();
|
||||
|
||||
if (this.channel.channelEnroll === 'payment' && !this.publicUser) {
|
||||
const self = this;
|
||||
this.beforeJoin().then(function () {
|
||||
wUtils.sendRequest('/shop/cart/update', {
|
||||
product_id: self.productId,
|
||||
express: 1,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return CourseJoinWidget;
|
||||
|
||||
});
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
odoo.define('website_sale_slides.quiz', function (require) {
|
||||
"use strict";
|
||||
|
||||
const {websiteSlidesQuizNoFullscreen} = require('@website_slides/js/slides_course_quiz');
|
||||
|
||||
websiteSlidesQuizNoFullscreen.include({
|
||||
_extractChannelData: function (slideData) {
|
||||
return _.extend({}, this._super.apply(this, arguments), {
|
||||
productId: slideData.productId,
|
||||
enroll: slideData.enroll,
|
||||
currencyName: slideData.currencyName,
|
||||
currencySymbol: slideData.currencySymbol,
|
||||
price: slideData.price,
|
||||
hasDiscountedPrice: slideData.hasDiscountedPrice
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-extend="slide.course.join">
|
||||
<t t-jquery=".o_wslides_js_course_join_link" t-operation="append">
|
||||
<t t-if="widget.channel.channelEnroll == 'payment'">
|
||||
<t t-if="widget.publicUser">
|
||||
Sign in
|
||||
</t>
|
||||
<t t-else="">
|
||||
Buy this Course
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
<t t-extend="slide.slide.quiz.validation">
|
||||
<t t-jquery=".o_wslides_quiz_join_course_message" t-operation="append">
|
||||
<span t-if="widget.channel.channelEnroll == 'payment'">
|
||||
<t t-if="widget.publicUser">
|
||||
Sign in and buy the course to take the quiz
|
||||
</t>
|
||||
<t t-else="">
|
||||
Buy the course to validate your answers!
|
||||
</t>
|
||||
</span>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-extend="slides.course.unsubscribe.modal.leave">
|
||||
<t t-jquery="p:last" t-operation="after">
|
||||
<t t-if="widget.enroll === 'payment'">
|
||||
<p class="alert alert-warning">
|
||||
<i class="fa fa-exclamation-triangle fa-3x float-start me-3"></i>
|
||||
This course is paid.<br/>
|
||||
Leaving the course and re-enrolling afterwards means that you'll be charged again.
|
||||
</p>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
Loading…
Add table
Add a link
Reference in a new issue