Book Image

PrestaShop Module Development

By : Serny
Book Image

PrestaShop Module Development

By: Serny

Overview of this book

If you are a developer who is new to PrestaShop and wants to get a good foundation in development on the PrestaShop framework, this book is for you. It's assumed that you will have some experience with PHP5, jQuery, and HTML/CSS (no need to be an expert on it).
Table of Contents (13 chapters)
12
Index

Displaying relay points


We are almost done! We will now see how to handle the relay points. You will not always need to manage relay points when you create a carrier module, but this is just an example here. With this method, you will be able to manage other things, such as delivery options (and insurance).

We will begin by attaching our module to the displayCarrierList hook. Then, create the hook method and the associated controller. At this point, I don't think I need to explain how it works again, but if you're experiencing some difficulties, do not hesitate to look at the code files attached to the code of this chapter (or to look at my GitHub repository: https://github.com/FabienSerny/mymodcarrier).

Create a displayCarrierList.tpl template in the views/templates/hook/directory and use it in your controller's run method:

public function run()
{
  return $this->module->display($this->file,'displayCarrierList.tpl');
}

As for the shipping costs, we will build one method to retrieve...