Techie Tips

Tips, Tutorials, Software and Reviews

prestashop

Creating a Prestashop Payment Module: Completing the Module

Submitted: Tue, 10/11/2011 - 20:06 -- guvnor
Last Updated: Tue, 10/11/2011 - 20:13

That's all Folks

Well that's almost done, there is just a bit more work though - now that our users can enter their payment details we need to be able to retrieve them in our administration panel.

Displaying the order info in the admin panel

We need to hook into the invoice part of the administration panel. We have already declared we want to access the invoice hook earlier in our install() function
OR !$this->registerHook('invoice')

Creating a Prestashop Payment Module: Taking the payment

Submitted: Tue, 10/11/2011 - 19:50 -- guvnor
Last Updated: Tue, 10/11/2011 - 19:50
ow our payment option is available to our user's we need to create the actual page that is displayed when the payment option is clicked on. As part of this process a form will be displayed for the user to enter their card details and then store them in the database for later viewing. If you recall it was payment.php So that is the name of the next file we need to create in our payment modules directory. Okay, so create a new file called payment.php and place the following code into it:
<?php
 

Creating a Prestashop Payment Module: Displaying our module as a payment option in the checkout

Submitted: Tue, 10/11/2011 - 19:48 -- guvnor
Last Updated: Mon, 05/07/2012 - 13:12

Displaying our module as a payment option in the checkout

Since we have a registered our module with the payment hook a function which tells the payment hook to do something. The hook payment expects a function called hookPayment by default so thats what we need to create. This is where the hook payment allows us to have our module appear (image below)

Create the hookPayment() function

Creating a Prestashop Payment Module: Testing the Install

Submitted: Tue, 10/11/2011 - 19:44 -- guvnor
Last Updated: Tue, 10/11/2011 - 19:45

Testing the Install

Click the "install" button next to the Offline Payments.

If successful you should see a message displayed that says "Module installed successfully" We can also see within our prestastore database that the payment module is now listed as a module. Below is an example (using phpmyadmin) which shows that our module has been added to the list of prestashop modules - we can verify that by the fact it has been added to the prestashop modules table.

Creating a Prestashop Payment Module: Creating the Install Routine

Submitted: Tue, 10/11/2011 - 19:39 -- guvnor
Last Updated: Tue, 10/11/2011 - 19:41

Making the module's install routine

Building the standard install() function

Prestashop modules have an install link. This link needs to be clicked to install the module to make it actually function within the store. NOTE! Basically, what although the module is listed in your store as an available module, you need to to click install to actually activate the module for it to be active in your store. See below:

Turn on Prestashop Error Reporting

Submitted: Thu, 06/16/2011 - 16:46 -- guvnor
Last Updated: Fri, 06/17/2011 - 11:05

Turn on Error Reporting

When you are trouble shooting a prestashop stall by default the store will supress error messages. This can be pain when you are trouble shooting a prestashop install. It is easy enough to to turn this error message suprssion of though.
Open the file
<storeroot>/config/config.inc.php

find the line which says
@ini_set('display_errors', 'off');
it is on line 29 on my default install of prestahop 1.4
and change it to

Creating a Prestashop 1.4 Theme / Template Part 1

Submitted: Sun, 05/08/2011 - 14:13 -- guvnor
Last Updated: Sat, 05/12/2012 - 11:10

Create the theme folder structure.

First thing we need to do is build a folder structure under your prestashop themes folder.

We need to create a top level folder which we will call whatever we wish to call our theme. In my case I am calling my theme "bluefairy" so I will call my theme top level folder "bluefairy"

Under this folder I will create the following sub folders

js, img, css, lang and cache

Creating a Prestashop 1.3 Theme Part 3

Submitted: Sun, 02/06/2011 - 12:28 -- guvnor
Last Updated: Mon, 10/31/2011 - 08:13

Introduction

This is part 3 of the guide that is designed to assist you with building a new theme for your Prestashop cart. You can read Part 1 and part 2 here

Creating a preview.jpg and enabling the theme

Create a file called preview.jpg in your favorite graphics editor (gimp, photoshop etc)and save it in the root directory.
[toc hidden:1]

Creating a Prestashop 1.3 Theme Part 2

Submitted: Wed, 02/02/2011 - 21:48 -- guvnor
Last Updated: Fri, 02/25/2011 - 12:15

Introduction

This is part 2 of the guide that is designed to assist you with building a new theme for your Prestashop cart. You can read part 1 here

Build your shops header with header.tpl

The first file prestashop opens when it begins running (i.e someone requests it by navigating to the site)is index.php. If we look at this file index.php (shown below in Prestashop's root directory
[toc hidden:1]

Prestashop 1.3 Smarty Global Variables

Submitted: Mon, 01/31/2011 - 11:27 -- guvnor
Last Updated: Mon, 01/31/2011 - 11:50

Introduction

Please find a useful list of prestashop smarty variables. This is very useful when creating a template / theme or a module for prestashop. This list is taken from the init.php file found in the root of prestashop installation.

The list

The left hand items listed in red such as 'base_dir' are the variables you would use in your prestashop smarty templates. The right hand side points to what they mean.

Pages

Subscribe to RSS - prestashop