Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
luciobenini committed Sep 16, 2020
0 parents commit 8513996
Show file tree
Hide file tree
Showing 10 changed files with 872 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Private files
# The following files contain your database credentials and other personal data.

config/settings.*.php

# Cache, temp and generated files
# The following files are generated by PrestaShop.

admin-dev/autoupgrade/
/cache/*
!/cache/index.php
!/cache/*/
/cache/*/*
!/cache/cachefs/index.php
!/cache/purifier/index.php
!/cache/push/index.php
!/cache/sandbox/index.php
!/cache/smarty/index.php
!/cache/tcpdf/index.php
config/xml/*.xml
/log/*
*sitemap.xml
themes/*/cache/
modules/*/config*.xml

# Site content
# The following folders contain product images, virtual products, CSV's, etc.

admin-dev/backups/
admin-dev/export/
admin-dev/import/
download/
/img/*
upload/
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# pittica/prestashop-features

![License](https://img.shields.io/github/license/pittica/prestashop-features)
![Release](https://img.shields.io/github/v/release/pittica/prestashop-features)

Product features module for [PrestaShop](https://github.com/prestashop/prestashop).

This module sorts and organizes the product features.

## Requirements

[PrestaShop](https://github.com/prestashop/prestashop) version 1.7 or newer.

## Copyright

(c) 2020, Pittaca S.r.l.s.
34 changes: 34 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <[email protected]>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

header('Location: ../');
exit;
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions pitticafeatures.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}
64 changes: 64 additions & 0 deletions pitticafeatures.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php

/**
* 2020 Pittica S.r.l.s.
*
* @author Lucio Benini <[email protected]>
* @copyright 2020 Pittica S.r.l.s.
* @license http://opensource.org/licenses/LGPL-3.0 The GNU Lesser General Public License, version 3.0 ( LGPL-3.0 )
*/

if (!defined('_PS_VERSION_')) {
exit;
}

class PitticaFeatures extends Module
{
protected $config_form = false;

public function __construct()
{
$this->name = 'pitticafeatures';
$this->tab = 'front_office_features';
$this->version = '1.0.0';
$this->author = 'Pittica';
$this->need_instance = 1;

parent::__construct();

$this->displayName = $this->l('Features');
$this->description = $this->l('Sort and organize product features.');

$this->ps_versions_compliancy = array(
'min' => '1.7',
'max' => _PS_VERSION_
);
}

public function install()
{
return parent::install() && $this->registerHook('filterProductContent');
}

public function hookFilterProductContent($params)
{
$features = array();

if (!empty($params['object']['features'])) {
foreach ($params['object']['features'] as $feature) {
if (empty($features[$feature['id_feature']])) {
$features[$feature['id_feature']] = $feature;
} else {
$features[$feature['id_feature']]['value'] = implode(', ', array(
$features[$feature['id_feature']]['value'],
$feature['value']
));
}
}
}

$params['object']['features'] = $features;

return $params;
}
}
34 changes: 34 additions & 0 deletions translations/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <[email protected]>
* @copyright 2007-2020 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');

header('Location: ../');
exit;
6 changes: 6 additions & 0 deletions translations/it.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

global $_MODULE;
$_MODULE = array();
$_MODULE['<{pitticafeatures}prestashop>pitticafeatures_98f770b0af18ca763421bac22b4b6805'] = 'Caratteristiche';
$_MODULE['<{pitticafeatures}prestashop>pitticafeatures_68dfb48cc3e263bcef7557fcd0962345'] = 'Ordina e organizza le caratteristiche prodotto.';

0 comments on commit 8513996

Please sign in to comment.