Skip to content

Commit

Permalink
Widget: fix itemsPerPage for menu boards
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner committed Aug 5, 2023
1 parent 13fcf96 commit 3f70019
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Widget/MenuBoardProductProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ public function fetchDuration(DurationProviderInterface $durationProvider): Widg

$lowerLimit = $durationProvider->getWidget()->getOptionValue('lowerLimit', 0);
$upperLimit = $durationProvider->getWidget()->getOptionValue('upperLimit', 15);
$durationProvider->setDuration(($upperLimit - $lowerLimit)
$numItems = $upperLimit - $lowerLimit;

$itemsPerPage = $durationProvider->getWidget()->getOptionValue('itemsPerPage', 0);
if ($itemsPerPage > 0) {
$numItems = ceil($numItems / $itemsPerPage);
}

$durationProvider->setDuration(($numItems)
* $durationProvider->getWidget()->calculatedDuration);
return $this;
}
Expand Down

0 comments on commit 3f70019

Please sign in to comment.