Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
a405d313
Commit
a405d313
authored
Mar 08, 2023
by
halweg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix : reviews next click fix
parent
f53a392a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
app/code/Joshine/Review/Controller/Ajax/ReviewInfo.php
+1
-1
app/code/Joshine/Review/view/frontend/templates/product/view/list.phtml
+12
-2
No files found.
app/code/Joshine/Review/Controller/Ajax/ReviewInfo.php
View file @
a405d313
...
...
@@ -142,7 +142,7 @@ class ReviewInfo extends \Magento\Framework\App\Action\Action {
public
function
getRatingPercent
(
$reviewId
)
{
$ratingCollection
=
$this
->
_objectManager
->
get
(
'Magento\Review\Model\ResourceModel\Rating\Option\Vote\Collection'
)
$ratingCollection
=
$this
->
_objectManager
->
create
(
'Magento\Review\Model\ResourceModel\Rating\Option\Vote\Collection'
)
->
addFieldToFilter
(
'review_id'
,
$reviewId
);
$data
=
$ratingCollection
->
getData
();
return
$data
[
0
][
'percent'
]
??
100
;
...
...
app/code/Joshine/Review/view/frontend/templates/product/view/list.phtml
View file @
a405d313
...
...
@@ -622,7 +622,7 @@ $imagesBlock = $helper->getReviewImagesBlock(15, $block->getProductId());
return
res
;
}
$
(
".joshine-review-pic-item"
).
on
(
'click'
,
function
()
{
$
(
".joshine-review-
container .joshine-review-
pic-item"
).
on
(
'click'
,
function
()
{
var
reviewId
=
$
(
this
).
data
(
'reviews-id'
);
var
productId
=
$
(
this
).
data
(
'product-id'
);
var
image_id
=
$
(
this
).
data
(
'image-id'
);
...
...
@@ -708,9 +708,19 @@ $imagesBlock = $helper->getReviewImagesBlock(15, $block->getProductId());
}
$
(
".swiper-button-next"
).
on
(
'click'
,
function
()
{
let
img_idx_pre
=
img_idx
+
1
;
let
has_pre
=
false
;
$
(
'.image-thumbs-list-item'
).
each
(
function
(
index
,
element
)
{
if
(
$
(
element
).
data
(
'img-index'
)
==
img_idx_pre
)
{
has_pre
=
true
;
return
;
}
});
if
(
!
has_pre
)
{
return
;
}
if
(
!
lock
)
return
;
lock
=
false
;
swiper_wrapper
.
css
({
"transition"
:
'transform .5s ease 0s'
});
img_idx
++
;
swiper_wrapper
.
css
({
"transform"
:
'translateX('
+
-
536
*
img_idx
+
'px)'
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment