• harrydevries

    (@harrydevries)


    Hi, i am well aware this is likely a paid support question but try anyway right?

    I would like to have the quantity selector in the sticky add-to-cart. Is there a way to do this?

    if it can be done with a hook filter i will also add my own buy now button for simple products there.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Frank Remmy

    (@frankremmy)

    Hi @harrydevries,

    It’s great that you’re considering enhancing the user experience and adding your own buy now button for simple products as well!

    For adding quantity selectors to the sticky add-to-cart bar in Storefront, this would involve custom code modifications. We are unable to provide support for customizations under our  Support Policy.. You can get help with custom code on our customizations page, our Developer Hub, and in our Developer Slack Community.

    That said, I can point you in the right direction:

    • The sticky add-to-cart functionality in Storefront is often implemented with a template part or via hooks. You should identify which function or template is rendering the sticky bar.
    • Use the WooCommerce function woocommerce_quantity_input() to display the quantity selector in your custom template or hook output. For example:
    
       woocommerce_quantity_input( array(
           'input_name'  => 'quantity',
           'input_value' => 1, // default quantity
       ) );
       
    • You can find the code from /storefront/inc/woocommerce/storefront-woocommerce-template-functions.php.

    For more information, see: https://woocommerce.com/document/storefront-actions-example-adding-content-featured-product-title.

    I hope that helps. Let us know if you need anything else.

    Thread Starter harrydevries

    (@harrydevries)

    add_action( ‘storefront_sticky_single_add_to_cart’ , ‘woocommerce_quantity_input’, x );

    somehow it does not hook anything, i tried multiple functions but it does not show any output.

    Maybe, perhaps i am doing something wrong

    Hi there!

    Thank you for the update. As my colleague explained earlier, our support is limited when it comes to customizations.I can recommend WooExperts and Codeable.io as options for getting professional help. Alternatively, you can also ask your development questions in the  WooCommerce Community Slack as custom code falls outside our usual scope of support.

    Thank you for understanding and cooperation.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘quantity selector in sticky cart’ is closed to new replies.