Skip to content

Commit

Permalink
fix offset and complete Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-dsm committed Feb 26, 2024
1 parent 89b85b4 commit ad43c57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>1.0.4</version>
<version>1.0.5</version>
<authors>
<author>
<name>Chabreuil Antoine</name>
Expand Down
4 changes: 2 additions & 2 deletions Controller/FrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function siteReviews(int $offset, int $limit): JsonResponse

$siteReviews = GuaranteedOpinionSiteReviewQuery::create()
->setLimit($limit)
->setOffset($limit * ($offset -1))
->setOffset($offset)
->find()
;

Expand Down Expand Up @@ -58,7 +58,7 @@ public function productReviews(int $id, int $offset, int $limit): JsonResponse
$productReviews = GuaranteedOpinionProductReviewQuery::create()
->filterByProductId($id)
->setLimit($limit)
->setOffset($limit * ($offset -1))
->setOffset($offset)
->find();

foreach ($productReviews as $review) {
Expand Down
11 changes: 10 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@ To import your product opinion :
php Thelia module:GuaranteedOpinion:GetProductReview
```

To import your site opinion :
```
php Thelia module:GuaranteedOpinion:GetProductReview
```
(Note: If you are using Avis Garantis widget and widget iframe, you don't need to import your site opinion)

To export your order :
```
php Thelia module:GuaranteedOpinion:SendOrder
```

No need to import your site opinion, you only need to use the widget and widget iframe
Now you can add these routes to your opinion page or use the loop

- ```/site_reviews/offset/{offset}/limit/{limit}```
- ```/product_reviews/{id}/offset/{offset}/limit/{limit}```

## Loop

Expand Down

0 comments on commit ad43c57

Please # to comment.