I was hoping to be able to hide the Proceed to Che...
# suitecommerce
m
I was hoping to be able to hide the Proceed to Checkout button on the cart using the following code, but it doesn't seem to work.
Copy code
jQuery("#btn-proceed-checkout").hide();
Oh if I put the code in my template instead of the view it will hide the button.
l
@Marvin Do not do it on template file.
☝🏻 1
☝️ 1
instead try to do this
Copy code
var layout = container.getComponent('Layout');
if (layout) {
layout.on('afterShowContent', function () {
							jQuery("#btn-proceed-checkout").hide();
						});
}
👍 1
m
Curious why it doesn't work in the view? I ask because it's in the view that I am fetching the session to determine whether or not to hide.
b
The better way to do it is in your view have a context variable that is a boolean, and in the template use handlebars to determine if it should show or not
m
Yeah normally I would do that. However the button I want to hide is external to my template. In other words if my template shows I want to hide another templates button.
I might just override the entire Order Summary template if it comes down to that being the best method.