File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -101,13 +101,19 @@ public function getLatest()
101101 */
102102 public function getCategories ()
103103 {
104+ $ allCategories = [];
105+ $ page = 1 ;
104106 try {
105- $ categories = $ this ->categoryApi ->getCollection ();
107+ do {
108+ $ categories = $ this ->categoryApi ->getCollection (['page ' => $ page ]);
109+ $ allCategories += $ categories ->getItems ();
110+ ++$ page ;
111+ } while ($ page <= $ categories ->getLastPageNumber ());
106112 } catch (ApiException $ e ) {
107113 return [];
108114 }
109115
110- foreach ($ categories as $ category ) {
116+ foreach ($ allCategories as $ category ) {
111117 $ children = $ categories ->getItemsByColumnValue ('parent ' , $ category ->getId ());
112118 $ category ->setChildren ($ children );
113119 }
@@ -138,7 +144,7 @@ public function getCurrentCategory()
138144 if ($ this ->getRequest ()->getActionName () !== 'category ' ) {
139145 return false ;
140146 }
141-
147+
142148 $ slug = $ this ->requestHelper ->getSlug ($ this ->getRequest ());
143149
144150 $ category = $ this ->categoryApi ->getCollection (['slug ' => $ slug ])->getFirstItem ();
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
22<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:framework:Module/etc/module.xsd" >
3- <module name =" Skywire_WordpressApi" setup_version =" 1.3.0 " >
3+ <module name =" Skywire_WordpressApi" setup_version =" 1.3.1 " >
44 </module >
55</config >
You can’t perform that action at this time.
0 commit comments