Ask Your Question

Revision history [back]

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.