Close Menu
    What's Hot

    Leading Search Engine Optimization Company in Hyderabad!

    April 2, 2024

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024
    Facebook X (Twitter) Instagram
    Webliance.com
    • Home
    • Categories
      1. Digital Marketing
        • Google Ads
        • Lead generation
      2. Brand Promotion
        • Brand Promotion video
        • Brand Website
        • Brochure
      3. Content Management
      4. Corporate Business Email
      5. Website Development
        • Corporate Website
        • landing Page
        • Logo Designing
      6. Social Media Ads
        • Reels and Post
        • Social media marketing
        • Voice Calls
      7. WhatsApp Marketing
      8. YouTube Video Promotions
      Featured
      Recent

      Leading Search Engine Optimization Company in Hyderabad!

      April 2, 2024

      Best e-commerce website development company in Hyderabad

      March 31, 2024

      SEO Copywriting: Crafting Content that Ranks and Converts

      March 29, 2024
    • About Us
    • Services
      • SEO
      • Web Development
      • Web Design
      • Social Media Marketing
    • Portfolio
    • Contact Us
    Facebook X (Twitter) Instagram
    Webliance.com
    Webliance Pvt Ltd

    How to Add a Quantity Field to Shop Pages in WooCommerce

    webliance.comBy webliance.comNovember 29, 2021No Comments2 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    How to Add a Quantity Field to Shop Pages in WooCommerce
    How to Add a Quantity Field to Shop Pages in WooCommerce
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email

    Including a amount subject in your WooCommerce Store web page is nice improve to the consumer expertise. This enables customers to vary the amount of the product on the store web page earlier than including to cart. On this tutorial we’ll do this with out putting in any plugin. As a substitute of getting to navigate to the cart or the product web page to extend the amount, they’ll enhance the amount from the store web page. If you consider it, making it simpler on your prospects to buy extra of your merchandise means extra gross sales for you.

    1. Set up & activate the Code Snippets WordPress Plugin
    2. What’s a code snippet?
    3. Create a brand new code snippet known as “Add Amount Area On Store Web page for WooCommerce”
    4. Copy & paste this PHP code into the snippet
    5. Save & activate the snippet, then check

    Copy & paste this PHP code into the snippet

    • <?php // For implementation directions see: https://aceplugins.com/how-to-add-a-code-snippet/
      
      /**
      * Add amount subject on the store web page.
      */
      function ace_shop_page_add_quantity_field() {
      
      /** @var WC_Product $product */
      $product = wc_get_product( get_the_ID() );
      
      if ( ! $product->is_sold_individually() && 'variable' != $product->get_type() && $product->is_purchasable() ) {
      woocommerce_quantity_input( array( 'min_value' => 1, 'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity() ) );
      }
      
      }
      add_action( 'woocommerce_after_shop_loop_item', 'ace_shop_page_add_quantity_field', 12 );
      
      /**
      * Add required JavaScript.
      */
      function ace_shop_page_quantity_add_to_cart_handler() {
      
      wc_enqueue_js( '
      $(".woocommerce .products").on("click", ".quantity input", function() {
      return false;
      });
      $(".woocommerce .products").on("change input", ".quantity .qty", function() );
      // Trigger on Enter press
      $(".woocommerce .products").on("keypress", ".quantity .qty", function(e) {
      if ((e.which||e.keyCode) === 13) 
      });
      ' );
      
      }
      add_action( 'init', 'ace_shop_page_quantity_add_to_cart_handler' );

       

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to Make a YouTube Subscribe Link ? For your website or Button
    Next Article What is a Backlink and How to increase Backlinks ?
    webliance.com
    • Website

    Related Posts

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024

    SEO for Educational Institutions

    March 27, 2024

    Beat 10 Most Successful Advanced Showcasing Procedures For Instructive Institutions

    March 21, 2024

    2023’s Most Influential Digital Agency Coaches to Follow

    October 17, 2023

    The Best PHP Framework in 2023?

    October 16, 2023

    Contact Us

    Office Address:

    #301 Vamshi millenium
    Yousufguda Check Post, Hyderabad, 500045

    Call us on:
    +91 8977 149 318

    Email us on:
    info@webliance.com

    Categories
    • Analytics (4)
    • Blog (96)
    • Brand Promotion video (2)
    • casino (6)
    • Content Management (1)
    • Digital Marketing (96)
    • Editor's Choice (1)
    • Featured (49)
    • Featured Reviews (7)
    • Opencart (1)
    • SEO (80)
    • SEO Marketing (25)
    • Social (3)
    • Social Media Ads (1)
    • Social media marketing (5)
    • Top Picks (3)
    • Trending (4)
    • Videos (11)
    • Webliance Pvt Ltd (259)
    • Website Development (45)
    • Youtube (2)
    • YouTube Video Promotions (2)
    Top Reviews
    Editors Picks

    Leading Search Engine Optimization Company in Hyderabad!

    April 2, 2024

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024

    SEO for Educational Institutions

    March 27, 2024

    We are progressive digital marketing organization in Hyderabad serving a extensive variety of on-line marketing and Branding services like SEO, SEM, SMO

    Email Us: info@webliance.com
    Contact: +91 8977 149 318

    Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn WhatsApp
    Our Picks

    Leading Search Engine Optimization Company in Hyderabad!

    April 2, 2024

    Best e-commerce website development company in Hyderabad

    March 31, 2024

    SEO Copywriting: Crafting Content that Ranks and Converts

    March 29, 2024
    Categories
    • Analytics
    • Blog
    • Brand Promotion video
    • casino
    • Content Management
    • Digital Marketing
    • Editor's Choice
    • Featured
    • Featured Reviews
    • Opencart
    • SEO
    • SEO Marketing
    • Social
    • Social Media Ads
    • Social media marketing
    • Top Picks
    • Trending
    • Videos
    • Webliance Pvt Ltd
    • Website Development
    • Youtube
    • YouTube Video Promotions
    © 2025 webliance.com. Designed by Webliance Pvt Ltd.
    • Home

    Type above and press Enter to search. Press Esc to cancel.