E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs ....

32
E-Commerce: Web and Cart Rules Intermediate Wednesday: 10:30 – 12:00am By: Mike Poling & Michael Guttman

Transcript of E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs ....

Page 1: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

E-Commerce: Web and Cart Rules Intermediate

Wednesday: 10:30 – 12:00am By: Mike Poling & Michael Guttman

Page 2: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

2

Description: This class will examine the various ways that Web Rules and Cart Rules

can be used in E-Commerce. Objectives: • To learn how to configure Web Rules to sell Pass/Membership packages • To explore the use of Cart Rules for adding a shipping fee or discount to

the shopping cart • To learn how to use Cart Rules to enforce the quantity of an item or items

in the shopping cart

Description & Objectives

Page 3: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

3

Web Rules: What are they & how do they work? • Enable you to create packages of items for sale via the E-Commerce

pages • The package consists of a “main item” plus additional “auto-sold items” • Can evaluate age criteria or restrictions of guests attached to the items in

the package • Can be nested to create more complex packages • Web Rules are configured on the Web tab for an item and use the

SELECTITEM(“DCI”) macro

Page 4: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

4

Web Rules: Example: Family Pass Package consisting of up to 4 passes where only 2

of the 4 guests can be 18 years of age or older In DCI’s create a new Category in the Passes Department named INTPASSES

Page 5: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

5

Web Rules: In the INTPASSES Category, create two new items and save

them.

Nickname Description

FAMPASSPKG Family Pass Package

PASSPKGADD Pass Package Additions

Page 6: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

6

Web Rules: Add the Items to your Item Tree and ‘uncheck’ the Active box

for the PASSPKGADD item.

Presenter
Presentation Notes
The additional pass item (pass package additions) is also in the item tree, but it is located in a folder that is inactive and therefore is not seen on the Web site. This is done to prevent guests from only purchasing the pass package additions item while still allowing Sales Host to process sales containing this item.
Page 7: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

7

Web Rules: Open the FAMPASSPKG item and select the action tab.

Change the Item Type to ‘Create Pass’.

Page 8: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

8

Web Rules: Select the General Tab and enter some descriptive text in the

Help field about the details of the pass package.

Page 9: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

9

Web Rules: Select the Restrictions Tab and set the Min Qty and Max Qty

to 1

Page 10: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

10

Web Rules: On the Web tab insert the following

Action to execute when this item is sold on the web

SELECTITEM("PASSES INTPASSES PASSPKGADD")

Rule to enforce on a grouping of item created by the Web Rule

tally(age>=18)<=2

Text to display if Web Rule is violated

Sorry, but only 2 guest can be over the age of 18 for the Family Pass Package. Please reselect your guests.

Presenter
Presentation Notes
The Action to execute when item is sold on the web field gets populated with a macro that auto-sells the additional pass items. The macro must take the form SELECTITEM("DCI") which needs to have the D, C, and I all padded with spaces to equal 10 characters each (30 characters total). The Rule to enforce on a grouping of items created by the Web Rule instructs the Web pages that only 2 guests can be at or over the age of eighteen for this pass package. The Text to display if Web Rule is violated is displayed after all guests have been added to the passes in the package, and their ages violate the rule (i.e., greater than 2 guests attached to the passes in the package are 18 or over in age). Save this item.
Page 11: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

11

Web Rules: Open the PASSPKGADD item and make the following changes.

Action Tab: Create Pass General Tab: Add Help text as necessary Restrictions Tab: Min Qty = 1 and Max Qty = 3

Presenter
Presentation Notes
Make these changes and save.
Page 12: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

12

Web Rules: Results The Family Pass Package item appears in the Item Tree, but

the Pass Package Additions does not.

Presenter
Presentation Notes
Make these changes and save.
Page 13: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

13

Web Rules: Results The Quantity selector is disabled, and the Help text appears

under the item.

Presenter
Presentation Notes
Clicking Add to Cart will run the SELECTITEM macro and autosell the Pass Package Additions *Correction from the notes. In version 4.1+, the guests are now added at the cart level. They will not need to associate a guest immediately after clicking Add to Cart.
Page 14: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

14

Web Rules: Results The Pass Package Additions item loads and limits the quantity

selector to a maximum of 3.

Presenter
Presentation Notes
Clicking Add to Cart will now take you to the Cart Show page where you can add your guests.
Page 15: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

15

Web Rules: Results The package is added to the cart and the user will then select

