Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1189 Missing dropdown attributes values #1191

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
($('frontend_input').value == 'select'
|| $('frontend_input').value == 'multiselect'
|| $('frontend_input').value == 'price'
|| $('frontend_input').value == 'text')
|| $('frontend_input').value == 'text'
|| $('frontend_input').value == 'boolean')
) {
if($('is_filterable') && !$('is_filterable').getAttribute('readonly')){
Expand Down Expand Up @@ -209,21 +209,27 @@

<?php foreach ($this->helper('Magento\Catalog\Helper\Data')->getAttributeHiddenFields() as $type => $fields): ?>
case '<?php /* @escapeNotVerified */ echo $type; ?>':
var isFrontTabHidden = false;
<?php foreach ($fields as $one): ?>
<?php if ($one == '_front_fieldset'): ?>
getFrontTab().hide();
isFrontTabHidden = true;
<?php elseif ($one == '_default_value'): ?>
defaultValueTextVisibility =
defaultValueTextareaVisibility =
defaultValueDateVisibility =
defaultValueYesnoVisibility = false;
defaultValueTextareaVisibility =
defaultValueDateVisibility =
defaultValueYesnoVisibility = false;
<?php elseif ($one == '_scope'): ?>
scopeVisibility = false;
<?php else: ?>
setRowVisibility('<?php /* @escapeNotVerified */ echo $one; ?>', false);
<?php endif; ?>
<?php endforeach; ?>
break;

if (!isFrontTabHidden){
getFrontTab().show();
}
break;
<?php endforeach; ?>

default:
Expand Down Expand Up @@ -338,6 +344,7 @@

jQuery(function($) {
bindAttributeInputType();
// @todo: refactor collapsable component
$('.attribute-popup .collapse, [data-role="advanced_fieldset-content"]')
.collapsable()
.collapse('hide');
Expand All @@ -349,7 +356,6 @@
window.showDefaultRows = showDefaultRows;
window.switchDefaultValueField = switchDefaultValueField;
window.switchIsFilterable = switchIsFilterable;
window.switchIsFilterable = switchIsFilterable;
window.bindAttributeInputType = bindAttributeInputType;
window.checkOptionsPanelVisibility = checkOptionsPanelVisibility;
window.getFrontTab = getFrontTab;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @category Smile
* @package Smile\ElasticsuiteSwatches
* @author Romain Ruaud <romain.ruaud@smile.fr>
* @author Richard BAYET <richard.bayet@smile.fr>
* @copyright 2018 Smile
* @license Open Software License ("OSL") v. 3.0
*/
Expand All @@ -18,7 +18,7 @@
<body>
<referenceBlock name="attribute_edit_js">
<action method="setTemplate">
<argument name="template" xsi:type="string">Smile_ElasticsuiteSwatches::catalog/product/attribute/js.phtml</argument>
<argument name="template" xsi:type="string">Magento_Swatches::catalog/product/attribute/js.phtml</argument>
</action>
</referenceBlock>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
*
* @category Smile
* @package Smile\ElasticsuiteSwatches
* @author Romain Ruaud <romain.ruaud@smile.fr>
* @author Richard BAYET <richard.bayet@smile.fr>
* @copyright 2018 Smile
* @license Open Software License ("OSL") v. 3.0
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<page layout="admin-1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="attribute_edit_js">
<action method="setTemplate">
<argument name="template" xsi:type="string">Smile_ElasticsuiteSwatches::catalog/product/attribute/js.phtml</argument>
<argument name="template" xsi:type="string">Magento_Swatches::catalog/product/attribute/js.phtml</argument>
</action>
</referenceBlock>
</body>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
* versions in the future.
*
*
* @category Smile
* @package Smile\ElasticsuiteSwatches
* @author Richard BAYET <richard.bayet@smile.fr>
* @copyright 2018 Smile
* @license Open Software License ("OSL") v. 3.0
*/

var config = {
map: {
'*': {
swatchesProductAttributes: 'Smile_ElasticsuiteSwatches/js/product-attributes'
}
}
};
Loading