-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Magmodules
committed
May 10, 2017
0 parents
commit 1d3756f
Showing
62 changed files
with
6,263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea | ||
*.zip | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Sooqr Connect for Magento® 1 | ||
|
||
The official extension to connect Sooqr with your Magento® 1 store and improve your Search and Navigation. | ||
|
||
## Development by Magmodules | ||
|
||
We are a Dutch Magento® Only Agency dedicated to the development of extensions for Magento® 1 and Magento® 2. All our extensions are coded by our own team and our support team is always there to help you out. | ||
|
||
[Visit Magmodules.eu](https://www.magmodules.eu/) | ||
|
||
## Developed for Sooqr Search | ||
|
||
Sooqr Search makes site search awesome. Our two goals: - Ultimate speed, Sooqr shows results instant within milliseconds even with hundreds of thousands of SKU’s - Highest relevance, always the best matches on top of the results list For your visitor the unique responsive interface is a combination of results, filters/facets and sorting. They will easily and quickly find what they are really looking for. Sooqr handles typos, so no worries about misspelling. | ||
|
||
[Visit Sooqr.com](https://www.sooqr.com/) | ||
|
||
## Links | ||
|
||
[Knowledgebase](https://www.magmodules.eu/help/sooqr) | ||
|
||
[Terms and Conditions](https://www.magmodules.eu/terms.html) | ||
|
||
[Contact Us](https://www.magmodules.eu/contact-us.html) |
61 changes: 61 additions & 0 deletions
61
app/code/community/Magmodules/Sooqr/Block/Adminhtml/Config/Form/Field/Extra.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Magmodules.eu - http://www.magmodules.eu | ||
* | ||
* NOTICE OF LICENSE | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Magmodules | ||
* @package Magmodules_Sooqr | ||
* @author Magmodules <[email protected]> | ||
* @copyright Copyright (c) 2017 (http://www.magmodules.eu) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Magmodules_Sooqr_Block_Adminhtml_Config_Form_Field_Extra | ||
extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract | ||
{ | ||
|
||
protected $_renders = array(); | ||
|
||
/** | ||
* Magmodules_Sooqr_Block_Adminhtml_Config_Form_Field_Extra constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$layout = Mage::app()->getFrontController()->getAction()->getLayout(); | ||
$rendererAttribute = $layout->createBlock('sooqr/adminhtml_config_form_renderer_select', '', array('is_render_to_js_template' => true)); | ||
$rendererAttribute->setOptions(Mage::getModel('sooqr/adminhtml_system_config_source_attribute')->toOptionArray()); | ||
$this->addColumn( | ||
'attribute', array( | ||
'label' => Mage::helper('sooqr')->__('Attribute'), | ||
'style' => 'width:180px', | ||
'renderer' => $rendererAttribute | ||
) | ||
); | ||
$this->_renders['attribute'] = $rendererAttribute; | ||
$this->_addAfter = false; | ||
$this->_addButtonLabel = Mage::helper('sooqr')->__('Add Field'); | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* @param Varien_Object $row | ||
*/ | ||
public function _prepareArrayRow(Varien_Object $row) | ||
{ | ||
foreach ($this->_renders as $key => $render) { | ||
$row->setData( | ||
'option_extra_attr_' . $render->calcOptionHash($row->getData($key)), | ||
'selected="selected"' | ||
); | ||
} | ||
} | ||
|
||
} |
83 changes: 83 additions & 0 deletions
83
app/code/community/Magmodules/Sooqr/Block/Adminhtml/Config/Form/Field/Filter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
/** | ||
* Magmodules.eu - http://www.magmodules.eu | ||
* | ||
* NOTICE OF LICENSE | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Magmodules | ||
* @package Magmodules_Sooqr | ||
* @author Magmodules <[email protected]> | ||
* @copyright Copyright (c) 2017 (http://www.magmodules.eu) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Magmodules_Sooqr_Block_Adminhtml_Config_Form_Field_Filter | ||
extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract | ||
{ | ||
|
||
protected $_renders = array(); | ||
|
||
/** | ||
* Magmodules_Sooqr_Block_Adminhtml_Config_Form_Field_Shipping constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$layout = Mage::app()->getFrontController()->getAction()->getLayout(); | ||
$rendererAttributes = $layout->createBlock('sooqr/adminhtml_config_form_renderer_select', '', array('is_render_to_js_template' => true)); | ||
$rendererAttributes->setOptions(Mage::getModel('sooqr/adminhtml_system_config_source_attribute')->toOptionArray()); | ||
|
||
$rendererConditions = $layout->createBlock('sooqr/adminhtml_config_form_renderer_select', '', array('is_render_to_js_template' => true)); | ||
$rendererConditions->setOptions(Mage::getModel('sooqr/adminhtml_system_config_source_conditions')->toOptionArray()); | ||
|
||
$this->addColumn( | ||
'attribute', array( | ||
'label' => Mage::helper('sooqr')->__('Attribute'), | ||
'style' => 'width:100px', | ||
'renderer' => $rendererAttributes | ||
) | ||
); | ||
|
||
$this->addColumn( | ||
'condition', array( | ||
'label' => Mage::helper('sooqr')->__('Condition'), | ||
'style' => 'width:100px', | ||
'renderer' => $rendererConditions | ||
) | ||
); | ||
|
||
$this->addColumn( | ||
'value', array( | ||
'label' => Mage::helper('sooqr')->__('Value'), | ||
'style' => 'width:100px', | ||
) | ||
); | ||
|
||
$this->_renders['attribute'] = $rendererAttributes; | ||
$this->_renders['condition'] = $rendererConditions; | ||
|
||
$this->_addAfter = false; | ||
$this->_addButtonLabel = Mage::helper('sooqr')->__('Add Filter'); | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* @param Varien_Object $row | ||
*/ | ||
public function _prepareArrayRow(Varien_Object $row) | ||
{ | ||
foreach ($this->_renders as $key => $render) { | ||
$row->setData( | ||
'option_extra_attr_' . $render->calcOptionHash($row->getData($key)), | ||
'selected="selected"' | ||
); | ||
} | ||
} | ||
|
||
} |
171 changes: 171 additions & 0 deletions
171
app/code/community/Magmodules/Sooqr/Block/Adminhtml/Config/Form/Renderer/Select.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
<?php | ||
/** | ||
* Magmodules.eu - http://www.magmodules.eu | ||
* | ||
* NOTICE OF LICENSE | ||
* This source file is subject to the Open Software License (OSL 3.0) | ||
* that is bundled with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://opensource.org/licenses/osl-3.0.php | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Magmodules | ||
* @package Magmodules_Sooqr | ||
* @author Magmodules <[email protected]> | ||
* @copyright Copyright (c) 2017 (http://www.magmodules.eu) | ||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | ||
*/ | ||
|
||
class Magmodules_Sooqr_Block_Adminhtml_Config_Form_Renderer_Select extends Mage_Core_Block_Html_Select | ||
{ | ||
|
||
public function setInputName($inputName) | ||
{ | ||
$this->setData('inputname', $inputName); | ||
return $this; | ||
} | ||
|
||
public function getInputName() | ||
{ | ||
return $this->getData('inputname'); | ||
} | ||
|
||
public function setColumnName($columnName) | ||
{ | ||
$this->setData('columnname', $columnName); | ||
return $this; | ||
} | ||
|
||
public function getColumnName() | ||
{ | ||
return $this->getData('columnname'); | ||
} | ||
|
||
public function setColumn($column) | ||
{ | ||
$this->setData('column', $column); | ||
return $this; | ||
} | ||
|
||
public function getColumn() | ||
{ | ||
return $this->getData('column'); | ||
} | ||
|
||
public function getExtraParams() | ||
{ | ||
$column = $this->getColumn(); | ||
if ($column && isset($column['style'])) { | ||
return ' style="' . $column['style'] . '" '; | ||
} else { | ||
return ''; | ||
} | ||
} | ||
|
||
public function _toHtml() | ||
{ | ||
if (!$this->_beforeToHtml()) { | ||
return ''; | ||
} | ||
|
||
$html = '<select name="' . $this->getInputName() . '" class="' . $this->getClass() . '" ' . $this->getExtraParams() . '>'; | ||
|
||
$values = $this->getValue(); | ||
|
||
if (!is_array($values)) { | ||
if (!is_null($values)) { | ||
$values = array($values); | ||
} else { | ||
$values = array(); | ||
} | ||
} | ||
|
||
$isArrayOption = true; | ||
|
||
foreach ($this->getOptions() as $key => $option) { | ||
if ($isArrayOption && is_array($option)) { | ||
$value = $option['value']; | ||
$label = $option['label']; | ||
$params = (!empty($option['params'])) ? $option['params'] : array(); | ||
} else { | ||
$value = $key; | ||
$label = $option; | ||
$isArrayOption = false; | ||
$params = array(); | ||
} | ||
|
||
if (is_array($value)) { | ||
$html .= '<optgroup label="' . $label . '">'; | ||
foreach ($value as $keyGroup => $optionGroup) { | ||
if (!is_array($optionGroup)) { | ||
$optionGroup = array( | ||
'value' => $keyGroup, | ||
'label' => $optionGroup | ||
); | ||
} | ||
|
||
$html .= $this->_optionToHtml( | ||
$optionGroup, | ||
in_array($optionGroup['value'], $values) | ||
); | ||
} | ||
|
||
$html .= '</optgroup>'; | ||
} else { | ||
$html .= $this->_optionToHtml( | ||
array( | ||
'value' => $value, | ||
'label' => $label, | ||
'params' => $params | ||
), | ||
in_array($value, $values) | ||
); | ||
} | ||
} | ||
|
||
$html .= '</select>'; | ||
return $html; | ||
} | ||
|
||
public function _optionToHtml($option, $selected = false) | ||
{ | ||
$selectedHtml = $selected ? ' selected="selected"' : ''; | ||
if ($this->getIsRenderToJsTemplate() === true) { | ||
$selectedHtml .= ' #{option_extra_attr_' . self::calcOptionHash($option['value']) . '}'; | ||
} | ||
|
||
$params = ''; | ||
if (!empty($option['params']) && is_array($option['params'])) { | ||
foreach ($option['params'] as $key => $value) { | ||
if (is_array($value)) { | ||
foreach ($value as $keyMulti => $valueMulti) { | ||
$params .= sprintf(' %s="%s" ', $keyMulti, $valueMulti); | ||
} | ||
} else { | ||
$params .= sprintf(' %s="%s" ', $key, $value); | ||
} | ||
} | ||
} | ||
|
||
return sprintf( | ||
'<option value="%s"%s %s>%s</option>', | ||
$this->htmlEscape($option['value']), | ||
$selectedHtml, | ||
$params, | ||
$this->htmlEscape($option['label']) | ||
); | ||
} | ||
|
||
public function getHtml() | ||
{ | ||
return $this->toHtml(); | ||
} | ||
|
||
public function calcOptionHash($optionValue) | ||
{ | ||
return sprintf('%u', crc32($this->getColumnName() . $this->getInputName() . $optionValue)); | ||
} | ||
|
||
} |
Oops, something went wrong.