how to hide the button add to cart only in backend through client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-15-2022 07:30 AM
Hi,
i should hide the button add to cart only in the backend in the portal the button should be visible , i try it to check
Hide 'Add to Cart' to true not working and i try it No cart it works the button is hiding but it also hidding from the portal
i should hide the button through client script any suggestion please to resolve this issue

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-15-2022 02:47 PM
Hi,
This works for me:
document.getElementById('oi_add_to_cart_button').style.visibility = 'hidden';
Ensure Isolate Script is false:
Before script:
After script:
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-15-2022 03:13 PM
Hi
it works only if i use catalog client script , i cannot use catalog client script because i should hide button for 20 catalog item , when i use this in client script don't work
document.getElementById('oi_add_to_cart_button').style.visibility = 'hidden';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-15-2022 03:16 PM
Hi
it works only if i use catalog client script , i cannot use catalog client script because i should hide button for 20 catalog item , when i use this in client script don't work
document.getElementById('oi_add_to_cart_button').style.visibility = 'hidden';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-16-2022 06:07 AM
Hello,
You would add this as a catalog client script for the catalog items you wish to hide the button on. This should be treated as an edge case scenario and only done on specific catalog items in the manner I've described above. Then, you can disable it at any time for specific catalog items if the need changes once you've created it for that catalog item.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-15-2022 07:40 AM
Hi, Why you are using client script to hide this. Instead you can use below step to hide
Go to Maintain Cart Layouts module and search for record with title "Order this Item". uncheck the "Add to cart checkbox" on the form.
Please mark as correct answer/helpful if it helped.
Regards,
Suresh.
Suresh.