Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
403526a
github: new workflow to add issue to project
ga-devfront Mar 2, 2026
91e7504
Merge pull request #224 from ga-devfront/github/add-issue-to-project
jolelievre Mar 3, 2026
24a14dd
improve sql query
matthieu-rolland Jul 7, 2026
4ea3b14
Add new structured data
Hlavtox Jul 9, 2026
7e1b494
Do not add empty aggregateRating
Hlavtox Jul 9, 2026
9ac1a23
Merge pull request #229 from Hlavtox/sssd
ShaiMagal Jul 9, 2026
c8b6829
CI : PHPStan with common action
Jul 9, 2026
4575339
Merge pull request #230 from Progi1984/ci
nicosomb Jul 15, 2026
07cbf1e
CI : PHPCSFixer with common action
Jul 15, 2026
4e7bb92
Merge pull request #231 from Progi1984/ci
nicosomb Jul 16, 2026
f9965f8
PHP support from 7.2 to 8.5 (PS 8.2+)
Jul 17, 2026
e7df651
Merge pull request #232 from Progi1984/ci
nicosomb Jul 17, 2026
a49ab79
Support for PS 8.2+ (& Cleanup code)
Jul 20, 2026
80a2258
Merge pull request #233 from Progi1984/ci
nicosomb Jul 20, 2026
b45093d
Support for PrestaShop 9.2.x
Jul 21, 2026
af1e3e1
Merge pull request #234 from Progi1984/ci
nicosomb Jul 23, 2026
83e8607
CI : Dependabot (PHP / Node / Github Actions)
Jul 23, 2026
4544c79
Merge pull request #235 from Progi1984/ci
nicosomb Jul 23, 2026
ed7b1ee
Bump actions/upload-artifact from 4 to 7
dependabot[bot] Jul 23, 2026
0fc9ad5
Merge pull request #240 from PrestaShop/dependabot/github_actions/dev…
Progi1984 Jul 24, 2026
d55cab4
Bump toolmantim/release-drafter from 5 to 7
dependabot[bot] Jul 24, 2026
c413422
Merge pull request #239 from PrestaShop/dependabot/github_actions/dev…
Progi1984 Jul 24, 2026
e20ddcd
Bump actions/checkout from 4 to 7
dependabot[bot] Jul 24, 2026
55b7943
Merge pull request #237 from PrestaShop/dependabot/github_actions/dev…
Progi1984 Jul 24, 2026
7320843
Bump actions/download-artifact from 4 to 8
dependabot[bot] Jul 24, 2026
816a5b3
Merge pull request #238 from PrestaShop/dependabot/github_actions/dev…
Progi1984 Jul 24, 2026
97c9caf
Bump PrestaShopCorp/github-action-clean-before-deploy from 1.0 to 2.0
dependabot[bot] Jul 24, 2026
5f18136
Merge pull request #236 from PrestaShop/dependabot/github_actions/dev…
Progi1984 Jul 24, 2026
ce44d04
Bump toolmantim/release-drafter from 7 to 7.6.0
dependabot[bot] Jul 31, 2026
c86cc25
Merge pull request #241 from PrestaShop/dependabot/github_actions/dev…
Progi1984 Jul 31, 2026
469e234
Bump toolmantim/release-drafter from 7.6.0 to 7.7.0
dependabot[bot] Aug 3, 2026
1b2df46
Merge pull request #242 from PrestaShop/dependabot/github_actions/dev…
Progi1984 Aug 3, 2026
62df450
Replace 9.1.x branch with 9.1.4 tag in CI
jolelievre Aug 6, 2026
c498099
Merge pull request #243 from jolelievre/update-ci-9.1.x-to-9.1.4
jolelievre Aug 6, 2026
2bb333a
Merge pull request #228 from matthieu-rolland/improve-sql
jolelievre Aug 6, 2026
548c4ec
CI: pin PrestaShop 9.1.5 instead of the superseded 9.1.4 tag
mattgoud Aug 28, 2026
d1b9ab8
Merge pull request #247 from mattgoud/ci/pin-9.1.5
jolelievre Aug 31, 2026
512a88f
Bump to v9.0.0
Quetzacoalt91 Sep 9, 2026
f2e23c0
Rename upgrade file
Quetzacoalt91 Sep 9, 2026
1df82be
Fix PHPStan error
Quetzacoalt91 Sep 9, 2026
8458c23
Remove ignored statement
Quetzacoalt91 Sep 9, 2026
d85738f
Merge pull request #249 from Quetzacoalt91/phpstan-error
Hlavtox Sep 9, 2026
f018839
Merge pull request #248 from Quetzacoalt91/bump-to-v9.0.0
Quetzacoalt91 Sep 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
version: 2
updates:
- package-ecosystem: npm
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: composer
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
target-branch: dev
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
target-branch: dev
13 changes: 13 additions & 0 deletions .github/workflows/add-issue-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Add Issue to Project

on:
issues:
types: [ opened ]

