EmicoEcommerce / Magento2Tweakwise-archived

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

Client.php throws exeption if there are multiple values per attribute #86

Closed CyberSecutor closed 4 years ago

CyberSecutor commented 5 years ago

Issue Brief

An exception is thrown when an item has multiple values per attribute.

Environment

Steps to reproduce

Given the following response from Tweakwise:

  <items>
    <item>
      <itemno>1001</itemno>
      <title>My Item</title>
      <price>5.95</price>
      <brand />
      <attributes>
        <attribute>
          <name>sku</name>
          <values>
            <value>315880</value>
            <value>315930</value>
            <value>315950</value>
            <value>315990</value>
            <value>352010</value>
            <value>399570</value>
            <value>399590</value>
            <value>416510</value>
            <value>437570</value>
            <value>437580</value>
          </values>
        </attribute>
      </attributes>
    </item>
  <items>

The Emico\Tweakwise\Model\Client class will throw an exception when trying to convert it to array in xmlToArray().

Expected result

Patch

I have created a patch that fixes the issue: https://bitbucket.org/snippets/remkoMCT/qng5be

edwinljacobs commented 4 years ago

Sorry for the rather late reply, I havent got around to looking into this yet. We will reproduce this issue and test the patch against it.

With kind regards

edwinljacobs commented 4 years ago

Hello,

This has been fixed in https://github.com/EmicoEcommerce/Magento2Tweakwise/releases/tag/v2.1.4 and is no longer an issue. I will close this issue.

With kind regards