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

Duplicated product features in Feature loop #2484

Open
etiennePerriere opened this issue Mar 2, 2018 · 8 comments
Open

Duplicated product features in Feature loop #2484

etiennePerriere opened this issue Mar 2, 2018 · 8 comments

Comments

@etiennePerriere
Copy link
Contributor

In the Feature loop, if a product is linked to X feature values of an Y feature, the Y feature is returned X times by the loop.

This comes from this : https://github.com/thelia/thelia/blob/2.3.4/core/lib/Thelia/Core/Template/Loop/Feature.php#L126

See commit 998b5c0 by @zorn-v to get details about why it has been done.

If the if added by this commit is necessary, maybe the query should use a group by to avoid duplicated features in the query's results ?

@zorn-v
Copy link
Contributor

zorn-v commented Mar 2, 2018

That "if" doesn not affect on what you talk about. It only need to show all features (not only attached to product) in backend (admin).

And that filter speedup product page in frontend when you have A LOT features in one template. Nothing about grouping...

@etiennePerriere
Copy link
Contributor Author

Removing the if removes the problem, so I guess it affects what I'm talking about ^^

Can you tell us more about this commit, why did you add this, etc... ? What's wrong with only filtering by product's template ID ?

@zorn-v
Copy link
Contributor

zorn-v commented Mar 2, 2018

If you have A LOT features in one product template (imported from some another source for ex.), product page load was very long.

Removing the if removes the problem

I think it is side effect, not solving.
You have that problem in backend while edit product features ?

PS: Original PR was #1912

@etiennePerriere
Copy link
Contributor Author

No the problem is on front-end pages, on a product page with a loop like this:

{loop type="feature" name="x" product=$product_id}
    {$TITLE}: 
    {loop type="feature_value" name="y" feature=$ID product=$product_id}
        {$TITLE} 
    {/loop}
{/loop}

@zorn-v
Copy link
Contributor

zorn-v commented Mar 2, 2018

It means, that problem was before #1912
Need to fix it someway.

@gimlyGVD
Copy link
Contributor

gimlyGVD commented Mar 5, 2018

je pense que j'ai le meme problème, quand je duplique un produit qui a 2 déclinaison A et B elle deviennent B et A dans le duplication

meme les photos associé à ces déclinaisons s'inversent

@zorn-v
Copy link
Contributor

zorn-v commented Mar 9, 2018

Я тоже могу разговаривать на не понятном тебе языке, но толку ?

@roadster31
Copy link
Contributor

@zorn-v, gimlyGVD can't speak english. Fortunately, his comment is not directly related related to the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants