@ -0,0 +1,50 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
Website Model Viewer Widget |
||||
|
=========================== |
||||
|
Experience the product like never before with our stunning 3D |
||||
|
model viewer. Explore every angle and detail of the product right |
||||
|
from our website! |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* It only support 3D images with .glb extension |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developer:(V18): Manasa T P, |
||||
|
(V17): Safa Faheem PE, |
||||
|
(V16): Athira Premanand |
||||
|
Contact: odoo@cybrosys.com |
||||
|
|
||||
|
Contacts |
||||
|
-------- |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
----------- |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
||||
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Technologies (<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import controllers |
||||
@ -0,0 +1,49 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Technologies (<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Website Model Viewer Widget', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Website,eCommerce', |
||||
|
'summary': """Experience the product like never before with our stunning 3D |
||||
|
model viewer.""", |
||||
|
'description': """Website Model Viewer Widget app helps to explore every |
||||
|
angle and detail of the product right from our website!""", |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': "https://www.cybrosys.com", |
||||
|
'depends': ['base', 'product', 'model_viewer_widget', 'website_sale'], |
||||
|
'data': [ |
||||
|
'views/website_sale_templates.xml', |
||||
|
], |
||||
|
'assets': { |
||||
|
'web.assets_frontend': [ |
||||
|
'https://unpkg.com/@egjs/view3d@2.10.1/dist/view3d.pkgd.min.js', |
||||
|
'website_model_viewer_widget/static/src/js/3d_product_view.js', |
||||
|
] |
||||
|
}, |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import website_model_viewer_widget |
||||
@ -0,0 +1,34 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU LESSER |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
||||
|
# (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import http |
||||
|
from odoo.http import request |
||||
|
|
||||
|
|
||||
|
class ProductModel(http.Controller): |
||||
|
"""This class represents a 3D product model""" |
||||
|
@http.route('/product/3d', type='json', auth='none') |
||||
|
def get_product_3d_model(self, product_id): |
||||
|
"""This method returns a 3d model uploaded in the product""" |
||||
|
product = request.env['product.template'].sudo().browse(int(product_id)) |
||||
|
return { |
||||
|
'3D_model': product.model_3d if product.model_3d else False, |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
## Module <website_model_viewer_widget> |
||||
|
|
||||
|
#### 13.09.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial Commit for Website Model Viewer Widget |
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 628 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
After Width: | Height: | Size: 495 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 624 B |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 214 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 310 B |
|
After Width: | Height: | Size: 929 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 576 B |
|
After Width: | Height: | Size: 733 B |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 207 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 911 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 600 B |
|
After Width: | Height: | Size: 673 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 462 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 878 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 653 B |
|
After Width: | Height: | Size: 800 B |
|
After Width: | Height: | Size: 905 B |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 839 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 427 B |
|
After Width: | Height: | Size: 627 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 988 B |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 875 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 767 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 760 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 697 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 73 KiB |
|
After Width: | Height: | Size: 880 KiB |
|
After Width: | Height: | Size: 782 KiB |
|
After Width: | Height: | Size: 42 KiB |
@ -0,0 +1,46 @@ |
|||||
|
/** @odoo-module */ |
||||
|
import publicWidget from '@web/legacy/js/public/public_widget'; |
||||
|
import { rpc } from "@web/core/network/rpc"; |
||||
|
|
||||
|
|
||||
|
publicWidget.registry.product_detail_view_3d = publicWidget.Widget.extend({ |
||||
|
selector: '.o_wsale_product_page', |
||||
|
events: { |
||||
|
'click .product_images':'_3dBtn', |
||||
|
}, |
||||
|
/** |
||||
|
*While clicking the extra image of the product in the website the 3D model |
||||
|
is displayed. |
||||
|
*/ |
||||
|
_3dBtn:function (ev){ |
||||
|
var self = this; |
||||
|
if (this.$(ev.target).data('type') == "3d"){ |
||||
|
this.$('.o_carousel_product_outer')[0].style.setProperty('display', 'none', 'important'); |
||||
|
this.$('#product_main').show() |
||||
|
this.$('#product_main').html('<canvas class="view3d-canvas" style="height: 343px; width: 361px;"/>') |
||||
|
this.$('#3d_image').addClass('active') |
||||
|
this.$('#product_image').removeClass('active') |
||||
|
var product_id = this.$("span[data-oe-model|='product.template']").data('oe-id') |
||||
|
rpc('/product/3d',{ |
||||
|
product_id: product_id} |
||||
|
).then(function(data) { |
||||
|
if (data['3D_model'] != false){ |
||||
|
var val = `data:model/gltf-binary;base64, ${data['3D_model']}`; |
||||
|
self.view3D = new View3D('#product_main', { |
||||
|
src: val |
||||
|
}); |
||||
|
}else{ |
||||
|
var val = `/model_viewer_widget/static/src/assets/3d.glb`; |
||||
|
self.view3D = new View3D('#product_main', { |
||||
|
src: val |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
}else{ |
||||
|
this.$('.o_carousel_product_outer').show() |
||||
|
this.$('#product_main').hide() |
||||
|
this.$('#product_image').addClass('active') |
||||
|
this.$('#3d_image').removeClass('active') |
||||
|
} |
||||
|
}, |
||||
|
}); |
||||
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<template id="product_3d_view" name="Product View" |
||||
|
inherit_id="website_sale.shop_product_carousel"> |
||||
|
<!-- Created a canvas for the 3D model on the website--> |
||||
|
<xpath expr="//div[hasclass('o_carousel_product_outer')]" position="after"> |
||||
|
<div id="product_main" class="view3d-wrapper view3d-square"/> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
|
||||
|
<template id="product_extra_images" name="Product Extra Images View" |
||||
|
inherit_id="website_sale.carousel_product_indicators"> |
||||
|
<!-- Replaced the carousel_product_indicator and added a new one for the 3D model--> |
||||
|
<xpath expr="//div[contains(@t-attf-class, 'o_carousel_product_indicators')]" |
||||
|
position="replace"> |
||||
|
<div t-ignore="True" |
||||
|
t-attf-class="o_carousel_product_indicators {{indicators_div_class}}"> |
||||
|
<ol t-attf-class="carousel-indicators {{indicators_list_class}} position-static pt-2 pt-lg-0 mx-auto my-0 text-start"> |
||||
|
<li t-foreach="product_images" t-as="product_image" class="product_images" |
||||
|
t-attf-class="align-top position-relative active" |
||||
|
data-bs-target="#o-carousel-product" |
||||
|
t-att-data-bs-slide-to="str(product_image_index)" id="product_image"> |
||||
|
<div t-field="product_image.image_128" class="product_images" |
||||
|
t-options='{"widget": "image", "qweb_img_responsive": False, "class": "o_image_64_cover", "alt-field": "name"}'/> |
||||
|
<i t-if="product_image._name == 'product.image' and product_image.embed_code" |
||||
|
class="fa fa-2x fa-play-circle o_product_video_thumb bg-black-50 text-center"/> |
||||
|
</li> |
||||
|
<li class="product_images" data-type="3d" id="3d_image"> |
||||
|
<img src="/website_model_viewer_widget/static/description/assets/360.png" class="product_images" data-type="3d" style="height: 100%; width: 100%; object-fit: contain;"/> |
||||
|
</li> |
||||
|
</ol> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
||||