24/7 Support: 800.608.6482

How To Guides

Try our new AI assistant by clicking the chat icon in the lower right corner.

How To Guides

Price Group Assignments Via Template Code

1. Overview

2. Setup and Configuration

3. Use Cases & Examples

Overview

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.


Setup and Configuration

There are two new functions available to use:

Assign Shopper To Price Group

Unassign Shopper To Price Group

Use Cases & Examples

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.



Provisional Baskets

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.

Looking for Developer Docs?

We have a whole section for that, including: Developer Training Series, Template Language docs, Module Development tutorials and much, much more.

Head to the Developer Section

This website uses cookies to identify visitors, track visitors to our website, store login session information and to remember your user preferences. By continuing to use this site you agree to our use of cookies. Learn More.

This website uses cookies. By continuing to use this site you agree to our use of cookies. Learn More.

Accept

Copyright © 1997 – 2024 Miva®, Miva Merchant®, MivaPay®, MivaCon®, Camp Miva®, Miva Connect®, Miva, Inc. All Rights Reserved.