Welcome to our Support Portal › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Conditionally Restricting QTYs depending on chosen option
- This topic has 4 replies, 3 voices, and was last updated 5 years ago by nmedia.
-
AuthorPosts
-
April 16, 2019 at 9:55 pm #11306PhilParticipant
I am wondering if it is possible to somehow interact / limit or have min qty of a product required depending on options chosen. I will give a couple of examples to explain …
Product has a dropdown / select box with 2 options:
1 – Shared Group Tour
2 – Private Tour for 1 Person + xxxUSD$So the standard price is the shared group tour so no change to price if selected , but if they choose option 2 to pay the single person supplement it changes price to xxxUSD$
This all works fine but I would like it if :
If option 1 is chosen then it can only be booked if there is at last QTY 2 and likewise
if option 2 is chosen then it can only be QTY 1Is there anything already built in to PPOM that helps achieve this?
If not Im wondering if some combination of using conditional logic, hidden fields and JS might be the way to go but I thought I would ask first here.
Also, another quick minor question – is there a quick way to change “Unit” in the price matrix display to another word like “person”
(there can also be other fields in the same product)
April 17, 2019 at 11:48 am #11387Jane BrianKeymasterHI
Thanks for reaching us, we have received your request. We will get back to you as soon as possible to response your question.April 17, 2019 at 2:55 pm #11397nmediaKeymasterHi Phil,
I read your requirements, and sorry that’s a specific requirement as per your site. So PPOM have to handle all in general so we can’t make this specific changes.
And for Unit change: please paste this code inside your theme’s functions.php file:
add_filter( 'gettext', 'ppom_change_text', 20, 3 ); function ppom_change_text( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'unit' : $translated_text = 'Person'; break; } return $translated_text; }
April 17, 2019 at 3:56 pm #11403PhilParticipantNo problem , wasnt expecting you to change the plugin of course but just wanted to check if there was a way already – there are so many features it is hard to know sometimes if Ive missed something! I will work it out somehow.
Thanks for that code snippet , its useful as looks like it can be used to change pretty much any of the text items that I might want – I can think of a few used for that.
Also – i sent an email to sales@najeebmedia.com last night as I bought the checkout fields plugin but it doesnt show in downloads nor have I received a email with a link. If you could confirm you have that email please as I would like to get the plugin today if possible
thanks
April 18, 2019 at 4:00 pm #11492nmediaKeymasterHi Phil,
I have sent you email about you last plugin purchase.
Thanks.
-
AuthorPosts
- The topic ‘Conditionally Restricting QTYs depending on chosen option’ is closed to new replies.