Nigel_Duff Posted May 3, 2021 Share Posted May 3, 2021 Site URL: https://www.ornointeriors.com.au/shop-categories I would like to change some text linked to a /contact page to a button. Using the code found here https://forum.squarespace.com/topic/192022-adding-button-throughout-the-website/#comment-456355 (thanks Creedon) works for all products on that page. eg: https://www.ornointeriors.com.au/chest-of-drawers-dressers However I would like to add a button for individual physical product pages that are POA. eg: https://www.ornointeriors.com.au/dining-chairs/paloma-side-chair Does anyone have any suggestions, is this possible using tags with CSS linked to code? Link to comment
Nigel_Duff Posted May 3, 2021 Author Share Posted May 3, 2021 Strange. I had to open the chest-of-draws pages in new tabs for the button to show. https://www.ornointeriors.com.au/chest-of-drawers-dressers/louis-chest-painted Link to comment
creedon Posted May 13, 2021 Share Posted May 13, 2021 Add the following to Store Settings > Advanced > Page Header Code Injection for the store page. <script> /* is product detail page tagged with poa Version : 0.1d0 SS Versions : 7.0, 7.1 v7.0 Templates : Brine ( Aria, Blend, Cacao, Clay, Fairfield, Feed, Foster, Greenwich, Hatch, Heights, Hunter, Hyde, Impact, Jaunt, Juke, Keene, Kin, Lincoln, Maple, Margot, Marta, Mentor, Mercer, Miller, Mojave, Moksha, Motto, Nueva, Pedro, Pursuit, Rally, Rover, Royce, Sofia, Sonora, Stella, Thorne, Vow, Wav, West ) your template is not listed? then it is not currently supported Dependancies : jQuery add button after add to cart button of product detail page v0.2d0 By : Thomas Creedon < http://www.tomsWeb.consulting/ > */ const isTaggedPoa = ( ) => { return $( '.ProductItem' ).hasClass ( 'tag-poa' ); }; </script> I have updated my code in the post you cited. In the code change the following line from... const guardProcessor = undefined; ...to... const guardProcessor = isTaggedPoa; Follow the install instructions from the cited post. Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Nigel_Duff Posted May 21, 2021 Author Share Posted May 21, 2021 Thanks Creedon, you are a champion. The only issue left is I have to open the product in a new tab or if I click through then I need to refresh the page. So for; https://www.ornointeriors.com.au/chest-of-drawers-dressers I click one of the items, then refresh and the button shows. Any ideas? Link to comment
creedon Posted May 21, 2021 Share Posted May 21, 2021 I'm thinking the curse of Ajax Loading strikes again! Try turning off Ajax Loading to see if the problem goes away. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Nigel_Duff Posted May 21, 2021 Author Share Posted May 21, 2021 Perfect! Really appreciate your help there and I've learnt some stuff along the way. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.