Custom HTML component attach to button

Can you attach a custom HTML snippet to a button? TIA

Depends exactly what you’re trying to achieve :slight_smile:

If you have an example of what you want to do I can give you a suggestion of how to achieve it in Elements.

Dan showed me how to add Code snippets from Cartloom to site last week and I can add these but it just shows page which is fine as I need this. However I want to attach the snippet to a “buy” button as I have 5 products and 3 categories. I want to add a buy button that when opened opens the various categories/products etc. individually - I have all the code snippets from Cartloom. TIA

Can you post the code snippet that you’re trying to attach to a button?
A link to the cartloom docs that talks about what you’re trying to do would also be useful!

The more details we have about the problem you’re trying to solve, the better we’ll be able to solve it :blush:

First of all you you helped me last week get code snippet into HTML by showing me the custom HTML bit. That works great and opens page on the “page” I am designing. I want to add a snippet to a button so I can have a buy now next to each product group. here is an example of the snippet code which if you place into HTML custom you will see page come up. My current site is compression.solutions which is done in foundation and needs updating hence why I am learning ELEMENTS. TIA


<!--// CartLoom v5 Snippet for Digital Product //-->
<script data-cartloom-pid="193006">
 if (typeof Cartloom === "undefined") {
	var Cartloom = {};
	(function(){
	 var script = document.createElement("script"); 
	script.src = "https://compressionsolutions.cartloom.com/v5/cart.js";
	 document.body.appendChild(script);
	})();
 }
</script>
<noscript>
	<a href="https://compressionsolutions.cartloom.com/v5/cart/quickbuy/193006" target="_blank">Buy Now</a>
</noscript>

PS I am not trying to sell this product to you! :slight_smile:

I can’t post the HTML Apologies it turns it into link. Now I look and snippet there! DOH!!

I’m not familiar with exactly how catrloom works, and I’m not 100% sure on what you want to do, but I gave it a go…

Hope that helps!

Wow nearly! When you press the buy button I want it to bring up what you have in second column i.e. product details. I don’t want it to go straight to cart as they might need to chose size and order an attachment. They might need to read details of product first. I want to replicate my “shop all now” and various individual buttons once I learn how to attach the snippets to a button. (compression.solutions)