WooCommerce Advanced Quantity plugin is not working? Need the Quanitity to show on the product

I purchased the plugin and activated but the quantity field is not showing on the products? I would like to have the quantity field show right on the product thumbnail next to the add to cart button. Why would this not show up?

Here is the url
http://r2rraffle.com/

Here is what we are looking to have
https://woo-advanced-qty.com/product-category/step/

PLease advise how we can get this to work like the plugin. Thanks

Hi There,

It sounds like you might be having an issue with a third party plugin or script. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

Thank you for your understanding.

Okay thanks for the reply… So, how do we add the quantity field? This is seems to be an option in many other websites so what would be the best way to add this quantity field to the products? Thanks

Hi There,

Could you please try adding the following code into your child theme’s functions.php file and see if that helps.

add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 );
function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
	if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
		$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">';
		$html .= woocommerce_quantity_input( array(), $product, false );
		$html .= '<button type="submit" class="button alt">' . esc_html( $product->add_to_cart_text() ) . '</button>';
		$html .= '</form>';
	}
	return $html;
}

Thanks!

Hi @mldarshana

That looks like it works, but can we keep the add to cart button aligned with the quantity so they are in same row? Thank you for this.

-Allen

Hey Allen,

Do you want something like this?

If that is the case, please add the following CSS code in the X > Launch > Theme Options > Global CSS (http://prntscr.com/evui3r)

.woocommerce li.product .entry-header .button {
    position: relative;
    opacity: 1;
    top: auto;
    left: auto;
    right: auto;
    display: inline-block;
    float: right;
}

.woocommerce li.product .entry-header .quantity {
    width: auto;
    float: left;
}

Hope this helps. Please let us know how it goes.

@RueNel This is exactly what I was looking for… Thank you very much… the last thing to make this process perfect, is how can we direct to the checkout page once they click Add to cart?

You’re welcome! About the redirect, you’ll have to implement a custom code in your child theme’s functions.php, like from here https://stackoverflow.com/questions/15592633/woocommerce-add-to-cart-button-redirect-to-checkout

If you’re on latest Woocommerce version then, try this code

add_filter ('add_to_cart_redirect', 'redirect_to_checkout');

function redirect_to_checkout() {
    return WC()->cart->get_checkout_url();
}

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.