How to fix the «Unexpected token , in JSON» issue with the «showCaption» parameter of a media gallery in a third-party design theme?

01

02

Step 1

Locate the line:

"showCaption": <?php /* @escapeNotVerified */ echo $block->getVar("gallery/caption"); ?>,

and replace it with the following one:

"showCaption": <?php echo intval($block->getVar("gallery/caption")); ?>,

Step 2

Locate the line:

"showCaption": <?php /* @escapeNotVerified */  echo $block->getVar("gallery/fullscreen/caption"); ?>,

and replace it with the following one:

"showCaption": <?php echo intval($block->getVar("gallery/fullscreen/caption")); ?>,

Step 3

Locate the line:

"arrows": <?php /* @escapeNotVerified */  echo $block->getVar("gallery/fullscreen/arrows"); ?>,

and replace it with the following one:

"arrows": <?php echo intval($block->getVar("gallery/fullscreen/arrows")); ?>,
1 Like