Thumpi Development Summary

From Origami_Wiki
Jump to navigation Jump to search

Thumpi - An Overview

This page is for sharing the knowledge and experience about the development of thumpi.in. Thumpi.in is an Agri E-Commerce portal developed on top of one of the leading php e-commerce platform Prestashop(Version 1.6). There are so many custom features and modules are developed for thumpi, and the ease of customization is the prime factor which lead us to chose Prestashop first place. In this article you can find the customizations made exclusively for thumpi on the default prestashop installation.

Feel free to edit the content or share your own development experience in thumpi here.

General Hacks

Making a Module

Making a custom module in prestashop is easy. You can find all the relevant information on making your own module here http://doc.prestashop.com/display/PS16/Creating+a+first+module

Adding Newly Created Controller to Menu

After you create a new feature or module by creating your own controller and models you need to add your controller to a menu for displaying it to the menu .As far as the controller is not attached with any menu we cannot access the feature even by typing the url in the address bar.

Clearing the Cache

Prestashop uses a caching system which helps to resolve the php objects real fast by indexing every classes in the application. The index is stored in a file class_index.php under the folder cache. If the file is there when we run the application, our application will look in it to find the classes. If wee need the newly created class in a feature, prestashop cannot find the class as it is not indexed in the class_index.php . Now we must rebuild the entire index. And it is very easy as prestashop build the class_index.php if there is no index file. We only need to delete the class_index.php. This is the developer way of clearing the cache.

There is another way to clear the cache which is clicking the 'Clear Cache' button located in the back-office under the menu 'Advanced Parameters->Performance'.

Hard coded Files

  1. apanel/themes/default/template/page_header_toolbar.tpl

    Reason: By default prestashop displaying breadcrumbs for basic CRUD operations. Here in certain situations we call other controllers add page. In this situation prestashop display the page with its own breadcrumb. We need to override this for some certain pages. Here just assign the particular controller and give the necessary breadcrumb text and link in the file.



Zip Zone Binding

File:Imageedit 2 2538899984.jpg
Form for zip zone binding

You can find the Zip Zone Binding feature under the menu 'Localization'. This feature is made as a separate module so that we can just install,uninstall and reuse it anywhere. The module helps us to bind a range of zip codes to a zone. The zone is a default feature in prestashop and is uses to represent a certain geographical area. It can be as big like 'Asia, Africa', Or as small like 'vellayambalam, Thampanoor'. Here we are defining some zones and assigning range of zip codes to them so that we can define our logistics according to zones, and also we can check the ' Deliverability' (Whether we are able to deliver to a particular zip code). The list of zip code ranges can be collected from csv upload also. In the code, the module's name is zipbind, the controller is AdminzipbindController. You can find this under modules folder in a folder named zipbind. The logic is storing the starting zip code and the number of zip codes from start in db. When searching for a particular zip code resolve the ranges to arrays of zip codes and check whether the zip code is present.

Check Deliverability

File:Imageedit 4 4579676873.jpg
Check Deliverability

Check deliverability is A feature for checking a zip code against thumpi delivery. From the product page a user can check for the deliverability. By using ajax, first we resolve the zip code to zone from the zip zone binding module. Then find out the carriers who deliver to that zone and finally check whether the product is having any of those carriers in its carriers list.

Group Configuration

This Module is made for defining the some price rules based on product, customer, category, and customer group. As of now this module is deprecated and we are following some advanced logics for the same. Check the price control section.

Price Control

Price control is a set of features which provides the shop administrator the control of price of products based on seller-products, seller-category, seller, product, category, global. Find more on each price control below.

The priority of the price control is as follows

  1. Seller-Product Price control(Highest priority)
  2. Seller-Category Price control
  3. Seller Price Control
  4. Product price Control
  5. Category Price Control
  6. Global Price Control(Lowest Priority)

There are 3 configurations in each price control. Namely Marketplace charge, Service charge, additional charge. It is defined as the first two(market place and service charge) is in terms of percentage of actual price and the additional charge is in terms of a certain amount(rupees).

Seller-Product price Control

Seller-Category price Control

Seller price Control

Product price Control

This is a feature which can be found out by clicking the price control tab in the left pane of product details page in back-office. This feature is intend to get extra control over the price of every product in the shop. if it is defined for a product the price of the product would show in the shop accordingly.

Category Price Control

This can be found out in the bottom of the edit page of a category. This feature is using for controlling the price of an entire category with the price control configurations. the rule will be applied for every product in that category provided the product itself not having a higher priority price control.

Global price Control

