CCE
-
Posts
5 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by CCE
-
-
Just now, creedon said:
That password doesn't work. I can take a look when the password works.
Sorry, I didn't realize I wasn't case sensitive. Password is "clifton"
-
14 minutes ago, creedon said:
Add the following to Settings > Advanced > Code Injection > HEADER.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
Add the following to Store Settings > Advanced > Page Header Code Injection for the store page.
<script> $( ( ) => { /* add button after add to cart button of product detail page SS Versions : 7.0, 7.1 */ const text = 'View Shopping Bag'; const url = '/cart'; const targetAtttributeValue = ''; /* use _self (default, if left empty) | _blank | _parent | _top | framename */ // do not change anything below, there be the borg here const $addToCartButton = $( '.sqs-add-to-cart-button-wrapper' ); if ( ! $addToCartButton.length ) return; const buttonSelector = '.sqs-add-to-cart-button'; let $additionalCartButton = $addToCartButton .clone ( ) .removeAttr ( 'id' ); let $e = $( buttonSelector, $additionalCartButton ) .attr ( 'href', url ) .removeAttr ( 'id ' + 'data-collection-id ' + 'data-item-id ' + 'data-original-label ' + 'data-product-type ' + 'data-use-custom-label' ) .find ( '.sqs-add-to-cart-button-inner' ) .html ( text ) .end ( ); if ( targetAtttributeValue ) $e.attr ( 'target', targetAtttributeValue ); let $anchorTag = $( '<a>' ); $.each ( $e.prop ( 'attributes' ), function ( ) { $anchorTag.attr ( this.name, this.value ); } ); $e .children ( ) .appendTo ( $anchorTag ); $e.replaceWith ( $anchorTag ) $additionalCartButton.insertAfter ( $addToCartButton ); } ); </script>
This is for v7.0 and v7.1.
Let us know how it goes.
I put it in, it works great but it only works when I remove the code I put in to hide the add to cart and quantity options. Once I put my code back in, it also removes the new button.
.product-quantity-input {
display:none !important;
}.sqs-add-to-cart-button-wrapper, {
display:none !important;
} -
Password is Clifton
-
Site URL: https://cliftoncreativeevents.com
I have multiple shop pages but I don't want anyone to be able to purchase anything directly. So I hid the add to cart button and want to add a contact button which links to the form page. But is there a way to have that button pop up on all product pages without having to individually add it in?
Adding button throughout the website?
in Customize with code
Posted
It worked! Just had to deactivate and reactive my css for some reason but then your new code worked!
Thank you so much!