Simple VIP system using Price Definitions and Entity Fields

I’m glad it took me ages to work this out myself, its taught me a lot more about samba. With a bit of help from a couple of others, it all works flawlessly.

Ive set this up so you can have as many VIP levels as you like. Just update Price Definitions, fill in the Price in the price list editor, and youre already away!

Please be aware that in my Pictures I have my entity name set as SquareCard Customer Card. this is because that’s the name of the entity ill be selecting the data from. In this tutorial ill change to Customers. You’ll need to edit this to whatever the Entity name is that you will be pulling the data from.

When entity Selected:

Whole Order VIP Updated:

Additional orders added to ticket also updated with new price:

Ok, so lets start by creating our price definitions:

You can have as many as you like, but you need to call them VIP1, VIP2 onwards.

Once saved, open your Price List Editor:

Here you need to edit your prices, as you can see here I have created 3 VIP Levels. VIP1, VIP2 and VIP3. This can be done at any time. If the prices are left blank they will default to the default price.

Now we need to create a Custom Field in our Customers Entity type.

Name: VIP Level with Field Type as Number.

Now we need to create an Automation Command that will trigger the whole process. (This isnt needed, however it was the only way I could get the prices to update automatically after the Entity was selected)

Name: VIP_Update Prices
Button Header: Update\rPrices

Make sure all mappings are deleted. We dont want this Button visible!

Next we need to create our actions that will make the magic work. If you create this Action, itll be very handy for future Rules you may want to make.

Action Name: Ask Question Generic
Action Type: Ask Question
Parameters:
Question: [:Question]
Buttons: [:Buttons]
Automation Command Name: [:Automation Command Name]
Backgroud Color: [:Background Color]

Next we will create the Action that changes to our VIP Price list:

Action Name: VIP_Update Prices
Action Type: Update Order
Price Tag: [:Price Tag]

Now we need to do our Rules.

Name: VIP_Price Change On Select
Event Name: Ticket Entity Changed
Execute Rule If: Matches
Constraints:
Entity Type Name EQUALS Customers <-- this is the default entity

ACTIONS:

Ask Question Generic:
Constraint: [=TN('{ENTITY DATA:Customers:VIP Level}')]>0
Question: Applying VIP Prices to Order
Buttons: OK
Automation Command Name: VIP_Update Prices
Background Color: Red

Name: VIP_AMC Rule
Event Name: Automation Command Executed
Execute Rule If: Matches'Automation Command Name_EQUALS_VIP_Update Prices`

ACTIONS:

VIP_Update Price
Price Tag: VIP{ENTITY DATA:Customers:VIP Level}

Name: VIP_Price Change
Event Name: Order Added To Ticket
Execute Rule If: MATCHES
Constraints:
{ENTITY DATA:Customers:VIP Level} GREATER 0

ACTIONS:

VIP_Update Price

Price Tag: VIP{ENTITY DATA:Customers:VIP Level}

Name: VIP_Update Portion
Event Name: Order Portion Changed
Execute Rule If: MATCHES
Constraints:
{ENTITY DATA:Customers:VIP Level} GREATER 0

ACTIONS:

VIP_Update Price

Price Tag: VIP{ENTITY DATA:Customers:VIP Level}

2 Likes

Reserved for any future modifications :slight_smile:

Edit: Ignore the fact VIP members are getting charged more in the screen shots… the regular prices haven’t been put up yet, VIP members will be getting their prices frozen hah! Launch date is MONDAY! ahh!!

Think you made a mistake with screenshot here bro. You were talking about creating an action but posted an automation command setting screenshot instead :stuck_out_tongue:

Other then that great job on VIP tutorial :D. Definitely useful for the future.

1 Like

damn, let me check. I did it on notepad and added the screens after…

EDIT: Ok Fixed, thanks lol

1 Like

Well done, another new way of doing things in Samba! Persistence (and sometimes frustration) always pays off.

1 Like