yireo/Yireo_GoogleTagManager2

Category position problem

Closed this issue · 14 comments

LCIJJ commented

After installing, product position and sort by functionality on category and search view stopped working. We are using Magento 2.1.3

Thanks for posting. This will be noted. However, without some developer diving into the same issue and providing all relevant clues, I'm not sure if somebody will be able to help here.

Can you add in the module via Vanilla instance that you can share so we know its not related to your custom code?

Maybe host one on magecloud?

Then we can help debug it easily

I'm having the same issue. I did some digging and found out that when

$collection = $productListBlock->getLoadedProductCollection();

gets called at /Block/Category.php#L31, for some reason this causes the product collection to become unsorted again, as the sorting is not done in getLoadedProductCollection() but the _beforeToHtml() method in magento/module-catalog/Block/Product/ListProduct.php. This guy is better at explaining it than me.

@jissereitsma @grantkemp I don't know how to fix it, but I'm hoping this is a push in the right direction for you to fix it?

Good shout - If someone can build it in an environment that is accessible- I can have a look.

@jissereitsma,
we are facing the same issue on Magento 2.1.4
Do you need some screenshots or other informations ?

@mgeoffray No, screenshots are not needed. Somebody needs to invest time to replicate this issue in a development environment and dive into the code to fix it. Unfortunately upcoming weeks I have little time for this, so I can't volunteer on a short term. Please note also I have no running projects that are in need of this fix, so it would all be voluntary.

Hi Guys- I am stacked as well - so I don't have time to work on it. When we do our next M2 - I will see if we can have a go and try replicate it.

Certainly not a fix, but if you move the script block from after.body.start to before.body.end, the collection doesn't lose it's sorting.

Thanks for the update, it might be a quick indeed. With the M1 extension, we had similar issues, but fixed this by using a completely different approach. I hope to find time soon to work on a similar solution in this M2 version.

As I mentioned in #20, everything dynamic should not be placed in a static layout block. This will cause issues with caching and the FPC in general

Understood. As mentioned in the M1 extension, there was the same issue and a new architecture is used to bypass any FPC issues. However, in M2 extension, this voluntary task is still open. Unfortunately, I lack the time (and project necessity) to dive into this on a short term.

In addition to what @jissereitsma said, the dataLayer should be sent by a javascript component. In that javascript component the user specific data can be configured.

Now the question is, who will take the time to pickup this task? :)

Fast-forward a few hours

I've picked up the task myself!

Closing due to inactivity