24/7 Support: 800.608.6482

Get Started

How To Guides

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 funcitons 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 leve 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% disscount 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

  • Give discounts to specific shoppers based on where they came from (URL parameter or page refer)
  • Give a discount to a customer based on their specific country their are from (geoip)
  • Exclude free shipping price groups by geography (customers in alaska and hawaii don't get the free shipping applied)
  • Give a customer a discount/free gift for completing some action.

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 explicity 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 – 2019 Miva©, Miva Merchant©, MivaPay©, MivaCon© Miva, Inc. All Rights Reserved.