Can MarketPress support >1 digital download quantity

Hi.

We're setting up a test site for downloading victorian images. i.e. the sale of digital products. For licensing, we need to let a buyer on occasion select a quantity of greater than one (for the same digital product) at checkout. Is this possible with digital downloads within MarketPress?

If it isn't, is there anyway we can edit the code to support this?

Many thanks,

Martin

  • Alexander
    • DEV MAN’s Mascot

    Hi @esidarap,

    I've looked into this, and quantities are disabled on digital downloads entirely. This is a bit more than something we can offer a quick code fix for, but I could help you get started.

    Open up marketpress-includes/template-functions.php and head to line 1899 where you will see this
    if ($mp->get_setting('show_quantity') && empty($meta["mp_file"])) {

    You can remove the check for the file URL (second condition) and the quantity will display on the order form.

    You'll also need to make a change on line 1770 to allow it to show the quantity later.

    if ((is_array($meta["mp_price"]) && count($meta["mp_price"]) == 1) || !empty($meta["mp_file"])) {

    Here you'll need to remove the check for the empty file URL again.

    The code above is just a few examples I noticed after taking a quick look at the code. There might be more. MarketPress wasn't designed to support quantities for digital downloads so I can't be sure if this is all you'll need to fix it. If you plan on exploring this more, I'd be interested to see what you come up with. If you get stuck on any issues let me know and I could take a look at them specifically for you.

    Best regards,

  • esidarap
    • Site Builder, Child of Zeus

    Hi.

    Sorry but we decided to work round the problem in a different way, rather than using code (which would have raised potential issues each time MarketPress was updated).

    In our case, a single image could be licensed in one of three ways so we are going to create three higher level categories, one for each license type. Most customers buy one license type; those that need more will have to buy again from the appropriate category. A little clunky but workable.

  • Dan Maby
    • Site Builder, Child of Zeus

    @esidarap thanks for the reply and glad you've managed to work around the problem. Unfortunately this won't work for myself as I'm actually trying to build a store for inter-company ordering so all purchases need to be free.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.