Visibility Based on Seller Type

Questions about and code samples for adding visibility conditions within Select
Post Reply
Posts: 19
Joined: Wed Sep 26, 2018 1:24 pm

Visibility Based on Seller Type

Post by kendale.wyatt » Sun Jun 02, 2019 3:16 pm

Can I please get the syntax for the following two situations?

If Seller Type = "Individual"
If Seller Type = "Organization"


Posts: 1007
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC

Re: Visibility Based on Seller Type

Post by BobRichards » Sun Jun 02, 2019 4:57 pm

Under the covers, the BuyerSellerType is a bitwise enumeration that allows you to use a math trick to determine if the buyer or seller is of type Individual or Organization.

Code: Select all

# Determine if buyer is an organization...
bool isOrganization = (buyer.BuyerSellerType & BuyerSellerType.Organization) == BuyerSellerType.Organization

# Determine if seller is an individual...
bool isIndividual = (seller.BuyerSellerType & BuyerSellerType.Individual) == BuyerSellerType.Individual
Bob Richards, Software Developer, SoftPro

Post Reply