Change link of "Add to cart" button and change colors

Solved
New Member
6 0 0

Hello,

 

What I want to do is to change the link of the "Add to Cart" button for it to transfer directly to cart page.

I also want to change the color of the button or switch it with the "buy now" button which I don't actually need.

 

I use the Theme Debut.

 

Thank you a lot in advance :)

0 Likes
Shopify Partner
1160 95 142

Please Share a Store url to better assist

Thanks & Regards
Perennial Solution

Problem Solved?✔️Like and Accept the solution that can help others.
Need any help with theme customization or design? Hire us
Email: infoperennialsolution@gmail.com
Skype: infoperennialsolution
0 Likes
New Member
6 0 0
0 Likes

Success.

Shopify Expert
2530 425 536

HI @GreenWar 

to change add to cart button color follow this:

1. Go to Online Store->Theme->Edit code
2. Asset->theme.scss->paste bellow code in bottom of file

.product-form__cart-submit {color: white;background: black;border-color: red;}

To redirect to cart page follow this:

1. Asset->theme.js file and find 'add.js' then you have to add location.href="/cart" in success or Done function.

its look like:

 $.post(params)
        .done(
          function(item) {
            this._hideErrorMessage();
           // this._setupCartPopup(item);
location.href="/cart" }.bind(this) )

 

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
New Member
6 0 0

Thank you very much to help me with this! 

 

It worked perfectly to redirect to cart! 

 

About color of button, here is what I want:

 

2.PNG

 

And here is what I get: 

 

1.PNG

 

 

The button disapeared and apears only when I move my mouse over it

0 Likes

Success.

Shopify Expert
2530 425 536

You just forget # before background color:

it should be:

 .product-form__cart-submit { color: white; background: #80AE5B; border-color: white; }
Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
New Member
6 0 0

Oh that's right! Thank you very much once again :)

 

One last little thing, how can I remove the "buy now" button ? 

0 Likes

Success.

Shopify Expert
2530 425 536

go to theme editor->product page and find "Show Dynamic button" option and disable it.

Or you can remove it from code by going Section->product.liquid file->find {{ form | payment_button }} and comment or remove it 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
New Member
6 0 0

It's done, perfect.

 

Thank you a lot for your help! 

 

Have a nice day :)

0 Likes