MMv4 KB
 
Prevent Specific Customers from Editing Their Subscriptions
  Last Edited - 07/8/2014 12:40pm PDT
  Category Path - Shopping Cart Software Components
 
quote
I've edited my templates to grant customers the ability to edit the bill date, quantity and hold status of their subscriptions. It works great, but what if I want to prevent specific customers from having this control?

To prevent specific customers from editing the bill date, quantity or hold status of their subscription, two things must be done.
  • First, create a Customer Group for these customers.
  • Then, edit your "customer_account_1.tpl" template to display the regular versions of those subscription fields to customers of that group.

prerequisites
This tutorial assumes that you have followed the steps outlined in the Allow Customers to Edit Their Subscriptions article to provide editable subscription fields to your customers.

An example of how to prevent customers from editing these aspects of their subscription can be found below:
 
Creating the Customer Group

The first step to preventing your specific customers from editing their subscription, is to group em' up.

1. In your Administration Area, locate [Customers > Search Customer Groups > + ].
2. Name the group, using the Group Name option.
3. For the option, How to apply rules below, select: match ANY of the rules below.
4. Under Add a Rule to this Customer Group, set the rule as:
 
Type: Customer Account
Details: SID (System ID) is 123*
(*Replace "123" with appropriate Customer SID number.)

5. Click Save Changes.
6. Repeat steps 4-5 for each customer to be added to the group.

Take note of the Customer Group SID number. It will be needed shortly.
 
Editing the customer_account_1 template

Next, the "customer_account_1.tpl" template will need to be altered to display different options to the customers in this group. We want to set the template up so that customers that are not in the group will view the editable fields, and customers who are in the group will view regular, non-editable text.

The template should be edited as follows:

1. In your Administration Area, locate [Design > Template Package Sandbox].
2. Select a Template Package to Edit.
3. Under Template Package Options, select "customer_account_1.tpl".
4. In the Template Editor, locate and change the follow QuickCode Tags:
 
{FIELD-PRODUCT-BILL-DATE}
--should be replaced with--
{IF-CUSTOMER-IN-GROUP-BEGIN:123}{PRODUCT-BILL-DATE}{ELSE}{FIELD-PRODUCT-BILL-DATE}{IF-CUSTOMER-IN-GROUP-END}


{FIELD-PRODUCT-ON-HOLD}
--should be replaced with--
{IF-CUSTOMER-IN-GROUP-BEGIN:123}{PRODUCT-ON-HOLD}{ELSE}{FIELD-PRODUCT-ON-HOLD}{IF-CUSTOMER-IN-GROUP-END}

{FIELD-PRODUCT-QUANTITY}
--should be replaced with--
{IF-CUSTOMER-IN-GROUP-BEGIN:123}{PRODUCT-QUANTITY}{ELSE}{FIELD-PRODUCT-QUANTITY}{IF-CUSTOMER-IN-GROUP-END}

(Be sure to replace "123" with appropriate Customer Group SID number.)

5. Click Save Changes.
 
Results

With those changes:
  • Customers who are not in the group will be presented with editable subscription fields.
  • Customers who are in the group will be presented with non-editable subscription fields.
 
Frequently Asked Questions

question
Well, what if I want the opposite effect? What if I want to prevent all customers from having access to the editing of their subscription by default, with just a select few that do?
answer
A very similar approach should be taken to get that result:
  1. A customer group should instead be created for those few customers deemed worthy of editing their own subscriptions.
  2. Then, the {FIELD-PRODUCT-XXX} tags replaced with: {IF-CUSTOMER-IN-GROUP-BEGIN:123}{FIELD-PRODUCT-XXX}{ELSE}{PRODUCT-XXX}{IF-CUSTOMER-IN-GROUP-END}
(Be sure to replace "123" with appropriate Customer Group SID number.)

This would allow the customers in the group to view the editable fields, and all other customers to view the non-editable versions.

 

Powered by ModularKB