Home Forums WC Vendors Pro Support WC VENDORS PRO Stock issue Reply To: WC VENDORS PRO Stock issue

#37583
Sebastien LETT
Participant

Hi guys!

For my part, I found the problem. I was using this code in function.php

	add_filter( 'wcv_product_stock_qty', 'change_default_stock_qty' );
	function change_default_stock_qty() {

		$field['post_id'] = $post_id;
		$field['id'] = '_stock';
		$field['label'] = __( 'Stock Qty', 'wcvendors-pro' );
		$field['wrapper_start'] = '<div class="all-100">';
		$field['wrapper_end'] = '</div>';
		$field['desc_tip'] = 'true';
		$field['description'] = __( 'Stock quantity.', 'wcvendors-pro' );
		$field['type'] = 'number';
		$field['data_type'] = 'stock';
		$field['custom_attributes']['step'] = 'any';
		$field['value'] = '1'; // This sets the quantity
		return $field;

	}

But this code generates a bug in the system. In the frontend, I can’t add more than 1 quantity per product.

Has anyone a solution to sets the quantity per default to 1 ?

Regards,
Slett