Forum

Thread tagged as: Question, Members, Shop

Change a member property after first purchase in shop

OK, so I need to change a member property once they have made their first purchase. More specifically, if the member has a level of 'New' I want that to change to 'Partner' once they arrive back at the successful payment page.

How can I go about this? I imagine I would put it within

if (perch_shop_order_successful()) {
}

I can test for the current user's level with

if (perch_member_get('level') == 'New'))

but how do I then change level to 'Partner' ?

Lisa Morena

Lisa Morena 1 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You'd normally do that by applying a tag to the member with perch_member_add_tag()

Hmm, I can't change the property then? I didn't really want to use tags because I don't want there to be multiple 'levels' applied per member or for the risk of misspelling

Is it possible to remove a tag? So If I create a member with tag New and level Partner, then filter what I want on the New tag. Then once a purchase is made the New tag is removed so they are just Partner with no tags?

Ah yes, all sorted with perch_member_remove_tag()

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, great.