FoxyCart / foxyshop

FoxyShop - WordPress plugin for FoxyCart
GNU General Public License v2.0
10 stars 8 forks source link

Add Variation Type for Entering a Custom Price Amount/Donation #27

Open rijarobinson opened 5 years ago

rijarobinson commented 5 years ago

We can create a dkey text field for the customer to enter an amount as a price (such as in a donation), but the current js doesn't update the foxyshop_currentprice on the product page like the modifiers do. It does update in the cart so users can hide this field if they wish. However, we probably should add this as another variation type.

See donation docs here: https://www.foxy-shop.com/donation-gandhi-step-by-step-guide-for-nonprofits/

rijarobinson commented 4 years ago

Update ― adding a note that the hack above doesn't dynamically update the price on the product page when it's entered. We've been giving users the following script to do that: https://pastebin.com/raw/0fFhE91w

Other Notes on the script: You'll want to paste that into that product page before the closing tag to get the price to update on the page. Once you've got it working, you can comment out any console.log statements. used for troubleshooting. Adam notes: As it stands, we can't really just add that JS on it's own because it won't know what the fields are that the user defines.