Ask Your Question
4

What is the way to make the add to cart button in woocommerce stick to the bottom just like it is on Aliexpress for mobile devices?

asked 2022-04-20 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-07-17 18:00:00 +0000

huitzilopochtli gravatar image

To make the add to cart button in WooCommerce stick to the bottom on mobile devices like Aliexpress, you can use CSS code to position it. Here are the steps:

  1. Go to WordPress Dashboard > Appearance > Customize > Additional CSS.
  2. Add the following CSS code:

@media (max-width: 767px) { .single-product .woocommerce .singleaddtocartbutton, .single-product .woocommerce div.product form.cart .grouped_buttons .button {

    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 999;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
    background: #fff;
    padding: 15px;

}

.single-product .woocommerce div.product form.cart {
    padding-bottom: 70px;
}

}

  1. Save and publish the changes.

This code will make the add to cart button fixed at the bottom of the screen on mobile devices. The button will have a white background, box-shadow, and padding. The padding added to the form will prevent the button from overlapping the product description.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-20 11:00:00 +0000

Seen: 6 times

Last updated: Jul 17 '21