their guests.

Presenter
Presentation Notes
Note, only one remove button.
Page 16: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

16

Web Rules: Results If the user selects more than 2 guests that are ages 18 or

older, they are prompted with this message at checkout.

Presenter
Presentation Notes
Note, only one remove button.
Page 17: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

17

Exercise: Souvenir Package In SysManager create a new DCI: Restrictions Tab: Set Min Qty and Max Qty to 1 Web Tab: Action to execute when item is sold on the web field:

SELECTITEM(“RETAIL SOUVENIRS CALENDARS ”)

Department Category Item

PACKAGES RETAILPKGS SOUVENRPKG

Packages Retail Packages Souvenir Package

Presenter
Presentation Notes
Last row in Table are the descriptions. Note again, the Padding of the DCI. 1st will need 4 spaces, 2nd needs 1 space and 3rd needs 1 space. Note that in the workbook it is missing the Quotations, it won’t work without them.
Page 18: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

18

Exercise: Souvenir Package Save this item and add it to the Item Tree by dragging the Retail

Packages folder to the root of the Item Tree.

Page 19: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

19

Exercise: Souvenir Package Web Tab: Enter for the following items.

Item (description) Action to execute when item is sold on the web

Calendar SELECTITEM("RETAIL SOUVENIRS MUGS ")

Mugs SELECTITEM("RETAIL SOUVENIRS POSTERS ")

Presenter
Presentation Notes
Note again, the Padding of the DCI and missing quotations from the workbook. Save these items. Using the E-Commerce pages locate and select the Souvenir Package item in the Web item tree – when you get to the ItemShow.aspx page click the Add to Cart button Click the Add to Cart button for the Calendars, Mugs, and Posters items as they appear in sequence on the ItemShow.aspx page
Page 20: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

20

Web Rule: Automatically Apply a Special to an item

Example:

Action to execute when item is sold on the web

SPECIAL("WEB25%OFF ")

Presenter
Presentation Notes
The SPECIAL() macro is used to automatically apply a special to specific item. Open an item, select the WEB tab and enter SPECIAL with the name (not description) of the special. This must also be padded to 10 characters.
Page 21: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

21

What are Cart Rules? • Used to evaluate Cart contents at the Checkout.aspx page. • Cart Rules are configured directly in the SiriusSQL database in

a table called cartrule • Can be filtered to run on specified instances of E-Commerce

through the web.config • Can enforce the presence or quantity of one or more items in

the cart. • Can add one or more items to the cart. • Are executed automatically when either the Checkout.aspx or

Checkout1.aspx page loads.

Page 22: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

22

Fields in the CartRule table in SiriusSQL • department, category, and item • cartrule

Ex: tally() >= 2

• message • cartaction

Ex: CARTADD(<department>MISC</department><category>SHIPPING </category><item>LOWSHIP</item><options><price>2.50</price></options>)

• required • notes • sitefilter

Presenter
Presentation Notes
DCI: These fields can either be populated with a valid department, category, or item or left blank – leaving one blank means any value is valid for that field when items in the cart are evaluated. For example, for all items in the RETAIL department, SHIRTS category, the department field would be populated with RETAIL, the category field would be populated with SHIRTS, and the item field would be left blank. CartRule: This field contains a function and a comparison – currently, the only function supported is tally(), which is designed to check the number of the item(s) in the shopping cart that match that specified in the department, category, and item fields. For example, tally() >= 2 means that there must be two or items in the cart that match the item(s) specified in the department, category, and item fields in order for the rule to pass. Message to display on the Checkout.aspx (or Checkout1.aspx) page if the cartrule fails and required is set to True. For example, “You must buy two or more of item X.” CartAction: This is an action to be performed if the cartrule passes – this is optional and can be left blank if you do not want any action to be performed. Currently the only action supported here is cartadd(), which is used to add an item to the cart if the cartrule returns a true result. For example, the following would be used to add the LOWSHIP item from the MISC department, SHIPPING category priced at $2.50 to the shopping cart if the cartrule passes: Required: This can be set to 1 (True) or 0 (False). Setting it to 1 requires that the item designated in the department, category, and item fields must be in the cart and meet the cartrule criteria. Setting it to 0 executes the cartrule only if that item is present, but not having that item in the sale does not cause the Cart Rule to fail. notes – This field can be used to document the rule or can be left blank. sitefilter – This corresponds to the web.config setting as to which instance of E-Commerce (or virtual directory) this cart rule should run for.
Page 23: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

