Skip to content

Commit

Permalink
Follow new specs of post layout
Browse files Browse the repository at this point in the history
  • Loading branch information
puleeno committed Apr 11, 2023
1 parent f24671c commit 729c19c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 16 additions & 1 deletion includes/Base/Renderer/CategoryTabsProductsRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,33 @@ public function render()

$tabs = $this->generateTabs();
$layout = array_get($this->options, 'sub_layout', Card::LAYOUT_NAME);
/**
* @var \Jankx\PostLayout\PostLayoutManager
*/
$postLayoutManager = PostLayoutManager::getInstance(
TemplateAndLayout::getTemplateEngine()
->getId()
);

if (is_null($postLayoutManager)) {
return;
}

do_action("jankx/ecommerce/loop/before", $this->options);

/**
* @var \Jankx\PostLayout\Layout\Tabs
*/
$productLayout = $postLayoutManager->createLayout(
Tabs::LAYOUT_NAME,
$this->buildFirstTabQuery()
);
$productLayout->setOptions($this->layoutOptions);
$productLayout->setOptions(array_merge(
[
'wrap_tag_name' => 'ul',
],
$this->layoutOptions
));

$productLayout->setTabs($this->transformDataTabs2PostLayoutTabs($tabs));
$productLayout->addChildLayout($layout);
Expand Down
1 change: 1 addition & 0 deletions includes/Integration/Elementor/Widgets/Products.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ protected function render()
'columns' => $this->get_responsive_setting('columns', 4),
'rows' => $this->get_responsive_setting('rows', 1),
'thumbnail_size' => array_get($settings, 'thumbnail_size', 'medium'),
'wrap_tag_name' => 'ul',
));

// Set Woocommerce loop columns
Expand Down

0 comments on commit 729c19c

Please sign in to comment.