Skip Navigation

[Resolved] Remove the quantity opon product pages without making products single order only

This support ticket is created 2 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 10 replies, has 3 voices.

Last updated by sunilM-2 2 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2530093
qty selector.png

I am referring to the quantity selector next to the Add To Cart button. I thought I resolved my issue with CSS: I added some CSS to hide it, but it takes a few seconds to kick in. So when the page loads I can still see the quantity selector momentarily (on mobile it is more apparant and lingers for a while)

I have attached a screenshot of the issue on mobile. Is there a filter that can be added to remove the quantity option?

#2530321

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi there

The delay problem probably relates to how the CSS is added to the page.

I suggest that in the template where you have designed this, where you have inserted the Add to Cart button, just above that insert a custom HTML block and add the specific CSS within style tags inside that block, in which case the CSS will already be parsed before the Add to Cart button is rendered.

e.g. within a Custom HTML block add

<style>
// your CSS styles
</style>
#2530531
Screenshot_2023-01-10-06-48-43-18.png

Hi Nigel! I moved the following CSS from the customizer to an HTML block above the ATC button:

<style>
//remove quantity selector
div.quantity.wooviews-template-quantity.buttons_added{
display:none!important;
}
</style>

But I must be doing something wrong, because it doesn't work and on mobile the code is showing up as text (screenshot attached)

#2530909

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is really strange.

Can you please share details where exactly you added the custom CSS code.

Maybe you can share problem URL and admin access details and also share what field you want to hide.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2530979

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

It seems you forget to share the problem URL where you added the form or I can see the field you are talking about. Can you please share problem URL and let me review it.

#2531089

Any product page is fine. Because I created a template for woocommerce products

here is a link to a product page: hidden link

#2531127

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

After reviewing the plugins page, I can see that you are running with outdated Toolset plugins. We always recommend running your site with latest stable Toolset plugin version.

- Could you please try to update all Toolset plugins to its latest official release version.

*** Please make a FULL BACKUP of your database and website.***
You can download latest Toolset plugins from your account's download page:
=> https://toolset.com/account/downloads/

Now - regarding the issue:
I've added the CSS you shared to custom CSS box of the content template as you can see with the following screenshot:
Screenshot - hidden link
=> hidden link

div.quantity.wooviews-template-quantity.buttons_added{
display:none!important;
}

I can see the quantity box is hidden now. Can you please confirm it works at your end as well.

Note: You can remove the CSS code you added previously as thats not required.

#2531417
Screenshot_2023-01-11-08-24-36-03.png

The issue is the same. The qauntity box was hidden before as I explained, when I had the code in the Customizer. But when loading, the qty box still appears for a few seconds (screenshot attached)

#2531427

There really should be an option to exclude the quantity option in the ATC block

#2531635

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the following code snippet:
=> hidden link

function func_wc_remove_all_quantity_fields( $return, $product ) {
    return true;
}
add_filter( 'woocommerce_is_sold_individually', 'func_wc_remove_all_quantity_fields', 10, 2 );

I can see no flip/flop for quantity box and its completely removed.

#2535943

Hi Minesh this solution works. Thank you for taking the time to fix this!