A PHP Error was encountered
Severity: Notice
Message: Undefined index: userid
Filename: views/question.php
Line Number: 191
Backtrace:
File: /var/www/html/cnasolution/application/views/question.php
Line: 191
Function: _error_handler
File: /var/www/html/cnasolution/application/controllers/Questions.php
Line: 419
Function: view
File: /var/www/html/cnasolution/index.php
Line: 315
Function: require_once
Add shop page quantity field woocommerce [duplicate]
I am new to Woocommerce. I was trying to show the quantity box in the shop page. I have used the below code and it's working as expected:
add_action( 'woocommerce_before_shop_loop', 'handsome_bearded_guy_select_variations' ); function handsome_bearded_guy_select_variations() { remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 30 ); }
But the problem is that ajax add to cart button got replaced with default one.
How can I enable back the ajax functionality on add to cart button with quantity field for Woocommerce archives pages?