Skip to content

Commit

Permalink
Add the opportunity to disable the order detail tab via js (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctippler authored Jun 28, 2024
1 parent 6f4c47a commit 7528628
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Resources/public/js/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ pimcore.registerNS("pimcore.bundle.ecommerce.startup");
* @private
*/
pimcore.bundle.ecommerce.startup = Class.create({

useOrderDetailTab : true,

initialize: function () {
document.addEventListener(pimcore.events.preMenuBuild, this.preMenuBuild.bind(this));
document.addEventListener(pimcore.events.postOpenObject, this.postOpenObject.bind(this));
Expand Down Expand Up @@ -106,7 +109,7 @@ pimcore.bundle.ecommerce.startup = Class.create({

if (pimcore.globalmanager.get("user").isAllowed("bundle_ecommerce_back-office_order")) {

if (e.detail.type == "object" && e.detail.object.data.general.className == "OnlineShopOrder") {
if (e.detail.type == "object" && e.detail.object.data.general.className == "OnlineShopOrder" && this.useOrderDetailTab) {
const tab = new pimcore.bundle.EcommerceFramework.OrderTab(e.detail.object, e.detail.type);
e.detail.object.tab.items.items[1].insert(0, tab.getLayout());
e.detail.object.tab.items.items[1].updateLayout();
Expand Down

0 comments on commit 7528628

Please sign in to comment.