Hello,
I am not especially good with Javascript and I am having a little trouble trying to implement a floating cart trigger solution.
Basically the developer has given a function that toggles the cart and I am trying to use an event listener to implement it when the woocommerce cart button is clicked.
xt_woofc_toggle_cart()
Ive added the following element in the backend, but it wont seem to trigger the cart.
<script>
document.getElementClassName(“shopping-bag”).addEventListener(“click”, floatCart);
function floatCart() {
xt_woofc_toggle_cart();
}
</script>
If I run it in the console it does seem to work. Any tips?
Best,
Peter