sell "virtual item"

Hi everybody,
I just wanted to know if it is possible to sell virtual items via Marketpress?

Lets say i have two categorys and the user can pay with cubepoints.

Avatar 1 – 100 Points
Avatar 2 – 200 Points
Avatar 3 – 300 Points, etc.
—Titles Subpage—
Title1: Novice – 100 Points
Title2: Member – 200 Points, etc.

If the User clicks on Avatar1, his total points should be reduced by 100 (if he has enough points, else error – he can’t buy it) and in an specific Databasetable there should be an Update like set Avatar1 = 1 where user_id = $current_user->ID
So there wont be any download or shipping, just an update of the Database.

Thanks in advance

  • sl21

    Hello Joe,
    thank you for your reply.

    Since I just started with Wordpress and considering the fact, that I'm just beginning to learn PHP, I was hoping that this case is already programmed.

    In the backend I can set cubepoints as a payment and I tried a regular buying. It worked like a charm (didn't try downloads), so I was hoping that it wouldn't be a big thing.

    I now coded a "Cubepoint - Virtual Item Shop Plugin" for Wordpress based on a module of an other programmer. When i get his permission, I'm going to publish the Source in here as possible solution for others having the same "issue".
    Unfortunately it's not combined with Marketpress, but it serves my needs.

    Cheers, Steffen

  • aecnu

    Greetings Steffen,

    Thank you for the explanation and now I understand that you have programmed a cube point gateway yourself.

    Let me know when you get the gateway permission and I would like to check out the code.

    It is thoughtful and I appreciate your efforts to want to help other members with their WordPress installations as well.

    Some rep points just for having the idea to want to help others here.

    Cheers, Joe

  • sl21

    Thank you for the Rep-Points, like promised: here is the Code:
    (Just starting to code, so use on own risk :wink:)

    What does this module do?

    It sets up a litte Shoppage where the user can buy avatars, titles, etc.
    If he clicks on the buy button, the amount is added to a database field, while his points are reduced.

    demo image


    How to Set up ?
    Copy the Sourcecode into a new php file and save it as items4points.php into the module folder of cubepoints.

    create database table “wp_cp_shop” (else change lines 41,60,69 in items4point.php)
    with fields for user_id (unique) and names for your items (see demoimage)

    Upload the Productimages and change Line 86

    Use shortcode
    [items4points item="item1" points="-100" limit="50" limituser="5"]

    item: name of the Item used in the database

    points: how much does the item cost. Use – if the coins should be removed from the user, use positive number if you want to give the item + coins donation to the user.

    limit: Item can be bought X times alltogether

    limituser: User can buy this item only X times

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.