Order note

File:Imageedit 2 9638864517.jpg
Check Deliverability

This feature is for adding notes to orders by administrator for future reference. It is located as a widget in the order details page

Seller Registration Process

By default prestashop doesn't have the concept of a seller. So that we made some customization in default customer registration to make seller registration. It can be found out in the link 'sell on thumpi' on top right corner of thumpi.in home page. On clicking the sell on thumpi button it redirected to the default customer registration page with only one difference that now the url is having an additional parameter 'isseller = 1'. In the user registration page from this url we made a hidden field with id and name as 'isseller'. after registration with this form including hidden field user is redirected to another custom made form for collecting seller data, such as shop details and bank details etc.On saving this form we register this customer as a customer. In back-office we can see this as a seller request which we can accept or reject. He can start add products on portal only after we accept his seller requests in the back end.

Another way for seller registration in thumpi is for existing customers. They can go to their profile dash board and can see the button 'send a seller request' there. On clicking the button the customer will be redirected to the seller registration form which mentioned earlier and the remaining process will be the same.

Seller approval

For every seller registration an approval is required for the completion of the process. The seller approval is takes place on the back office menu panel under the menu Catalog. On approval the customer will receive an email for confirmation. Only after the approval a customer become seller and can view the seller dash board.

Seller login

Seller Login is nothing but a usual customer login which will redirect the customer to the 'My Account' page from where they can navigate to the seller dashboard page through the button 'Go to Seller Dashboard'.


Seller dashboard

Seller Dashboard is the page where all features exclusive for a seller reside. the major links here are Products, Draft, Order Details, Payment History and bank settings.


Draft for seller product

This is for storing the products which is not yet completed by a customer. To finalize the process of adding a product the seller must 'save and sell' the product. If the multi step process breaks or the seller decided to sell the product later then it would be stored as draft. Anytime the seller can modify and decide to sell it.

Seller product approval

This is the back-office place where the administrator approves a product of a seller to sell. If the product is a newly added one then it will added to the main products list and a reference to that product will assigned to the seller. If the product is already there the reference is assigned.

View product approved

This is the back-office place where administrator can view and manage the approved seller products. It can be found under the menu Catalog.

Seller Payment details

Seller payment details is displayed in dashboard of a customer. Here seller can view all the payment he received against corresponding orders.

Seller order status

This is the provision to add order statuses for seller. Which means when a customer place an order the corresponding seller receives the order. Here the seller should take some action like, confirmed, delivered etc. We cannot allow the seller to set all available order status. so that we specify the seller specific statuses here.

Payment to sellers (Payout)

The Payout feature allows the administrator to pay the amount to sellers. The customers make financial transaction with thumpi through online payment, cod, or some other means. Then thumpi have to pay to the relevant sellers. Payout features let the admin to set the payment details against each order. This data is shown in the payment details of the seller dashboard

COD order tracking report

This report is to track the COD orders which have been shipped. All orders under shipped or partially shipped status which have been placed under COD is showing in this report. The orders sorted by date by default with latest order coming at top. This report located under the reports menu.

Pending order summary report

This report lists all order which has a status other than canceled,delivered or payment error. This is to give the admin a quick view of how many orders are there pending.


Procurement summary report

This report helps us to make a quick view about how many products need to be procure for the pending orders. This extracts the product list from all pending orders and sum up the similar products in various orders.

Product price review report

this report list out all products with their sellers and wholesale, and retail price. Good to make an overview about prices of same product by various sellers.

Pre order

File:Imageedit 6 2435127086.jpg
Product with preorder

This feature is for making thumpi capable to receive orders even if the products are not in stock. their is some back-office configuration for this feature. This feature can be found under Orders menu as Preorder Management. We can add preorder rules here. A preorder rule can be applied to whole category or certain products. Also we can set the message to display while the preorder is active, and text in button to display etc here. Once a preorder is set we need to check this in two stages.
1. Default product listing

when we fetch product list to show in frontend we need to check for any preorder rule exist for any product in the list, and display the products accordingly. The major modifications comes in product-list.tpl file in themes


2. Product Page

This is the page which displays detailed view of a product. Some changes are made here also.

Overridden Method = Override/Classes/Product.php::checkQty()

Invoice design update

We have changed the default invoice design completely. The design files are located in the pdf folder. We have changed some fonts to deal with the malayalam rendering and bold issue. The fonts are located in tools/tcpdf/fonts directory. We can use any ttf files here by converting them into afm. you can use this link for convert ttf to afm: http://fonts.snm-portal.com/