In the “Pairs well with” section, it shows a product link instead of a one-click atc button.
Im using the theme Empire for reference
@Tonia_Web gave you general instructions. This is what needs to be done but it’s not quite so simple of a task. It’ll require html, css, liquid, and javscript all depending on how you want it to function. I see that Empire has an unlimited free trial so I may be able to download it into my partner store and work up a little tutorial for you. I won’t have time until this weekend though, if you can’t wait that long you’ll definitely need to reach out to a different Shopify Expert.
Also if you can post your store url I can request access through my partner account and duplicate your theme and work on that. I don’t know how different your theme may be to the default Empire theme, so that would probably be the best route so I’m not giving you conflicting instructions with what you have going on with your codebase. You can send me a private message here if you don’t want to post your store url publicly.
That would be wonderful!
My store URL is: https://f819e8-2.myshopify.com/
And the theme im working on is called “Empire - Ny Hjemmeside”
Hey there Nicki, going to request access but it looks like Shopify has changed some stuff. They have enabled a 4 digit collaborator request code by default, so I can’t just request access. I’ll need you to provide me your collaborator request code:
See here for instructions:
https://help.shopify.com/en/manual/your-account/staff-accounts/collaborator-accounts#require-code
You should probably DM me here unless you want the code to be visible on the forums. Up to you though.
I couldn’t figure out how to DM you, but here is the code:
8947
I think you have to enable messaging in your account. I sent the request over, just accept and I’ll check it out in the morning
I completely forgot to ask, will this cost me anything? And if so, how much and how would I pay?
No, you’re fine. It’s no big deal. I added the button to the Ninthony Editing theme in your store. It’s all I changed, you can check it over and then publish it whenever you’re ready. Here’s a preview link:
https://ritzisenkram.dk/?_ab=0&_fd=0&_sc=1&preview_theme_id=171398824261
Please note that after using a preview link that theme will be cached in your browser until you view the live theme again with the little eye next to the Online Store:
That’s absolutely perfect! How can I change what it says? And can I turn off cart redirect?
So I can make it say, “Læg I kurven”, instead of “Legg I handlekurv”.
You can change what it says by going to your da.json file and Ctrl + F and search for “add_to_cart” – I’ve already updated it for you though.
I made it redirect to cart because there was no feedback after pressing the button, I don’t understand your code well enough to make the notification pop up like when you add the main product, so when it gets added to the cart it would just look like nothing happened. I can change it to give a little alert that you added the product to the cart instead of a redirect if you’d like, but I’m not going to go through the trouble of trying to get the notification popping up.
Also for anyone curious here is the code. What you need to do is create a custom html element, it can be anything. I chose – because his file in question was called complementary-products.liquid:
By using a custom element, you can attach javascript to run any time one of those elements appears on a page. So in his theme.liquid since I didn’t see an immediately obvious javascript file, I just added a script at the bottom of the file right before the closing tag, I added comments in the code kind of explaining what was going on:
Hello, sorry if this is random, but I came across this thread, and it’s exactly what I need for my theme (also using Empire). The only thing is I don’t quite understand how to make a custom element. The rest I can manage, but I don’t know where to put the first code.
nevermind I got it to work. it’s not placed at the bottom but at the side but somehow I like that better. thank you for posting the code though, this helped me a lot!
Not a problem, let me know if you have any other questions. Feel free to DM