jobs:
add-to-project:
uses: PrestaShop/.github/.github/workflows/reusable-add-to-project.yml@master
with:
project-number: 47
secrets:
TOKEN: ${{ secrets.JARVIS_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Install composer dependencies
run: composer install --no-dev -o
- name: Clean-up project
uses: PrestaShopCorp/github-action-clean-before-deploy@v1.0
uses: PrestaShopCorp/github-action-clean-before-deploy@v2.0
- name: Prepare auto-index tool
run: composer global require prestashop/autoindex
- name: Generate index.php
run: ~/.composer/vendor/bin/autoindex
- name: Create & upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ github.event.repository.name }}
path: /home/runner/work/${{ github.event.repository.name }}
Expand All @@ -27,12 +27,12 @@ jobs:
if: github.event_name == 'push' && (github.event.ref == 'refs/heads/main' || github.event.ref == 'refs/heads/master')
steps:
- name: Download artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: ${{ github.event.repository.name }}
path: ${{ github.event.repository.name }}
- id: release_info
uses: toolmantim/release-drafter@v5
uses: toolmantim/release-drafter@v7.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare for Release
Expand Down
157 changes: 109 additions & 48 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: PHP tests
on: [push, pull_request]
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 7.2 => 8.2
name: PHP Syntax check 7.2 => 8.5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: PHP syntax checker 7.2
uses: prestashop/github-action-php-lint/7.2@master
Expand All @@ -25,65 +24,127 @@ jobs:
uses: prestashop/github-action-php-lint/8.1@master

- name: PHP syntax checker 8.2
uses: prestashop/github-action-php-lint/8.2@master
uses: prestashop/github-action-php-lint/8.2@master

- name: PHP syntax checker 8.3
uses: prestashop/github-action-php-lint/8.3@master

- name: PHP syntax checker 8.4
uses: prestashop/github-action-php-lint/8.4@master

- name: PHP syntax checker 8.5
uses: prestashop/github-action-php-lint/8.5@master

# Check the PHP code follow the coding standards
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Run PHP-CS-Fixer
uses: PrestaShop/.github/.github/actions/php-ci/php-cs@master
with:
php-version: '7.4'

- name: Checkout
uses: actions/checkout@v4
php-version: '7.4'

- name: Cache dependencies
uses: actions/cache@v4
# Run PHPStan against the module (PHP 7.4 – PS 8.2)
phpstan-74-81:
name: PHPStan (PHP 7.4 - 8.1)
runs-on: ubuntu-latest
strategy:
matrix:
presta_version: ['8.2.x']
php_version: ['7.4', '8.1']
fail-fast: false
env:
PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}

- name: Install dependencies
run: composer install

- name: Run PHP-CS-Fixer
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no

# Run PHPStan against the module and a PrestaShop release
phpstan:
name: PHPStan
path: ${{ github.event.repository.name }}

- name: Prepare PHP env for PrestaShop 8 (define constants before any bootstrap)
run: |
mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini
{
echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php"
echo "memory_limit=512M"
} > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini

- name: Run PHPStan
uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master
with:
php-version: ${{ matrix.php_version }}
presta-version: ${{ matrix.presta_version }}
module-name: ${{ github.event.repository.name }}
phpstan-level: '5'
phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon
phpstan-version: '^0.12'
composer-version: '2.2.18'

# Run PHPStan against the module (PHP 8.1 – 8.4)
phpstan-81-84:
name: PHPStan (PHP 8.1 - 8.4)
runs-on: ubuntu-latest
strategy:
matrix:
presta-versions: ['1.7.8', '8.0', 'latest']
presta_version: ['9.0.3']
php_version: ['8.1', '8.4']
fail-fast: false
env:
PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: Checkout repository
uses: actions/checkout@v7
with:
php-version: '7.4'

- name: Checkout
uses: actions/checkout@v4

# Add vendor folder in cache to make next builds faster
- name: Cache vendor folder
uses: actions/cache@v4
path: ${{ github.event.repository.name }}

- name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap)
run: |
mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini
{
echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php"
echo "memory_limit=512M"
} > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini

- name: Run PHPStan
uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
php-version: ${{ matrix.php_version }}
presta-version: ${{ matrix.presta_version }}
module-name: ${{ github.event.repository.name }}
phpstan-level: '5'
phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon

# Add composer local folder in cache to make next builds faster
- name: Cache composer folder
uses: actions/cache@v4
# Run PHPStan against the module (PHP 8.1 – 8.5)
phpstan:
name: PHPStan (PHP 8.1 - 8.5)
runs-on: ubuntu-latest
strategy:
matrix:
presta_version: ['9.1.5', '9.2.x', 'develop']
php_version: ['8.1', '8.5']
fail-fast: false
env:
PHPRC: ${{ github.workspace }}/${{ github.event.repository.name }}/.phpstan-php-ini
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
path: ~/.composer/cache
key: php-composer-cache

- run: composer install