23

CartRule Configuration, Process and Results In the following exercises we will create Cart Rules to add a

shipping fee to a sale and apply a discount to a sale. Web.config: <add key="WebSiteID" value="retail"/>

C:\Program Files\SiriuswareDemo\Ecommerce\Pages

DCI:

Department Category Item Description

RULES CARTRULES SHIPPING Shipping

RULES CARTRULES DISCOUNT $10 Discount

Presenter
Presentation Notes
Add 2 new items, this will save us time as run through the exercises. Save the items and drag the CARTRULES folder to the root of the item tree. Highlight the folder and uncheck the ‘Active’ box as we don’t want these Items to appear in the Item Tree.
Page 24: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

24

Exercise: Add Shipping Fee when 3 or more MUGS are in the cart department category item

RETAIL SOUVENIRS MUGS

cartrule message tally() >= 3

cartaction CARTADD(<department>RULES</department><category>CARTRULES</category><item>SHIPPING</item><options><price>5.0</price></options>)

required notes sitefilter False Adds a $5.00 shipping charge to all

sales of 3 or more MUGS . . . retail

Presenter
Presentation Notes
Add the following values to the cartrule table in SiriusSQL *Please note a couple of errors in the workbook highlighted in red. In CartAction, the Item needs to ‘SHIPPING’ instead of ‘DISCOUNT’ and it missing a ‘/’ before the closing ‘options’ tag. Also, the required field does not accept 0 or 1 as a boolean value, it must True or False. *Note: If you have the red mark on the row in the database, you can hit the ‘!’ button or right-click at the beginning of the row and select ‘Execute SQL’ from the context menu.
Page 25: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

25

Results CartShow.aspx Checkout.aspx

Presenter
Presentation Notes
Adding a quantity of 4 to the cart, when you click on proceed to checkout, the checkout page automatically adds the shipping item and prices it accordingly.
Page 26: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

26

Exercise 2: Add a $10 Discount whenever there are 5 or more items in the cart from the from the RETAIL Department and SOUVENIRS Category.

Page 27: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

27

Exercise 2: department category item

RETAIL SOUVENIRS

cartrule message tally() >= 5

cartaction CARTADD(<department>RULES</department><category>CARTRULES</category><item>DISCOUNT</item><options><price>10.0</price><qty>-1</qty></options>)

required notes sitefilter False Adds a $10.00 discount ($10.00 * -1)

to all sales containing 5 or more . . . retail

Presenter
Presentation Notes
Add the following values to the cartrule table in SiriusSQL
Page 28: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

28

Results CartShow.aspx Checkout.aspx

Presenter
Presentation Notes
Adding a quantity of 6 to the cart, when you click on proceed to checkout, the checkout page automatically adds the discount item and prices it at -$10.00 ($10 * -1).
Page 29: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

29

Other configurations . . . Add a variable price based on a percentage of the cart total.

Department Cartrule Required

TICKETS tally() >= 1 false

cartaction CARTADD(<department>RULES</department><category>CARTRULES</category><item>PERCENTFEE</item><options><price>7.5%</price></options>)

Page 30: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

30

Other configurations result

Page 31: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

31

What else can Cart Rules do? • Specify a maximum quantity for an auto-added item. • Apply Member login discounts to items added via Cart Rules

during the checkout process. • Require that one or more of a product is present in the cart

before allowing checkout

Presenter
Presentation Notes
Within the <options> tags, you can now enter a <maxqty> which caps the number of times that the auto-added DCI can appear in the cart. This gives the ability to add the same DCI from multiple rules, but limit the number of times the DCI gets added. So, for example, one could use a CARTADD cart action such as the one shown below to add a shipping item to the sale. The cart action could be configured to work with several different items, but with the new <maxqty> functionality, the auto-added item would only be added once If a member has successfully logged in, an auto-added item that was added to the cart via Cart Rules can be discounted via the macro SELECTIVESPECIAL("SPECIAL") There is more detailed documentation on this setup in Master_40_Ecommerce_User_Guide.pdf.
Page 32: E-Commerce: Web and Cart Rules€¦ · SELECTITEM("RETAIL SOUVENIRS MUGS ") Mugs . SELECTITEM("RETAIL SOUVENIRS POSTERS ") Note again, the Padding of the DCI and missing quotations

Thank You!