It was discovered that the wrong parameter was send in the tn_sort field to the tweakwise servers to get a sorted list of products back.
It was sending the 'display title' instead of the 'title'
My guess is that these are by default probably the same so the issue was probably hiding because of this.
Our client has a different value for 'display title' and 'title' for a sortable attribute.
This diff seems to fix the problem:
diff --git a/src/Model/Client/Type/SortFieldType.php b/src/Model/Client/Type/SortFieldType.php
index 0a7ce41..0b330d3 100644
--- a/src/Model/Client/Type/SortFieldType.php
+++ b/src/Model/Client/Type/SortFieldType.php
@@ -57,6 +57,6 @@ class SortFieldType extends Type
*/
public function getUrlValue()
{
- return $this->getDisplayTitle();
+ return $this->getTitle();
}
-}
\ No newline at end of file
+}
This was already communicated to @EduardSelles via email a couple of weeks ago, but was probably lost in communciation somewhere, hence why I'm opening an issue so it isn't being forgotten, sorry for not creating a PR, due to lack of time at the moment.
Environment
PHP Version: 7.0
Magento Version: 2.2.5 EE
Tweakwise Version: test-branch
Tweakwise Export Version: test-branch
Magento Deploy Mode: production & development
Third party modules: a lot
Steps to reproduce
Try to use the sort dropdown on a product listing page
Issue Brief
It was discovered that the wrong parameter was send in the
tn_sort
field to the tweakwise servers to get a sorted list of products back. It was sending the 'display title' instead of the 'title' My guess is that these are by default probably the same so the issue was probably hiding because of this. Our client has a different value for 'display title' and 'title' for a sortable attribute.This diff seems to fix the problem:
This was already communicated to @EduardSelles via email a couple of weeks ago, but was probably lost in communciation somewhere, hence why I'm opening an issue so it isn't being forgotten, sorry for not creating a PR, due to lack of time at the moment.
Environment
Steps to reproduce
Actual result
Expected result