9.12 introduces 2 new template level functions which can be use in any Miva page template to allow you to assign or unassign a shopper from a price group. When setting up a price group you have 4 customer assignment options: All shoppers, Logged in shoppers, Coupon only and Specific Customers (customers who are logged in). These new template level functions allow you override the default assignment set at the price group level with the individual shopper/basket. For example say you want to run a PPC campaign and offer a 10% discount to only the shoppers who come into your store via a Pay Per Click ad. This new function would allow you to setup the logic to do this in your Miva page template.
Common Use Cases include
The price group is assigned to the shopper at the basket level so once they have been assigned to the price group it will be valid until either it gets explicitly removed (via template code) or the basket expires and is deleted. It's also important to note that the price group's start and end dates will still be used. If you assign a price group which is not valid because of the date range configured, these functions will not override those settings.
There are two new functions available to use:
Here we are cheking for the existence for a global variable named "ppc_campaign" and checking to see if has the value of "black_fridiay". This name/value pair would need to be passed in your PPC campaign url.
Here we are cheking for the http_refer variable which holds the URL the customer came from to land on your site.
This feature will work as expected when using provisional baskets. If a price group is being assigned via template code and provisional baskets is in use, Miva will automatically convert the provisional basket to a real basket so that it can correctly assign the price group discount.