Product Recommendations Managing Product Recommendations Types of Product Recommendations Product...

22
Lecture#08

Transcript of Product Recommendations Managing Product Recommendations Types of Product Recommendations Product...

Page 1: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Lecture#08

Page 2: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Outline

Product Recommendations Managing Product Recommendations Types of Product Recommendations Product Out of Stock Out of Stock Management Let me know when Product is back in

Stock

Page 3: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Product Recommendations Product Recommendation is a process of

showing some products to customers This recommendation is based on:

Few products go hand in hand (sale out) Mostly customers are interested in certain products suggest some relevant products to our customers

based on their previous purchase There are two ways of Product

Recommendations Displaying related products on a products page E-mailing customers who have made certain

purchases to inform them

Page 4: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Related Product Recommendations

Simplest way is to show related products within the product view/page It needs relationship among products

within table If there is relationship among

product Display these products as recommended

products within product view Else, show only product information How can we maintain relationship

among products within model/database/table?

Page 5: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Related Product Recommendations

Following are the ways to maintain relationship among products Within the products table we maintain a serialized array

of related product IDs We group related products together by themes We relate pairs of related products together

A serialized array isn't the most effective way to store related product data

Relating them by themes would prove problematic with multiple themes

Relating pairs of products together would require alittle trick with the query to get the product name

Page 6: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Related Product Recommendations

To maintain pairs of relating products the following table structure: ID (Integer, Primary Key, Auto Increment) ProductA (Integer) ProductB (Integer)

How to differ between ProductA and ProductB?

ProductA : the product we were currently viewing

ProductB : the related one, productB

Page 7: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Related Product Recommendations

Page 8: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Related Product Recommendations Controller of the product recommendations

will perform the following functions Return random related products Cache results Associated cached results with template

variabale Controller required only current product id to

perform above functionality View contains only following code

Page 9: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Related Product Recommendations

Page 10: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Related Product Recommendations

Email Recommendations Email recommendations should involve the

following features1. Search customers with previous purchases that match

a subset of the product catalog1. for example customers who purchased a red t-shirt and a red

baseball cap

2. Select products that are related to the subset and we think those customers would be interested in

3. Generate an e-mail based on those products, a set template, and other content we may wish to supply

4. Send the e-mail to all of the customers found in step 1

Page 11: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Out of Stock Product

Product out of stock means Product is not available to sale Product has zero in quantity in warehouse

When product is back in stock, customer must inform about product availability

Customer should must signup for this service

If we don’t inform to customer about availability Customer lefts the site and go elsewhere He will not back to check regularly stock

level

Page 12: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Out of Stock Product

We need the following steps to manage out of stock products1. we need to take into account stock levels2. If a product has no stock, we need to insert a

new template bit with an "alert me when it is back in stock" form.

3. We need a template to be inserted when this is the case

4. We then need functionality to capture and store the customer's e-mail address, and possibly their name, so that they can be informed when it is back in stock.

Page 13: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Out of Stock Product

5. Next, we need to be able to inform all of the customers who expressed an interest in a particular product when it is back in stock.

6. Once our customers have been informed of the new stock level of the product, we need to remove their details from the database to prevent them from being informed at a later stage that there are more products in stock.

7. Finally, we will also require an e-mail template, which will be used when sending the e-mail alerts to our customers

Page 14: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Detecting Stock Level (Model) Not all products required stock level to

maintain Tangible products required stock level Non-Tangible products required no stock level

To maintain stock level for a product we need A column in Product table for stock value

Stock column may have following values Zero value: means product is out of stock >zero vale: means product is in stock <zero value: means stock entry is not required

for this product

Page 15: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Detecting Stock Level- (Model)

Another way, is to create two new columns in Product table Stock: store stock numeric +ve value Stock_Required: for a check, either stock is

required for particular product or not? Stock Column has integer value >=zero Stock Required has Boolean value (true,

false) This method is not encouraging because

We need to maintain additional checks And additional column in table

Page 16: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Detecting Stock Level- (Controller)

We need simple checks on stock value column

Page 17: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Detecting Stock Level- (View) We need two things in template if producti s out of

stock Out of stock message to customer for inforamtion A form to collect customer information to inform him

when product is in stock

Page 18: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Detecting Stock Level- (View)

What happens when we click on

this button

Page 19: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Tell me when it is back in stock please!

Once a customer has entered their name, e-mail address, and clicked on the submit button

We need to store these details in database Associate each entry with a product that is

currently out of stock This involves a new database table

A table to maintain the relationship between products and customers

Only those customers who wish to be notified when products are back in stock

Page 20: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Tell me when it is back in stock please!

New table required only five columns

Column Name

Data Type Description

ID Integer (Primary Key,Auto Increment)

The ID for the stock alert request

Customer Varchar The customer's name

Email Varchar The customer's e-mail address

ProductID Integer The ID of the product the customerwishes to be informed about whenit is back in stock

Processed Boolean Either informed to customer or not

Page 21: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

Tell me when it is back in stock please!

Page 22: Product Recommendations  Managing Product Recommendations  Types of Product Recommendations  Product Out of Stock  Out of Stock Management  Let.

When it is back Alert those customers that the product which

they were interested in is back in stock and they can purchase it now

What is involved in this process? The administrator alters the stock level Customers interested in that product are looked

up E-mails for each of those customers are generated

with relevant detail E-mails are sent to the customers Delete records of processed alerts from database

How?