PHPackages                             rubenmartindev/prestashop-version-checker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rubenmartindev/prestashop-version-checker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rubenmartindev/prestashop-version-checker
=========================================

A lightweight library to check and compare PrestaShop versions with a fluent API

v1.1.1(1mo ago)0151MITPHPPHP &gt;=5.6.0

Since Apr 29Pushed 1mo agoCompare

[ Source](https://github.com/rubenmartindev/prestashop-version-checker)[ Packagist](https://packagist.org/packages/rubenmartindev/prestashop-version-checker)[ RSS](/packages/rubenmartindev-prestashop-version-checker/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (1)

PrestaShop Version Checker
==========================

[](#prestashop-version-checker)

A lightweight library to check and compare PrestaShop versions with a fluent API.

Installation
------------

[](#installation)

```
composer require rubenmartindev/prestashop-version-checker
```

Requirements
------------

[](#requirements)

- PHP &gt;= 5.6.0
- PrestaShop (any version)

Usage
-----

[](#usage)

### Using the helper function (recommended)

[](#using-the-helper-function-recommended)

```
// Check if PrestaShop version is less than 1.7
if (is_ps_version('=1.7')) {
    // PrestaShop 1.7+ code
}
```

### Using the class directly

[](#using-the-class-directly)

```
use RubenMartinDev\PrestaShopVersionChecker\PrestaShopVersionChecker;

if (PrestaShopVersionChecker::is('1.6')

// Greater than or equal
PrestaShopVersionChecker::gte('1.7');   // Same as is('>=1.7')

// Equal
PrestaShopVersionChecker::eq('1.7.8');  // Same as is('==1.7.8')

// Not equal
PrestaShopVersionChecker::neq('1.6');   // Same as is('!=1.6')
```

Check if the `compare` is valid
-------------------------------

[](#check-if-the-compare-is-valid)

```
use RubenMartinDev\PrestaShopVersionChecker\PrestaShopVersionChecker;

PrestaShopVersionChecker::isCompareValid('
