Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to force member to have enough points to send a BuddyPress Gift

  • Avatar of Tosh
    Tosh
    Participant

    @xberserker

    Go to this file: wp-content/plugins/buddypress-gifts/includes/templates/gifts/screen.php

    And replace it with the following – http://pastebin.com/5HXs3Hws

    My edit starts on line 56 and ends on line 139.

    If say giving a gift costs 50 points (doesn’t matter since it checks the value you put in the BP CubePoints Admin).

    The points the member has must be greater than or equal to the gift value negative or positive in order to see the gift form. If they don’t have enough points the form will be hidden and it will display this text.

    You need %pulls in the value you put in the BP CubePoints admin field% points to sent a gift.

    If the value is a negative it won’t display the – in the text above. Not sure if this will make it into the plugin yet. If you have any ideas how let me know.

Viewing 9 replies - 1 through 9 (of 9 total)
  • @xberserker thanks for this, its what i needed..

    what if i want to set the minimum amount of points a user could have to be 0..as i dont want negative points

    Avatar of Tosh
    Tosh
    Participant

    @xberserker

    CubePoints doesn’t allow users to go below zero.

    @xberserker

    Thank you so much for taking the time to put this together. I checked out the URL and replaced my screen.php with the one that you provided in your link however when I click on my gift link (http://domain.com/members/user/gifts/) I get the following error:

    Parse error: syntax error, unexpected ‘}’ in /home/public_html/wp-content/plugins/buddypress-gifts/includes/templates/gifts/screen.php on line 1

    If I copy and paste in the code that you added on line 56 and line 139 I get the following error:

    Parse error: syntax error, unexpected ‘}’ in /home/public_html/wp-content/plugins/buddypress-gifts/includes/templates/gifts/screen.php on line 121

    My line 121 is: <!– ___________________________________CubePoints Buddypress Integration__________________ –>

    Also, do you know if its possible for users to send gifts to themselves? Kind of like a store so they can buy things for themselves as well using their points? Just curious~

    I got it working, you can take a look at what I changed here: http://pastebin.com/Snb26B31

    It’s my full screen.php file, I didn’t change much.. just mainly changed things to else: and endif; on the lines that you added and that got it working for me.

    Thank you again!

    Avatar of Tosh
    Tosh
    Participant

    @xberserker

    Glad you got it working. Thanks for posting your fix. I’ll modify mine later and update my original post.

    Avatar of thekmen
    thekmen
    Participant

    @thekmen

    The gifts plugin supports template overrides as far as I know, so I would be making these changes in your child theme rather than the plugin. That way you won’t loose your customisations on a plugin update.

    @xberserker No problem, thank YOU for putting it together!

    @thekmen Yup, your exactly right. Simply put the gifts folder with the screen.php file inside into your child theme and then when you upgrade your changes will still be there.

    Avatar of warut
    warut
    Participant

    @warut

    hi all, i busy and dont check buddypress site for a month and glad xberserker make bp gifts working with cubepoint.

    i will test it and make some change in next bp gifts release

    Avatar of Ekine
    Ekine
    Participant

    @ekine

    bp gifts combined with cubepoints is awesome. :)

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.