Creating an Affiliate Program in Odoo

Learn how to create an Affiliate Program in Odoo by appending additional context to CMS pages

This is part one of two videos that will demonstrate how to create an Affiliate Program in Odoo. See behind the scenes the development of OdooClass.com's new affiliate program. You will learn the correct way to add additional context to several CMS pages. You will learn how to create web controllers, perform URL routing, and develop an Odoo web application.

TOPICS COVERED:
  • Introduction: Creating a custom affiliate application for OdooClass
  • Creating a website controller handle URL parameters
  • Storing URL parameters in website cookies
  • Modifying the XML of the subscription buttons
  • Debugging website controllers and view templates
  • Troubleshooting views that do not update
  • Using t-attf-href to set dynamic url parameters
  • Website controller @http.route for the video subscription page
  • Inherit from the page controller from website.controller class

What is an Affiliate Program and why would I want one?

An affiliate program is an automated electronic program that involves a Web advertiser and recruited webmasters. The webmasters, as affiliates, place the company's advertisements on their individually owned websites. The ads in affiliate programs are linked to company websites and are referred to as affiliate links. You want this because it helps increase sales.

Creating the foundation for an Affiliate Program

The affiliate program for OdooClass will be built up over several phases. In this video, you will learn how to use Odoo's web services framework to capture the affiliation link coming from a affiliate website. Then you will write a program that will check for the existence of the affiliate id and place it in a cookie so that it can be used to credit the sale to the respective affiliate.

Adds value to any website that sells products or services

Getting your product or service visible in today's market is not easy. While out-of-the-box Odoo provides great eCommerce features, it does not offer any features that allow you to build out an affiliate network. Companies like Amazon owe much of their success to successful affiliate networks. Now you can learn how to add your own affiliate network to any Odoo eCommerce site!

How to Create a Web Controller in Odoo

When creating a web controller in Odoo you can use the @route decorator to determine which URL's your application should respond to. In our video example we demonstrate how you can develop a web controller that can respond to a specific parameter.

You begin by creating route decorator and the function that will respond to the URL when there is a match. This is known as URL routing:

@http.route('/page/<page:page>', type='http', auth="public", website=True, cache=300)
def page(self, page, **opt):
     values = {'path': page, 'deletable': True,}
     # /page/website.XXX ---> /page/XXX
     # Your website controller code can now operate on the values
			
Odoo text and image block

Creating more Advanced Web Controllers in Odoo

Where can I learn more about web controller and URL routing in Odoo?

Building a web application in Odoo often will require integrating with other services. In our affiliate system we must allow webmasters to embed a unique affiliate account # within the URL so that we can properly credit the commissions for the sale. Fortunately Odoo provides the framework for URL routing that is standard and has plenty of documentation. After you have watched the video and understand the basics, there are several reference resources you can turn to when you need to create more advanced web controllers.

Web Controller Reference Documentation: You can learn more about Odoo's web controller here. While there are not many examples the documentation does give you the parameters you can use when constructing an Odoo web application.

URL Routing Documentation Like much of the Odoo framework, URL routing in Odoo is based on a common library known as Werkzeug. Werkzeug is an HTTP and WSGI utility library for Python. You can learn more about URL routing here.

Odoo image and text block

Integrate Affiliate Marketing Into your Odoo Website

Once you have a product or service attention typically turns to SEO and other methods in order to get traffic to your website. Many successful eCommerce companies however take it a step further. They offer commission to those who send them customers that purchase their products. This creates a win-win situation. Furthermore, affiliate marketing is often performance based instead of per-impression based marketing. If someone is advertising your product but not producing sales you don't have to pay any advertising expenses. Contrast this to banner advertisements in which you must pay for impressions or Google Adwords in which you pay for clicks that may never turn into sales.

In this video you will get to learn how to build your own affiliate system in Odoo. Furthermore, we will be using this same design to implement an affiliate program for OdooClass. This Building OdooClass series will give subscribers behind the scenes look at real Odoo development. Not contrived examples but real-world Odoo solutions that power real eCommerce websites.


Your Instructor


Diogo Duarte
Diogo Duarte

Diogo Duarte has a degree in Electrical Engineering and Computer Science with 20 years of experience in several industries, both functional and technical. He is an Odoo developer and Project Manager across the EU, the USA, and AU and the Head of Technical Consulting for OdooClass since 2014.


Diogo is an expert in all things Odoo and has been consulted on hundreds of Odoo projects in nearly every industry sector. If you need a problem solved with Odoo, Diogo can find you a solution.

Diogo is also the creator of much of the training content available on the OdooClass website and has been performing the weekly and monthly workshops with subscribers around the globe since 2014.

Course Curriculum


  Developer Series: Building OdooClass
Available in days
days after you enroll

Frequently Asked Questions


When does the course start and finish?
The course starts now and never ends! It is a completely self-paced online course - you decide when you start and when you finish.
How long do I have access to the course?
How does lifetime access sound? After enrolling, you have unlimited access to this course for as long as you like - across any and all devices you own.
What if I am unhappy with the course?
We would never want you to be unhappy! If you are unsatisfied with your purchase, contact us in the first 30 days and we will give you a full refund.

Get started now!