EmicoEcommerce / Magento2Tweakwise-archived

Magento 2 module for Tweakwise integration
Other
9 stars 25 forks source link

Sorting parameter which is send to tweakwise is wrong #54

Closed hostep closed 5 years ago

hostep commented 6 years ago

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:

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

Steps to reproduce

  1. Try to use the sort dropdown on a product listing page

Actual result

  1. Sort doesn't work

Expected result

  1. Sort works
edwinljacobs commented 5 years ago

Hello,

Late reply but this has been released in v1.4.5. Thanks for pointing this out

With kind regards, Edwin Jacobs