Tag: module

  • Prestashop Google Product Search

    Prestashop Google Product Search

    Since August 2008 when we first released a Google Product Search (Google Base) module a lot has changed. Not only has Google’s own service undergone a series of changes to the feed specification, Prestashop has also moved on.

    The release of Prestashop 1.4.x in particular has seen support for many of the additional data items not previously possible to include, along with major changes in the generation of SEO urls which alone merit a code refresh. It has also become much harder to get good rankings in Product Search as the uptake has increased, and more attention needs to be taken in terms of feed data quality than ever before.

    (more…)
  • Fixed version of the gsitemap module

    There seems to have been a lot of problems with the Google XML Sitemap generator shipping with PrestaShop 1.2, so I’ve had a run through and re-written a fair bit of the code to fix these issues.

    The main changes (in 1.4.2) are:

    • New XML generation code using the DOMDocument* class
    • Modified the logic to remove extra elements from the generated URLs
    • Added an xml-stylesheet reference to the output file, xsl included in download
    • Fixed the issues when “Friendly” urls are turned off
    • Add a new field to the cms table on install to track modified dates (auto updating)
    • Added removal of additional field on uninstall

    *If your server doesn’t support this then sorry. Go elsewhere for hosting!

    Updated to 1.4.3 — 10 August 2009

    • Added error checking and reporting

    Updated to 1.4.4 — 18 August 2009

    • Added images to the sitemap (as introduced in the 1.4 version in the 1.2.1.0 distribution)
    • 1.2.1.0 including fixes to the Link class which broke 1.4.3, so fixed that
    • Added cross-compatibility so this version works in both 1.2.0.x and 1.2.1.x
    • Fixed a bug when __PS_BASE_DIR__ is set to other than the site root

    Download the Prestashop Google XML Sitemap Module v1.4.4 now.

  • Storing complex configuration data

    While porting the WP-Cumulus plugin to Prestashop I came across an interesting situation. In the original plugin the parameters for the Flash movie are stored in an array that is obtained from the WordPress database using a get_option() call. In Prestashop the parameters can be retrieved in bulk using Configuration::getMultiple(), but in that case you have to specify the key names for all the parameters which is a pain.

    What I decided to do was to use the serialize() and unserialize() php functions and store the options as a single configuration item in the database. That way we use:

    // Get the options
    $newoptions = unserialize(Configuration::get($this->name.'_options'));
    
    // Save the options
    Configuration::updateValue($this->name.'_options', serialize($newoptions));

    The above works great in this situation, as the parameter names aren’t language dependent, but this technique isn’t suitable if your configuration data key needs to be defined in multiple languages.

  • Moving Boxes Home Featured jQuery module

    I thought it was about time for yet more free Prestashop eye candy, so here’s yet another home featured products module for you all to play with!

    Just specify how many products you’d like to feature in the configuration screen and sit back and enjoy! Well, maybe not as I suspect you may also want to play with the css file in the module directory to modify the style to suite your stores. There are also a few images you may want to tweak too!

    The javascript and markup is only gently modified from the original obtained from the superb CSS Tricks.

    UPDATE: There was a slight error in the uninstall function which resulted in an error when you try to remove it. Updated is available below and should just be copied over the 0.1.0 version to fix.

    Version 0.1.0 (Initial Release August 2009) : Moving Boxes “Featured Products” module

    Version 0.1.1 (Bugfix Release August 2009) : Moving Boxes “Featured Products” module

  • AddStuff is almost 1 Year old!!

    Who would have believed it! Well to celebrate, and also to fix a few problems it’s recently been updated. You can grab the latest version, as always, from the Addstuff page

  • PS_Cumulus a WP-Cumulus port to Prestashop

    I was looking to write a cool module to use in future tutorial articles when I came across the nifty looking WP-Cumulus WordPress plugin by Roy Tanck. It had all the elements I was looking for, and he has kindly released the code (including the flash source) under the GPL license. Approximately 2 hours later PS_Cumulus was born!

    Before anyone asks, the name has to use an underscore as a hyphen isn’t allowed in PrestaShop class names….

    (more…)
  • Writing your own Prestashop Module – Part 4

    Form Validation and Security

    While being sufficiently functional for what it does, the module we created in Part 2 does present us with some issues to consider when implementing “real world” modules to extend Prestashop. In particular the user input we captured with our form was written directly to the configuration entry without any checking to determine whether it was valid, nor did we take account of the type of data being entered.

    In this tutorial we will look at the general issue of form input checking and security, both for Back Office and Front Office forms and user input as well as looking at improving our code both functionally and aesthetically.

    Updated for Prestashop version 1.4 onwards.

    (more…)
  • Paypal WPP (Example) – PayPal Direct API

    Development Release

    I’ve been asked several times about this, so I guess I’d better release the code. This was written some time ago, and the target PrestaShop version was 1.1, however it should work with later releases.

    The archive contains additional code to support PayPal Express Checkout, as this was originally developed as a shared library. A PayPal Express Checkout example will also be published here shortly.

    Please note that this is intended for “development” purposes only as an example and was written to test out various concepts in PrestaShop, not as a robust payment method for use in commercial stores.

    (more…)
  • Writing your own Prestashop Module – Part 3

    Storing Module Configuration

    In the third part of this series we’ll look at how we can store configuration data for our modules in the Prestashop database, and how we can allow users to interact with this data to control the module’s behaviour. We will also briefly touch on how we can generate output from our module to provide visual feedback of the configuration changes.

    Updated for Prestashop version 1.4 onwards.

    (more…)
  • Writing your own Prestashop Module – Part 2

    Creating a basic module

    In this second part of the series we will look at creating our first basic Prestashop module that can be controlled from the Back Office.

    Similar to the ObjectModel base class, all Prestashop modules are extended from a common base class used to define their basic functionality. The “Module” class provides the interface between the administration screens and your module as well as providing internationalisation and “hook” management functionality.

    Updated for Prestashop version 1.4 onwards.

    (more…)