Initial commit: Sale packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:49 +02:00
commit 14e3d26998
6469 changed files with 2479670 additions and 0 deletions

View file

@ -0,0 +1,36 @@
/** @odoo-module **/
import publicWidget from 'web.public.widget';
import {registry} from "@web/core/registry";
const CouponToasterWidget = publicWidget.Widget.extend({
start() {
let options = {};
const $content = this.$('.coupon-message-content');
const $title = this.$('.coupon-message-title');
if ($content.length) {
Object.assign(options, {message: $content[0].innerHTML});
}
if ($title.length) {
Object.assign(options, {title: $title[0].innerHTML});
}
if (this.$el.hasClass('coupon-info-message')) {
this.displayNotification(Object.assign({type: 'success'}, options));
} else if (this.$el.hasClass('coupon-error-message')) {
this.displayNotification(Object.assign({type: 'danger'}, options));
} else if (this.$el.hasClass('coupon-warning-message')) {
this.displayNotification(Object.assign({type: 'warning'}, options));
}
return this._super(...arguments);
},
});
registry.category("public_root_widgets").add("CouponToasterWidget", {
Widget: CouponToasterWidget,
selector: '.coupon-message',
});
export default CouponToasterWidget;

View file

@ -0,0 +1,13 @@
/** @odoo-module **/
import publicWidget from 'web.public.widget';
publicWidget.registry.WebsiteSaleGiftCardCopy = publicWidget.Widget.extend({
selector: '.o_purchased_gift_card',
/**
* @override
*/
start: function () {
new ClipboardJS(this.$el.find('.copy-to-clipboard')[0]);
}
});