Comments on: How to add quantity to product archives in WooCommerce (and keep ajax) https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/ Mon, 09 Nov 2020 11:24:08 +0000 hourly 1 https://wordpress.org/?v=6.6.2 By: Laurynas3d https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-766 Mon, 09 Nov 2020 11:24:08 +0000 https://christianvarga.com/?p=373#comment-766 Hi Christian, can you please share a solution for the variable products quantity input field and buttons with ajax? for some reason WooCommerce 4 broke a lot of code in the stackoverflow and there is fixes upon fixes.

]]>
By: Sunny https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-756 Wed, 09 Oct 2019 21:01:07 +0000 https://christianvarga.com/?p=373#comment-756 Hi Christian,
Thank you for great solution, is there any way we can display variations and quantity like this way on archives page.

So existing customers who wants to order dont need to open product page all the time, thanks in advance

]]>
By: John Loda https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-737 Sun, 24 Sep 2017 10:08:00 +0000 https://christianvarga.com/?p=373#comment-737 If someone manually enters in a number greater than the “max amount” it directs them to the product page. Any way to interject a warning saying they can only enter in the max amount before loading the product page?

]]>
By: asd https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-718 Fri, 10 Mar 2017 14:47:00 +0000 https://christianvarga.com/?p=373#comment-718 Hi all,

How can we set dafault product quantity 4 on single page nad it will update multiply by 4….8…12..16….20…24…28…etc

]]>
By: Christian Varga https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-703 Wed, 18 Jan 2017 22:10:00 +0000 https://christianvarga.com/?p=373#comment-703 In reply to jame wood.

You can put it in any javascript file as long as it’s included on the archive page. Alternatively, you can look for a plugin that allows you to inject javascript into the page, such as Simple Custom CSS and JS.

]]>
By: jame wood https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-702 Wed, 18 Jan 2017 21:09:00 +0000 https://christianvarga.com/?p=373#comment-702 where do i have to put this if i dont have application.js on my theme

$(‘.input-text.qty’, ‘ul.products’).on(‘input’, function() {
$(this).closest(‘li’).find(‘.add_to_cart_button’).data(‘quantity’, $(this).val());
});

]]>
By: Christian Varga https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-651 Sun, 27 Mar 2016 04:03:00 +0000 https://christianvarga.com/?p=373#comment-651 In reply to alessandro.

My contact details are on the about page. I’ll need access to WordPress & FTP.

]]>
By: alessandro https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-650 Sat, 26 Mar 2016 17:44:00 +0000 https://christianvarga.com/?p=373#comment-650 In reply to Christian Varga.

Thank you very much for your reply.
May i send you a PM or email to give you access?

]]>
By: Christian Varga https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-649 Sat, 26 Mar 2016 03:56:00 +0000 https://christianvarga.com/?p=373#comment-649 In reply to Alessandro.

The only way I can assist is if I have access to all of your code. There are a million different reasons why this might not be working, so if I can’t see all of your code, unfortunately I won’t be able to assist.

]]>
By: Alessandro https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-648 Fri, 25 Mar 2016 17:36:00 +0000 https://christianvarga.com/?p=373#comment-648 Hello Christia, can you hel me out?

I created a file like this https://gist.github.com/levymetal/8412bb4f4f1c4dbaa184

and added the following lines to my function.php file

wp_enqueue_script( ‘application’, get_stylesheet_directory_uri() . ‘/js/lib/application.js’, array( ‘jquery’ ) );

but it doesn’t seem to work. it only add 1 quantity to the cart.

I am really not good in coding and if you can hel me out it would be highly appreciated.

