init
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Magezon
|
||||
*
|
||||
* This source file is subject to the Magezon Software License, which is available at https://magezon.com/license/.
|
||||
* Do not edit or add to this file if you wish to upgrade the to newer versions in the future.
|
||||
* If you wish to customize this module for your needs.
|
||||
* Please refer to https://www.magezon.com for more information.
|
||||
*
|
||||
* @category Magezon
|
||||
* @package Magezon_QuickOrder
|
||||
* @copyright Copyright (C) 2018 Magezon (https://magezon.com)
|
||||
*/
|
||||
|
||||
namespace Magezon\QuickOrder\Block\Adminhtml\Renderer\Config;
|
||||
|
||||
use Magento\Framework\Data\Form\Element\AbstractElement;
|
||||
|
||||
class Version extends \Magento\Config\Block\System\Config\Form\Field
|
||||
{
|
||||
/**
|
||||
* @var \Magento\Framework\Module\ModuleResource
|
||||
*/
|
||||
protected $moduleResource;
|
||||
|
||||
/**
|
||||
* @param \Magento\Framework\Module\ModuleResource $moduleResource
|
||||
* @param \Magento\Backend\Block\Template\Context $context
|
||||
* @param array $data
|
||||
*/
|
||||
public function __construct(
|
||||
\Magento\Framework\Module\ModuleResource $moduleResource,
|
||||
\Magento\Backend\Block\Template\Context $context,
|
||||
array $data = []
|
||||
) {
|
||||
parent::__construct($context, $data);
|
||||
$this->moduleResource = $moduleResource;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AbstractElement $element
|
||||
* @return string
|
||||
*/
|
||||
protected function _getElementHtml(AbstractElement $element)
|
||||
{
|
||||
return $this->moduleResource->getDataVersion('Magezon_QuickOrder');
|
||||
}
|
||||
|
||||
}
|
||||
Executable
+77
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Magezon
|
||||
*
|
||||
* This source file is subject to the Magezon Software License, which is available at https://www.magezon.com/license/.
|
||||
* Do not edit or add to this file if you wish to upgrade the to newer versions in the future.
|
||||
* If you wish to customize this module for your needs.
|
||||
* Please refer to https://www.magezon.com for more information.
|
||||
*
|
||||
* @category Magezon
|
||||
* @package Magezon_QuickOrder
|
||||
* @copyright Copyright (C) 2018 Magezon (https://www.magezon.com)
|
||||
*/
|
||||
|
||||
namespace Magezon\QuickOrder\Block;
|
||||
|
||||
use Magento\Framework\Data\Form\FormKey;
|
||||
use Magento\Framework\Exception\LocalizedException;
|
||||
|
||||
class Form extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $_template = 'Magezon_QuickOrder::form.phtml';
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\Locale\FormatInterface
|
||||
*/
|
||||
protected $_localeFormat;
|
||||
|
||||
/**
|
||||
* @var \Magezon\QuickOrder\Helper\Data
|
||||
*/
|
||||
protected $dataHelper;
|
||||
|
||||
/**
|
||||
* @param \Magento\Framework\View\Element\Template\Context $context
|
||||
* @param \Magento\Framework\Locale\FormatInterface $localeFormat
|
||||
* @param \Magezon\QuickOrder\Helper\Data $dataHelper
|
||||
* @param array $data
|
||||
*/
|
||||
public function __construct(
|
||||
\Magento\Framework\View\Element\Template\Context $context,
|
||||
\Magento\Framework\Locale\FormatInterface $localeFormat,
|
||||
\Magezon\QuickOrder\Helper\Data $dataHelper,
|
||||
protected FormKey $formKey,
|
||||
array $data = []
|
||||
) {
|
||||
parent::__construct($context, $data);
|
||||
$this->_localeFormat = $localeFormat;
|
||||
$this->dataHelper = $dataHelper;
|
||||
}
|
||||
|
||||
public function toHtml()
|
||||
{
|
||||
if (!$this->dataHelper->isEnabled() || !$this->dataHelper->isGroupValid()) return;
|
||||
|
||||
return parent::toHtml();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPriceFormat()
|
||||
{
|
||||
return $this->_localeFormat->getPriceFormat();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws LocalizedException
|
||||
*/
|
||||
public function getFormKey()
|
||||
{
|
||||
return $this->formKey->getFormKey();
|
||||
}
|
||||
}
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Magezon
|
||||
*
|
||||
* This source file is subject to the Magezon Software License, which is available at https://www.magezon.com/license/.
|
||||
* Do not edit or add to this file if you wish to upgrade the to newer versions in the future.
|
||||
* If you wish to customize this module for your needs.
|
||||
* Please refer to https://www.magezon.com for more information.
|
||||
*
|
||||
* @category Magezon
|
||||
* @package Magezon_QuickOrder
|
||||
* @copyright Copyright (C) 2018 Magezon (https://www.magezon.com)
|
||||
*/
|
||||
|
||||
namespace Magezon\QuickOrder\Block;
|
||||
|
||||
class Link extends \Magento\Framework\View\Element\Html\Link
|
||||
{
|
||||
/**
|
||||
* @var \Magezon\QuickOrder\Helper\Data
|
||||
*/
|
||||
protected $dataHelper;
|
||||
|
||||
/**
|
||||
* @param \Magento\Framework\View\Element\Template\Context $context
|
||||
* @param \Magezon\QuickOrder\Helper\Data $dataHelper
|
||||
* @param array $data
|
||||
*/
|
||||
public function __construct(
|
||||
\Magento\Framework\View\Element\Template\Context $context,
|
||||
\Magezon\QuickOrder\Helper\Data $dataHelper,
|
||||
array $data = []
|
||||
) {
|
||||
parent::__construct($context, $data);
|
||||
$this->dataHelper = $dataHelper;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render block HTML
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _toHtml()
|
||||
{
|
||||
if (!$this->dataHelper->getConfig('general/show_toplinks')) {
|
||||
return;
|
||||
}
|
||||
$route = $this->dataHelper->getConfig('general/route');
|
||||
$title = $this->dataHelper->getTitle();
|
||||
if ($route && $title && $this->dataHelper->isGroupValid()) {
|
||||
return '<li><a href="' . $this->getUrl($route) . '" >' . $title . '</a></li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Magezon
|
||||
*
|
||||
* This source file is subject to the Magezon Software License, which is available at https://www.magezon.com/license/.
|
||||
* Do not edit or add to this file if you wish to upgrade the to newer versions in the future.
|
||||
* If you wish to customize this module for your needs.
|
||||
* Please refer to https://www.magezon.com for more information.
|
||||
*
|
||||
* @category Magezon
|
||||
* @package Magezon_QuickOrder
|
||||
* @copyright Copyright (C) 2018 Magezon (https://www.magezon.com)
|
||||
*/
|
||||
|
||||
namespace Magezon\QuickOrder\Block;
|
||||
|
||||
use Magento\Framework\Pricing\PriceCurrencyInterface;
|
||||
|
||||
class Product extends \Magento\Catalog\Block\Product\AbstractProduct
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user