Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1194552
Add an extra add-to-cart button on mobile screens
Closed

Comments

  •  3
    MobileGear started the conversation

    On mobile screens (767px and down) the add-to-cart-button is too far down on single product pages in my opinion. I would like to add an extra add-to-cart button just below the product image gallery but only on mobile devices with screen size 767px and lower. 

  •  7,122
    Oliver replied

    Hi!

    You can add this buttons with next filter:

    add_action( 'thegem_woocommerce_single_product_left', 'thegem_woocommerce_single_variation_add_to_cart_button', 10 );
    

    And hide it for the large screen resolution with following css:


    @media (min-width: 768px) {
    .single-product-content-left .variations_button {
        display: none;
    }
    }
    


    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •  3
    MobileGear replied

    Thanks, I added the filter to the woocommerce.php and it showed an extra button on the product page. The downside is that this button is not working and not showing the product variation options,

    I added this line instead: 
    add_action( 'thegem_woocommerce_single_product_left', 'woocommerce_template_single_add_to_cart', 10 );

    This seems to work fine for me as it is an exact copy of the original button with variation options when these are available.

  •  3
    MobileGear replied

    After updating the them to the latest version, the button is gone. It looks like the filter is still in the woocommerce.php file but the extra button doesn't show up. It's also not working with the filter you sent me.

  •  3
    MobileGear replied

    My bad, I made a typo :D