thank you very much

]]>
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" version="2.0">
<channel>
<title> Comments on: How to add quantity to product archives in WooCommerce (and keep ajax) </title>
<atom:link href="https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/feed/" rel="self" type="application/rss+xml"/>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/</link>
<description/>
<lastBuildDate>Mon, 09 Nov 2020 11:24:08 +0000</lastBuildDate>
<sy:updatePeriod> hourly </sy:updatePeriod>
<sy:updateFrequency> 1 </sy:updateFrequency>
<generator>https://wordpress.org/?v=6.6.2</generator>
<item>
<title> By: Laurynas3d </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-766</link>
<dc:creator>
<![CDATA[ Laurynas3d ]]>
</dc:creator>
<pubDate>Mon, 09 Nov 2020 11:24:08 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-766</guid>
<description>
<![CDATA[ Hi Christian, can you please share a solution for the variable products quantity input field and buttons with ajax? for some reason WooCommerce 4 broke a lot of code in the stackoverflow and there is fixes upon fixes. ]]>
</description>
<content:encoded>
<![CDATA[ <p>Hi Christian, can you please share a solution for the variable products quantity input field and buttons with ajax? for some reason WooCommerce 4 broke a lot of code in the stackoverflow and there is fixes upon fixes.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Sunny </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-756</link>
<dc:creator>
<![CDATA[ Sunny ]]>
</dc:creator>
<pubDate>Wed, 09 Oct 2019 21:01:07 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-756</guid>
<description>
<![CDATA[ Hi Christian, Thank you for great solution, is there any way we can display variations and quantity like this way on archives page. So existing customers who wants to order dont need to open product page all the time, thanks in advance ]]>
</description>
<content:encoded>
<![CDATA[ <p>Hi Christian,<br /> Thank you for great solution, is there any way we can display variations and quantity like this way on archives page.</p> <p>So existing customers who wants to order dont need to open product page all the time, thanks in advance</p> ]]>
</content:encoded>
</item>
<item>
<title> By: John Loda </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-737</link>
<dc:creator>
<![CDATA[ John Loda ]]>
</dc:creator>
<pubDate>Sun, 24 Sep 2017 10:08:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-737</guid>
<description>
<![CDATA[ If someone manually enters in a number greater than the &quot;max amount&quot; it directs them to the product page. Any way to interject a warning saying they can only enter in the max amount before loading the product page? ]]>
</description>
<content:encoded>
<![CDATA[ <p>If someone manually enters in a number greater than the &#8220;max amount&#8221; it directs them to the product page. Any way to interject a warning saying they can only enter in the max amount before loading the product page?</p> ]]>
</content:encoded>
</item>
<item>
<title> By: asd </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-718</link>
<dc:creator>
<![CDATA[ asd ]]>
</dc:creator>
<pubDate>Fri, 10 Mar 2017 14:47:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-718</guid>
<description>
<![CDATA[ Hi all, How can we set dafault product quantity 4 on single page nad it will update multiply by 4....8...12..16....20...24...28...etc ]]>
</description>
<content:encoded>
<![CDATA[ <p>Hi all,</p> <p>How can we set dafault product quantity 4 on single page nad it will update multiply by 4&#8230;.8&#8230;12..16&#8230;.20&#8230;24&#8230;28&#8230;etc</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Christian Varga </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-703</link>
<dc:creator>
<![CDATA[ Christian Varga ]]>
</dc:creator>
<pubDate>Wed, 18 Jan 2017 22:10:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-703</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-702&quot;&gt;jame wood&lt;/a&gt;. You can put it in any javascript file as long as it&#039;s included on the archive page. Alternatively, you can look for a plugin that allows you to inject javascript into the page, such as &lt;a href=&quot;https://wordpress.org/plugins/custom-css-js/&quot; rel=&quot;nofollow&quot;&gt;Simple Custom CSS and JS&lt;/a&gt;. ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-702">jame wood</a>.</p> <p>You can put it in any javascript file as long as it&#8217;s included on the archive page. Alternatively, you can look for a plugin that allows you to inject javascript into the page, such as <a href="https://wordpress.org/plugins/custom-css-js/" rel="nofollow">Simple Custom CSS and JS</a>.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: jame wood </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-702</link>
<dc:creator>
<![CDATA[ jame wood ]]>
</dc:creator>
<pubDate>Wed, 18 Jan 2017 21:09:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-702</guid>
<description>
<![CDATA[ where do i have to put this if i dont have application.js on my theme $(&#039;.input-text.qty&#039;, &#039;ul.products&#039;).on(&#039;input&#039;, function() { $(this).closest(&#039;li&#039;).find(&#039;.add_to_cart_button&#039;).data(&#039;quantity&#039;, $(this).val()); }); ]]>
</description>
<content:encoded>
<![CDATA[ <p>where do i have to put this if i dont have application.js on my theme</p> <p>$(&#8216;.input-text.qty&#8217;, &#8216;ul.products&#8217;).on(&#8216;input&#8217;, function() {<br /> $(this).closest(&#8216;li&#8217;).find(&#8216;.add_to_cart_button&#8217;).data(&#8216;quantity&#8217;, $(this).val());<br /> });</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Christian Varga </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-651</link>
<dc:creator>
<![CDATA[ Christian Varga ]]>
</dc:creator>
<pubDate>Sun, 27 Mar 2016 04:03:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-651</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-650&quot;&gt;alessandro&lt;/a&gt;. My contact details are on the about page. I&#039;ll need access to Wordpress &#038; FTP. ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-650">alessandro</a>.</p> <p>My contact details are on the about page. I&#8217;ll need access to WordPress &amp; FTP.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: alessandro </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-650</link>
<dc:creator>
<![CDATA[ alessandro ]]>
</dc:creator>
<pubDate>Sat, 26 Mar 2016 17:44:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-650</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-649&quot;&gt;Christian Varga&lt;/a&gt;. Thank you very much for your reply. May i send you a PM or email to give you access? ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-649">Christian Varga</a>.</p> <p>Thank you very much for your reply.<br /> May i send you a PM or email to give you access?</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Christian Varga </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-649</link>
<dc:creator>
<![CDATA[ Christian Varga ]]>
</dc:creator>
<pubDate>Sat, 26 Mar 2016 03:56:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-649</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-648&quot;&gt;Alessandro&lt;/a&gt;. The only way I can assist is if I have access to all of your code. There are a million different reasons why this might not be working, so if I can&#039;t see all of your code, unfortunately I won&#039;t be able to assist. ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-648">Alessandro</a>.</p> <p>The only way I can assist is if I have access to all of your code. There are a million different reasons why this might not be working, so if I can&#8217;t see all of your code, unfortunately I won&#8217;t be able to assist.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Alessandro </title>
<link>https://christianvarga.com/how-to-add-quantity-to-product-archives-in-woocommerce-and-keep-ajax/#comment-648</link>
<dc:creator>
<![CDATA[ Alessandro ]]>
</dc:creator>
<pubDate>Fri, 25 Mar 2016 17:36:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=373#comment-648</guid>
<description>
<![CDATA[ Hello Christia, can you hel me out? I created a file like this https://gist.github.com/levymetal/8412bb4f4f1c4dbaa184 and added the following lines to my function.php file wp_enqueue_script( &#039;application&#039;, get_stylesheet_directory_uri() . &#039;/js/lib/application.js&#039;, array( &#039;jquery&#039; ) );but it doesn&#039;t seem to work. it only add 1 quantity to the cart. I am really not good in coding and if you can hel me out it would be highly appreciated. thank you very much ]]>
</description>
<content:encoded>
<![CDATA[ <p>Hello Christia, can you hel me out?</p> <p>I created a file like this <a href="https://gist.github.com/levymetal/8412bb4f4f1c4dbaa184" rel="nofollow ugc">https://gist.github.com/levymetal/8412bb4f4f1c4dbaa184</a></p> <p>and added the following lines to my function.php file</p> <p>wp_enqueue_script( &#8216;application&#8217;, get_stylesheet_directory_uri() . &#8216;/js/lib/application.js&#8217;, array( &#8216;jquery&#8217; ) );</p> <p>but it doesn&#8217;t seem to work. it only add 1 quantity to the cart. </p> <p>I am really not good in coding and if you can hel me out it would be highly appreciated.</p> <p>thank you very much</p> ]]>
</content:encoded>
</item>
</channel>
</rss>