Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eac3366
fix
Dec 1, 2025
b8c6e3f
linting
Dec 1, 2025
e176fa7
Add product collections
Jul 11, 2025
4a92afb
add changes
Jul 18, 2025
6acdd10
optimise imports and add url generation
Jul 18, 2025
07793be
refactored to push more attributes over, added visibility restriction…
nathanchick Aug 14, 2025
5011dc5
changed menu order
nathanchick Aug 14, 2025
97c2519
fixed bug with adding new and saving
nathanchick Aug 14, 2025
c0afdad
code styles
nathanchick Aug 14, 2025
cf4c57d
removed file
nathanchick Aug 14, 2025
4595f73
tidied up some old code
nathanchick Aug 15, 2025
2fbe37a
code styling
nathanchick Aug 19, 2025
729e48f
unneeded
nathanchick Aug 19, 2025
c030c6b
fix chooser for conditions within product collections
Sep 2, 2025
98a12d7
fix redirect
Sep 2, 2025
6997b31
fix visibility
Sep 3, 2025
113e98d
add back the product count saving
Sep 3, 2025
09169a5
remove uneeded collection method calls
Sep 3, 2025
c0096fa
add visibility back
Sep 3, 2025
4c7c0c4
split
Sep 26, 2025
060a528
remove all none product collection related files and content from pro…
Sep 26, 2025
49e9e57
add master
Sep 26, 2025
117e839
declare strict everywhere
Sep 26, 2025
d1e70f5
Code inspection and fix namespace
Sep 26, 2025
f8fc7b8
add modules to psr
Sep 26, 2025
0ee606e
fix autoload
Oct 29, 2025
f87b6b1
bump version
Oct 29, 2025
4f4e2c5
fix ProductCollection namespacing
Oct 29, 2025
89e28b2
fix indexing
Oct 29, 2025
98ed203
fix 8.4 issues
Mar 12, 2026
6091736
remove nested compsoer.json
Mar 12, 2026
7e9a97a
add 8.5 to compatibility
Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
.idea
4 changes: 2 additions & 2 deletions Helper/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public function __construct(
* Log an error message.
*
* @param string $message
* @param $resource
* @param mixed $resource
* @return void
*/
public function logError(string $message = "", $resource = null): void
public function logError(string $message = "", mixed $resource = null): void
{
$this->logger->error(
self::LOG_PREFIX .
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "deployecommerce/module-builderio",
"version": "1.0.16",
"version": "1.1.0",
"description": "A magento 2 extensions that renders Builder.io content.",
"type": "magento2-module",
"require": {
"php": "~8.1.0|~8.2.0|~8.3.0|~8.4.0",
"php": "~8.1.0|~8.2.0|~8.3.0|~8.4.0|~8.5.0",
"magento/framework": "*",
"magento/module-store": "*",
"magento/module-cms": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

use DeployEcommerce\BuilderIO\System\Config;
use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Button;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\View\Helper\SecureHtmlRenderer;

Expand Down Expand Up @@ -46,7 +48,6 @@ public function __construct(
parent::__construct($context, $data, $secureRenderer);
}


/**
* Return element html
*
Expand All @@ -55,7 +56,7 @@ public function __construct(
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
Expand All @@ -79,7 +80,7 @@ public function getAjaxConnectUrl()
public function getButtonHtml()
{
$button = $this->getLayout()->createBlock(
\Magento\Backend\Block\Widget\Button::class
Button::class
)->setData(
[
'id' => 'connect_button',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

namespace DeployEcommerce\BuilderIO\Block\System\Config;

use Magento\Backend\Block\Template;
use Magento\Backend\Block\Widget\Button;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
use Magento\Framework\Exception\LocalizedException;

/**
Expand All @@ -19,8 +23,8 @@
* It extends the Magento Form Field and uses a custom template to render the button.
*
*/
class Content extends \Magento\Backend\Block\Template implements
\Magento\Framework\Data\Form\Element\Renderer\RendererInterface
class Content extends Template implements
RendererInterface
{
/**
* @var string
Expand All @@ -35,7 +39,7 @@ class Content extends \Magento\Backend\Block\Template implements
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
Expand All @@ -59,7 +63,7 @@ public function getAjaxSyncUrl()
public function getButtonHtml()
{
$button = $this->getLayout()->createBlock(
\Magento\Backend\Block\Widget\Button::class
Button::class
)->setData(
[
'id' => 'connect_button',
Expand All @@ -73,7 +77,7 @@ public function getButtonHtml()
/**
* @inheritDoc
*/
public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
public function render(AbstractElement $element)
{
return $this->_getElementHtml($element);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

use DeployEcommerce\BuilderIO\System\Config;
use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Button;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\View\Helper\SecureHtmlRenderer;

Expand Down Expand Up @@ -54,7 +56,7 @@ public function __construct(
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
Expand All @@ -78,7 +80,7 @@ public function getAjaxConnectUrl()
public function getButtonHtml()
{
$button = $this->getLayout()->createBlock(
\Magento\Backend\Block\Widget\Button::class
Button::class
)->setData(
[
'id' => 'fields_button',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

use DeployEcommerce\BuilderIO\System\Config;
use Magento\Backend\Block\Template\Context;
use Magento\Backend\Block\Widget\Button;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\View\Helper\SecureHtmlRenderer;

Expand Down Expand Up @@ -54,7 +56,7 @@ public function __construct(
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element)
protected function _getElementHtml(AbstractElement $element)
{
return $this->_toHtml();
}
Expand All @@ -78,7 +80,7 @@ public function getAjaxConnectUrl()
public function getButtonHtml()
{
$button = $this->getLayout()->createBlock(
\Magento\Backend\Block\Widget\Button::class
Button::class
)->setData(
[
'id' => 'webhook_button',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use DeployEcommerce\BuilderIO\Api\ContentPageRepositoryInterface;
use DeployEcommerce\BuilderIO\Helper\Settings;
use DeployEcommerce\BuilderIO\Model\WebhookRepository;
use DeployEcommerce\BuilderIO\Registry\CurrentPageContent;
use DeployEcommerce\BuilderIO\Service\BuilderIO\Page as PageService;
use DeployEcommerce\BuilderIO\System\Config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use DeployEcommerce\BuilderIO\Api\ContentPageRepositoryInterface;
use DeployEcommerce\BuilderIO\Helper\Settings;
use DeployEcommerce\BuilderIO\Model\WebhookRepository;
use DeployEcommerce\BuilderIO\Registry\CurrentPageContent;
use DeployEcommerce\BuilderIO\Service\BuilderIO\Page as PageService;
use Magento\Cms\Controller\Page\View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use DeployEcommerce\BuilderIO\Model\Queue\Handler\Handler;
use DeployEcommerce\BuilderIO\Api\WebhookRepositoryInterface;
use DeployEcommerce\BuilderIO\System\Config;
use Exception;
use GuzzleHttp\Exception\GuzzleException;
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\CsrfAwareActionInterface;
Expand Down Expand Up @@ -145,7 +146,7 @@ public function execute()
$this->handler->execute($webhook->getWebhookId());
}

} catch (\Exception $e) {
} catch (Exception $e) {
$this->logger->error($e->getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
48 changes: 48 additions & 0 deletions src/BuilderIO/Helper/Settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/*
* @Author: Dan Lewis (dan.lewis@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
* @Package: DeployEcommerce_BuilderIO
*/

declare(strict_types=1);

namespace DeployEcommerce\BuilderIO\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Psr\Log\LoggerInterface;

class Settings extends AbstractHelper
{
public const LOG_PREFIX = "DeployEcommerce - Builder IO";

/**
* Settings constructor.
*
* @param Context $context
* @param LoggerInterface $logger
*/
public function __construct(
public Context $context,
protected LoggerInterface $logger
) {
parent::__construct($context);
}

/**
* Log an error message.
*
* @param string $message
* @param $resource
* @return void
*/
public function logError(string $message = "", $resource = null): void
{
$this->logger->error(
self::LOG_PREFIX .
" - ERROR - " .
$message
);
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Dan Lewis (dan.lewis@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand All @@ -18,6 +19,12 @@
*/
class Pages implements OptionSourceInterface
{
/**
* Pages constructor.
*
* @param ContentPageRepository $contentPageRepository
* @param SearchCriteriaBuilder $searchCriteriaBuilder
*/
public function __construct(
private ContentPageRepository $contentPageRepository,
private SearchCriteriaBuilder $searchCriteriaBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Throwable;

class ContentPageRepository implements ContentPageRepositoryInterface
{
Expand Down Expand Up @@ -49,7 +50,7 @@ public function save(ContentPageInterface $contentPage): ContentPageInterface
__('Could not save the webhook: %1', $exception->getMessage()),
$exception
);
} catch (\Throwable $exception) {
} catch (Throwable $exception) {
// todo fix the exception handling
// throw new CouldNotSaveException(
// __('Could not save the webhook: %1', __('Something went wrong while saving the ContentPage.')),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/*
* @Author: Nathan Chick (nathan.chick@deploy.co.uk)
* @Copyright: 2024 Deploy Ecommerce (https://www.deploy.co.uk/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PageUrlRewriteGenerator
/**
* Entity type code
*/
const ENTITY_TYPE = 'builderio-page';
public const ENTITY_TYPE = 'builderio-page';

/**
* Page model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use DeployEcommerce\BuilderIO\Model\WebhookModel;
use DeployEcommerce\BuilderIO\Service\BuilderIO\Page as PageService;
use DeployEcommerce\BuilderIO\System\Config;
use Exception;
use GuzzleHttp\Exception\GuzzleException;
use Magento\UrlRewrite\Model\UrlRewriteFactory;
use Magento\Framework\Serialize\Serializer\Json;
Expand Down Expand Up @@ -107,7 +108,7 @@ private function processPage()

try {
$contentPage = $this->contentPageRepository->findByBuilderioPageId($page['id']);
} catch (\Exception $e) {
} catch (Exception $e) {
$contentPage = $this->contentPageFactory->create();
}

Expand All @@ -133,17 +134,22 @@ private function processPage()

try {
$this->contentPageRepository->save($contentPage);
} catch (\Exception $e) {
} catch (Exception $e) {
$this->logger->error($e->getMessage());
}
}

/**
* Delete the page associated with the webhook.
*
* @return void
*/
private function deletePage()
{
try {
$contentPage = $this->contentPageRepository->findByBuilderioPageId($this->webhook->getBuilderioId());
$this->contentPageRepository->delete($contentPage);
} catch (\Exception $e) {
} catch (Exception $e) {
$this->logger->error($e->getMessage());
}
}
Expand Down
Loading