This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Input quantity and stock status in vertical results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Input quantity and stock status in vertical results Reply To: Input quantity and stock status in vertical results

#48733
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Samuele,

Well, this might not be possible easily. The quantity might be doable, the other one is probably more complex.

In the original code the quantity is sent directly via the button:

                <div class="woocommerce">
                    <a href="<?php echo $link; ?>"
                       data-quantity="1"
                       class="button product_type_simple add_to_cart_button<?php echo $ajax; ?>"
                       data-product_id="<?php echo $r->id; ?>" data-product_sku=""
                       rel="nofollow"><?php echo $text; ?></a>
                </div>

Maybe if that were replaced with a quantity input maybe:

<div class="woocommerce">
	<div class="quantity">
		<input type="number" step="1" min="1" max="" name="quantity" value="1" title="Quantity" class="input-text qty text" size="4" pattern="[0-9]*" inputmode="numeric">
	</div>
	<a href="<?php echo $link; ?>"
	   class="button product_type_simple add_to_cart_button<?php echo $ajax; ?>"
	   data-product_id="<?php echo $r->id; ?>" data-product_sku=""
	   rel="nofollow"><?php echo $text; ?></a>
</div>

But I’m not sure if this works.