Forum

Thread tagged as: Question, Shop

User defined pricing

Is it possible to have a Perch product which can be any price, or must price variants be defined as options/variants? Possible use cases would be if a user wants to pay an invoice online - they would need to enter the amount of the invoice that they want to pay. Another situation would be if the price is calculated dynamically (the situation I'm looking at is the client wants to charge an additional fee to cover their PayPal fees). Pay what you want pricing for digital downloads would also be another use case.

For the fees situation, the slightly clunky workaround I'm considering is a "Fees" product that costs 1p, which I can then add to the cart multiple times, and hide the quantity in the cart display. The quantity would be just the amount I want to charge them in pence. If that's the route, is there an argument for the perch_shop_add_to_cart function that allows me to specify a quantity (rather than call it 100 times to add a pounds worth of fees).

Paul Bell

Paul Bell 0 points

  • 5 years ago

Update...

Looks like you can specify a quantity to the perch_shop_add_to_cart function...

perch_shop_add_to_cart($product, $qty=1, $replace=false)

so my slightly clunky workaround may work.

Drew McLellan

Drew McLellan 2638 points
Perch Support

The main use case we have defined for this is donations, and it's on the roadmap.

Brilliant. Thanks, Drew. Meantime, my workaround is looking like it will probably do the job.