Show Product Subparts only for certain types of products
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Show Product Subparts only for certain types of products
I'm looking to show / hide certain subparts in the product page based on the type of product. Same functionality as seen with variants currently.
Is there a method to do that?
Thanks!
Is there a method to do that?
Thanks!
Re: Show Product Subparts only for certain types of products
Display or hide tabs based on the selected product type is done here:
https://github.com/aimeos/ai-admin-jqad ... ct.js#L729
https://github.com/aimeos/ai-admin-jqad ... ct.js#L729
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Show Product Subparts only for certain types of products
Is there a good method to add an item to that list or do I need to override the entire product.js file? NOTE: to be clear, I'm trying to avoid having my own version of the file.
Re: Show Product Subparts only for certain types of products
You only need to overwrite the Aimeos.Product.Selection.init() method in your custom.js file
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Show Product Subparts only for certain types of products
This doesn't seem to be working, did I miss understand your reply?
Code: Select all
const origInit = Aimeos.Product.Selection.init;
Aimeos.Product.Selection.init = () => {
console.log('Yes, the override worked');
const tab = $(".item-navbar .selection");
['tournament', 'group', 'select'].includes($(".item-basic .item-type").val()) ? tab.show() : tab.hide();
$(".item-product").on("change", ".item-basic .item-type", function() {
['tournament', 'group', 'select'].includes($("option:selected", this).val()) ? tab.show() : tab.hide();
});
};
Re: Show Product Subparts only for certain types of products
here is my manifest file:
Code: Select all
{
"projectName": "tournament-management",
"licenseText": "proprietary",
"pkgs": [{
"name": "tournament-management CSS",
"file": "index-css",
"isDebug": true,
"fileIncludes": [{
"text": "custom.css",
"path": "themes/admin/jqadm/"
}]
},
{
"name": "tournament-management JS",
"file": "index-js",
"isDebug": true,
"fileIncludes": [{
"text": "custom.js",
"path": "themes/admin/jqadm/"
}]
},
{
"name": "CYBN Components",
"file": "components-js",
"isDebug": true,
"fileIncludes":
[{
"text": "searchable-select.js",
"path": "js/components/"
},
{
"text": "cybn-select.js",
"path": "js/components/"
}]
}
],
"resources" : []
}
Re: Show Product Subparts only for certain types of products
Nevermind... I had to force a hard reload on the page and then it worked properly.