Skip to main content

Posts

Showing posts from 2021

Making an item "Sold Out" in Gravity Forms

Gravity Forms for Word Press  is pretty awesome, especially with integration with Stripe for selling things. The only problem I've run into is when I have a thing with a limited quantity and it sells out. There's a great snippet if you want to install some extra php. Best practices would be to use the snippet. I strongly encourage you to do so -- it's a better solution. But if you want something faster to implement that can be installed by a developer who doesn't have the ability to upload/create php, you're going to need to use Javascript. So adding a little javascript gets us there pretty easily: <script type="application/javascript"> //get the existing quanity field you want to hide var myfield=document.getElementById('ginput_quantity_12_7'); //create a span for the message var soldoutSpan = document.createElement('span') //make the message soldoutSpan.innerHTML = '<b>SOLD OUT</b>'; //add the message AFTE...