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

Fix autocomplete special price #685

Merged
merged 3 commits into from
Jan 17, 2018

Conversation

romainruaud
Copy link
Collaborator

This one fix #682

Main problem is due to the fact that "special_price" is not selected in autocomplete. I thought addPriceData() would do this, but it's not the case.

The only reason the same bug is not appearing on catalog listing is that special_price is set to used_in_product_listing=1 and get automatically loaded by the layer.

I did not want to load all attributes used_in_product_listing=1 in the autocomplete (for performances concern, however, this would have fixed the issue easily), so I added only 'special_price' to the list of default selected attributes.

I intentionally omitted to add "special_from_date" and "special_to_date".

This is due to the fact that they are used only with Magento CE and this could cause errors when these attributes are missing (if they were deleted, or when using Magento EE).

To allow proper handling of the special price when using these attributes, one will have to add them manually via DI like this :

    <type name="Smile\ElasticsuiteCatalog\Model\Autocomplete\Product\AttributeConfig">
        <arguments>
            <argument name="additionalSelectedAttributes" xsi:type="array">
                <item name="special_from_date" xsi:type="string">special_from_date</item>
                <item name="special_to_date" xsi:type="string">special_to_date</item>
            </argument>
        </arguments>
    </type>

Let me know if this solution is acceptable for you, or if we should do it another way ?

@afoucret
Copy link
Contributor

@romainruaud Can you please append date to the PR and test it against Magento EE.

BR,

@romainruaud
Copy link
Collaborator Author

PR Update :

  • I added date fields.

Tested working OK with EE version.

@afoucret afoucret merged commit b539329 into Smile-SA:2.4.x Jan 17, 2018
@romainruaud romainruaud deleted the fix-autocomplete-special-price branch March 15, 2018 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants