This article will cover cases where advanced configuration of Packages is required. (The more standard Packages configuration is here: Packages Trade Promotions Editor Guide.)
- Enable Edit / Delete a Package in the Shopping Cart
- Translation of Package Messages
- Copy field values from the original order Transaction to the Package Transaction
- Pass the Promotion Code entered in the Package configuration to each line-item in the original Transaction
- Merging Pricing Fields form the Package Promotion Transaction to the original Transaction
- Setting up pre-defined “Kits" (quantity in package can not be changed by user)
-
Add Item Promotion Discounts to apply inside a Package Promotion
- Set field values to the Package Promotion leading item line (dark blue line in cart)
1.Enable Edit / Delete a Package in the Shopping Cart
To enable users to edit or delete a package they have already added to the cart you must explicitly add the Edit Package and Delete Package options in the Cart Line Menu configuration
When you select the leading package item cart you will see Edit / Delete in the Line Item Menu, when you select Edit it will take you back into the package to edit the items selected.
If you select a regular line item, you will also see Edit / Delete, however they refer just to that item.
You won’t see a difference in the menu it will say just “Edit/Delete” for both packages and non-package line items, because the menu options are context sensitive.
On the Web app:
Tick the leading package item and select Edit/Delete from the menu.
On the mobile app:
Long tap on the Package Leading item in the cart. (you can’t tap on the actual package items they won’t have a line menu).
2. Translation of Package Messages
Translation of warning messages
You can translate the text of the warning messages displayed to the user when ordering packages. These messages are displayed when the user selects too many, too few, or too low of a price amount of items.
Note that the messages instructing the user how many items to select from each phase of the package are not related to these warning messages, and they should be defined when creating the Package in the Package Editor in the desired language.
Open the PPI_PackagePromotion Transaction type and in the Fields tab go to the Transaction Custom Fields.
Edit the PPI_PackagePromotion_Start_Strings field
Remove the comments (/* and */) and insert your own text for the different types of messages. Make sure to keep the {0} placeholder somewhere in each text you replace. This placeholder will be replaced by the appropriate quantity.
// To show different messages, such as for different language, uncomment the next section and change it accordingly.
var strings = {
/*
MissingOneMsg:"Please select an additional item",
MissingMsg:"Please select {0} more items",
PrefixExtraMsg:"You have chosen too many items. Please ",
OneExtraMsg:"remove one item",
TooManyMsg:"remove {0} items",
MissingPriceMsg:"Please select additional items at a total price of {0}",
TooManyPriceMsg:"remove items at a total price of {0}",
OrMsg: " or "
*/
};
return JSON.stringify(strings);
Translation of Package Next Discount field.
The Package Next Discount field displays a message indicating how many more items or how much more in price the user should add to satisfy the package requirements to get the incentive.
Open the PPI_PackagePromotion Transaction type and in the Fields tab go to the Transaction Custom Fields.
Edit the PPI_PackagePromotion_Start_Logic field
Translate the text found in this section, making sure to preserve all the placeholders in curly brackets such as {get}, {val}, {qty2}, etc.
/*
var NextDiscountTextBuy = 'Buy {qty} to get {get}';
var NextDiscountTextBuyMore = 'Buy {qty} more to get {get}';
var NextDiscountTextRemove = 'Remove {qty} to get {get}';
var NextDiscountTextBuyRemove = 'Buy {qty} more or remove {qty2} to get {get}';
var NextDiscountTextBuyRemove2 = 'Buy {qty} more to get {get} or remove {qty2} to get {get2}';
var NextDiscountTextEligible = 'You got {get}';
var NextDiscountTextEligibleBuyMore = 'You got {get}. Buy {qty} more to get {get2}';
var NextDiscountTextLimitation = '{limitation} to get {get}';
var NextDiscountTextGetPercentage = '{val} off';
var NextDiscountTextGetPackagePrice = '{val} off';
var NextDiscountTextGetPackageFixedPrice = 'fixed price of {val}';
var NextDiscountTextGetItemPrice = '{val} off';
var NextDiscountTextGetItemFixedPrice = 'fixed price of {val}';
var NextDiscountTextGetCheapestItemFree = 'the cheapest item for free';
var NextDiscountTextGetCheapestItemPercentage = '{val} off on the cheapest item';
var NextDiscountTextGetCheapestItemPrice = '{val} off on the cheapest item';
var NextDiscountTextGetCheapestItemFixedPrice = 'the cheapest item with a fixed price of {val}';
var NextDiscountTextGetCheapestItemsFree = 'the {qty} cheapest items for free';
var NextDiscountTextGetCheapestItemsPercentage = '{val} off on the {qty} cheapest items';
var NextDiscountTextGetCheapestItemsPrice = '{val} off on the {qty} cheapest items';
var NextDiscountTextGetCheapestItemsFixedPrice = 'the {qty} cheapest items with a fixed price of {val}';
var NextDiscountTextGetAdditionalItemFree = 'free additional item';
var NextDiscountTextGetAdditionalItemPercentage = 'additional item with {val} off';
var NextDiscountTextGetAdditionalItemPrice = 'additional item with {val} off';
var NextDiscountTextGetAdditionalItemFixedPrice = 'additional item with a fixed price of {val}';
var NextDiscountTextGetAdditionalItemsFree = '{qty} additional items for free';
var NextDiscountTextGetAdditionalItemsPercentage = '{qty} additional items with {val} off';
var NextDiscountTextGetAdditionalItemsPrice = '{qty} additional items with {val} off';
var NextDiscountTextGetAdditionalItemsFixedPrice = '{qty} additional items with a fixed price of {val}';
var NextDiscountTextGetAdditionalUserSelectedItems = 'additional user selected items';
var NextDiscountTextGetCreditNote = '{val} credit note';
var NextDiscountTextGetSeparator = ' & ';
*/
3. Copy field values from the original order Transaction to the Package Transaction
In the case that you are calculating fields in the original sales order and you want those calculations to take effect on Line-items in the package transaction as well, you can copy those fields from the original sales order to the package transaction.
You'll first need to add those fields to a list in one of the Package Promotion custom line-item fields, and then you'll need to add them to the Merge actions in the Workflow. Follow these steps:
Step 1: add the fields to the PPI_PackagePromotion_Start_GetOriginalOrderFields
Open the PPI_PackagePromotion Transaction and go to the Fields tab
Edit the field: PPI_PackagePromotion_Start_GetOriginalOrderFields
In the following code add the custom fields you wish to merge in quotes, comma separated, as shown in red below.
// This code loads data from the original order into package fields.
// Pre-req: select the following fields in the Available Fields: ItemWrntyID
// To do:
// 1. update the next field value with an array of fields to retrieve from the original order.
// 2. Add transaction line fields with the exact same name as in the original order. They will be updated with the values from the original order.
// 3. If you need to have the values on the promotion items in the original order, then add these fields also to the two Merge workflow actions.
var originalOrderFields = []; // i.e. ["TSAmyPrice","TSATax"]
Step 2: create the custom fields in the PPI_PackagePromotion Transaction
Create all the TSA custom fields you added to the code in the PPI_PackagePromotion_Start_GetOriginalOrderFields. Use the same exact names (case sensitive).
Step 3: add the fields to the Merge action in the workflow
Go to the Workflow tab of the PPI_PackagePromotion Transaction
Edit the In Creation transition in two branches as shown in the diagrams below:
Edit the Merge Transaction Lines action to include the fields you added in the code above. Leave the existing fields as is.
For example if you added "MyPrice" and "MyTax" fields to the Package transaction, add them to get "Value from Field" to the same name in the original Transaction, as shown below. Make sure to do this on the Merge action in both branches of the In Creation transition.
4. Pass the Promotion Code entered in the Package configuration to each line-item in the original Transaction
You can enter your own "Promotion Code" in the configuration of each package, this Promotion Code can then be assigned to each item purchased as part of the package. This is useful for Promotion effectiveness tracking. You can see if an item was purchased as part of a package or not in reports in your ERP (or using this field to filter by in Line-item Reports in Pepperi).
In order for each line item to receive this value, you must create a custom line-item field in the original Transaction (ie Sales Order) to store the value, and then pass it back from the PPI_PackagePromotion Transaction.
Step 1: create a custom line-item field in the original transaction type, for example TSAPromoCode.
Step 2: Edit the Merge Transaction Lines action in both branches of the PPI_PackagePromotion Transaction Workflow (as shown in the two diagrams above) to merge the value of PPI_PackagePromotion_Start_PromotionCode to the TSAPromoCode field you created in Step 1.
5. Merging Pricing Fields from the Package Promotion Transaction to the original Transaction
The following cases will be described:
(a) You have a custom field in the original Transaction that is replacing the default UnitPrice Line-item field
(b) You have custom fields in the original Transaction for UnitPrice as well as other pricing Line-item fields, such as UnitDiscount, UnitPriceAfterDiscount, and TotalUnitPriceAfterDiscount.
In both cases you will need to merge the values of the custom fields from the Package Promotion Transaction, which had discounts applied, back to the original Transaction. Otherwise the original transaction will use the values in the custom fields and ignore discounts applied in the package.
Case (a) - you will need to Add (+) a merge that will copy the UnitPrice to the custom field in the original Transaction. Select the custom field name on the left, and PPI_PAckagePRomotion_Start_UnitPrice (Calculated) on the right.
Merge in both branches of the In Creation transition, as shown in the above two diagrams.
Case (b) - replace the default fields in the merge with the custom field names, and Add (+) a field for the TotalUnitPriceAfterDiscount (because the total of a custom field will not be calculated by default).
By default, the Package Promotion transaction will calculate the discounted pricing for the line-items and return that pricing to the standard UnitPriceAfterDiscount, UnitDiscount, and TotalUnitPriceAfterDiscount fields.
To indicate that the values of the discounted pricing after the promotions are applied should be merged to those custom fields, you will have to replace the default UnitPriceAfterDiscount and UnitDiscount with your custom field names.
You will have to Add (+) your custom field which contains the TotalUnitPriceAfterDiscount to get its value from the field PPI_PackagePromotion_Start_ItemTotalPrice (Set By API)
To do this edit the Merge action in the Workflow of the PPI_PackagePromotion Transaction in BOTH branches of the In Creation Transition (as done above in the previous case).
6. Setting up pre-defined “Kits" - Quantity on Package cannot be changed
For example: if you're selling kits with pre-defined quantities (user cannot change), you'll need to add a transaction type with the Unit Quantity field set to Read Only (because in the default packages, the user can select the quantities they want for each item).
Add an additional Package Transaction Type for both types of Package transactions, the Package transaction, and the Additional Items transaction.
Adding a Package Promotion Transaction Type
The Package Promotion Transaction Types are not created like the others under Sales Activities. To add these kinds of transactions go to:
Settings -> Promotion Setup -> Package TP Setup
Click the Advanced Setup button on the lower right.
In the dialog that is opened, click Add to add an additional set of package transactions and select them so they will be active.
Go to Sales Activities -> Transaction Types
Edit the Transaction Type you created.
You should go to the General Tab and enter a name and description that will make it easy to recognize by the user creating packages in the Package editor.
The Name must START WITH PPI_PackagePromotion
Append a descriptive word after this mandatory prefix, for example PPI_PackagePromotion_Kit
Create a custom Transaction Line Item Field of type Number, that will simple return the value of the out of the box UnitsQuantity Item Field:
Then edit the Order Center views (these are typically Medium or Grid Line) to include your custom quantity field, instead of the out of the box Pepperi UnitsQuantity field.
Edit the custom "MyUnitsQuantity" field to be Read only:
Now, when a user creates new Packages in the editor, they will have an additional option to indicate which package to use: the default (PPI_PackagePromotion) or the new type you created for the kits (in this example "Predefined Kit"):
7. Assigning Catalogs to Package Transactions
The PPI_PackagePromotion Transaction Types which display the phase 1 and phase 2 items are connected to the Default Catalog. If you are using multiple catalogs, and have limited your Default catalog not to include items that you may want in those phases, then you'll need to edit those Package Promotion Transaction Types to be assigned to the relevant Catalogs. To edit these Transaction Types you will need to access them via:
Go to the Settings tab of the PPI_PackagePromotion and/or PPI_PackagePromotionAdditionalItems Transaction Types to connect the catalogs relevant for those phases:
It is recommended to configure a separate catalog for the Package transactions that doesn't have any Filters so as not to risk the user possibly selecting filters and then not seeing the items that participate in the package. For a detailed explanation and instructions see: Modify the Catalog setup for Package Promotion Transactions.
8. Add Item Promotion Discounts to apply inside a Package Promotion
This process is used for implementing item discount and a package discount on the same item.
Do not use this to apply Item promotions with additional items, it only supports discounts.
Example:
Package Promotion - Buy 24 from a group of hair products and get 40% discount.
AND you have an Item Promotion that also applies to a shampoo (which is a hair product)- Buy 5 get 10% off.
When ordering that shampoo as part of the "Buy 24" inside the package:
You will get 10% off the shampoo you selected with QTY >=5, from the Item promotion discount.
Then, you will also get an additional 40% off that shampoo from the Package promotion discount.
If the shampoo regular price is $10, you will get:
10% off from the Item promo -> $9
and then another 40% off $9 from the Package promo -> $5.40
Of course, you will also get the 10% discount on the shampoo when you order it (with quantity >= 5) in the catalog (not part of the package).
To enable this:
- Install the Item Promotion Setup to run on the PPI_PackagePromotion Transaction. You'll need to rename it first, then name it back to the original name. Rename package transaction to xx, install item promotion on it (Promotion Setup -> Item TP Setup -> select [whatever you renamed the PPI_PackagePromotion Transaction to] and hit "Run") and then rename it back to the original name.
- In PPI_PackagePromotion Transaction
Go to the Fields tab
Open the Transaction Line Item Fields
Edit the field PPI_PackagePromotion_Start_Unit Price (Calculated)
Add UnitPriceAfterDiscount to the participating fields
modify the formula to read:
if ( UnitPriceAfterDiscount==0)
{
return UnitPrice
}
else
return UnitPriceAfterDiscount;
It will look like this when done:
9. Define a specific Account List or Item List to use when selecting which Items or Accounts the package applies to.
When selecting Items or Accounts from a list in the Package TP Editor, the default selection list is shown.
To use a specific Account or Item selection list:
Settings -> Promotion Setup -> Package TP Setup
Click ‘Advanced setup’ and enter the List IDs (how to find the list ID - instructions below)
Account list ID format: [AG#39949]AccountList
Item list ID or Account List (new) format (generic list): [GL#22b4eef3-130b-4590-8d8b-a0d9395e7d82]ListView
You can find the list ID as follows:
1. To find the Account list ID (if you are not using the new generic list Account Lists):
Settings -> Accounts -> Account Lists
Open the browser debugger (F12), go to the Network Tab.
Edit the Account List you wish to find the ID for
Find the ‘GetListUIControl’ line in the network screen and drill down to the Data section in the preview. Find the UIControls and in it, the ‘Type’ value.
This is the required ID. It will be in the format of: [AG#39949]AccountList
2. To find the Item List ID or Account list (New) ID:
Settings -> Items -> Item Lists (or Settings -> Items -> Account Lists (New)
Open the browser debugger (F12), go to the Network Tab.
Edit the Item List or the Account List (New) you wish to find the ID for
Find the ‘GetTemplates’ line in the network screen and drill down to the Data section in the preview. Find the uiControlState and in it, the ‘Type’ value.
This is the required ID.
It will be in the format of: [GL#22b4eef3-130b-4590-8d8b-a0d9395e7d82]ListView
10. Set field values to the Package Promotion leading item line (dark blue line in cart)
In some cases, you need to update fields on the package promotion leading line (dark blue line), such as custom quantity field.
You can do that by updating the header field named TSAPPIPackagePromotionStartUpdateLeadingItem in the package promotion with the additional code you want. You can set the fields to a static value or to any other field's value.
For example, to set the field of TSAmyQuantity with a value of 1, add the following code:
0 comments
Please sign in to leave a comment.