# Docker images prestashop/prestashop may be used, even if the shop remains uninstalled
- name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }})
run: ./tests/phpstan.sh ${{ matrix.presta-versions }}
path: ${{ github.event.repository.name }}

- name: Prepare PHP env for PrestaShop 9.1.x and later (define constants before any bootstrap)
run: |
mkdir -p ${{ github.event.repository.name }}/.phpstan-php-ini
{
echo "auto_prepend_file=$GITHUB_WORKSPACE/${{ github.event.repository.name }}/tests/php/phpstan/prepend-constants.php"
echo "memory_limit=512M"
} > ${{ github.event.repository.name }}/.phpstan-php-ini/php.ini

- name: Run PHPStan
uses: PrestaShop/.github/.github/actions/php-ci/phpstan@master
with:
php-version: ${{ matrix.php_version }}
presta-version: ${{ matrix.presta_version }}
module-name: ${{ github.event.repository.name }}
phpstan-level: '5'
phpstan-config: tests/php/phpstan/phpstan-${{ matrix.presta_version }}.neon
3 changes: 0 additions & 3 deletions ProductComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

class ProductComment extends ObjectModel
{
/** @var int */
public $id;

/** @var int */
public $id_product;

Expand Down
1 change: 0 additions & 1 deletion ProductCommentCriterion.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class ProductCommentCriterion extends ObjectModel
{
const NAME_MAX_LENGTH = 64;

public $id;
public $id_product_comment_criterion_type;
public $name;
public $active = true;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Allow users to post reviews on your products and/or rate them based on specific

## Compatibility

PrestaShop: `1.7.8` or newer
PrestaShop: `8.2.0` or newer

## Multistore compatibility

Expand Down
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<module>
<name>productcomments</name>
<displayName><![CDATA[Product Comments]]></displayName>
<version><![CDATA[8.0.0]]></version>
<version><![CDATA[9.0.0]]></version>
<description><![CDATA[Allows users to post reviews and rate products on specific criteria.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
<limited_countries></limited_countries>
</module>
1 change: 0 additions & 1 deletion config/admin/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ services:
class: 'PrestaShop\Module\ProductComment\Form\ProductCommentCriterionFormDataHandler'
public: true
arguments:
- '@product_comment_criterion_repository'
- '@prestashop.core.admin.lang.repository'
- '@doctrine.orm.default_entity_manager'
18 changes: 13 additions & 5 deletions controllers/front/CommentGrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,28 @@ class ProductCommentsCommentGradeModuleFrontController extends ModuleFrontContro
public function display()
{
$idProducts = Tools::getValue('id_products');
/* @var ProductCommentRepository $productCommentRepository */

header('Content-Type: application/json');

if (!is_array($idProducts)) {
return $this->ajaxRender(null);
$this->ajaxRender(null);

return;
}

$idProducts = array_unique(array_map('intval', $idProducts));

$productCommentRepository = $this->context->controller->getContainer()->get('product_comment_repository');
/** @var ProductCommentRepository|null $commentRepository */
$commentRepository = $this->context->controller->getContainer()->get('product_comment_repository');

if (!$commentRepository instanceof ProductCommentRepository) {
$this->ajaxRender(null);

return;
}

$productsCommentsNb = $productCommentRepository->getCommentsNumberForProducts($idProducts, Configuration::get('PRODUCT_COMMENTS_MODERATE'));
$averageGrade = $productCommentRepository->getAverageGrades($idProducts, Configuration::get('PRODUCT_COMMENTS_MODERATE'));
$productsCommentsNb = $commentRepository->getCommentsNumberForProducts($idProducts, Configuration::get('PRODUCT_COMMENTS_MODERATE'));
$averageGrade = $commentRepository->getAverageGrades($idProducts, Configuration::get('PRODUCT_COMMENTS_MODERATE'));

$resultFormated = [];

Expand Down
3 changes: 2 additions & 1 deletion controllers/front/ListComments.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class ProductCommentsListCommentsModuleFrontController extends ModuleFrontContro
{
public function display()
{
header('Content-Type: application/json');

$idProduct = (int) Tools::getValue('id_product');
$page = (int) Tools::getValue('page', 1);
$isLastNameAnonymous = Configuration::get('PRODUCT_COMMENTS_ANONYMISATION');
Expand Down Expand Up @@ -85,7 +87,6 @@ public function display()
$responseArray['comments'][] = $productComment;
}

header('Content-Type: application/json');
$this->ajaxRender(
json_encode(
$responseArray
Expand Down
6 changes: 3 additions & 3 deletions controllers/front/PostComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function display()
)
);

return false;
return;
}

$id_product = (int) Tools::getValue('id_product');
Expand All @@ -79,7 +79,7 @@ public function display()
)
);

return false;
return;
}

/** @var EntityManagerInterface $entityManager */
Expand Down Expand Up @@ -110,7 +110,7 @@ public function display()
)
);

return false;
return;
}

$entityManager->persist($productComment);
Expand Down
Loading
Loading