View Single Post
  #2  
Old 05-03-2017, 04:01 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Bug in returned JSON

Quote:
Originally Posted by OrangeBill
1 - the returned JSON spells "arrtibutes" instead of "attributes"
... "arrtibutes":[],"price":9.99,"weight":0.3,"quantity":6, ....

Thanks! I've reported this to the XC5 dev team:
https://bt.x-cart.com/view.php?id=47930

Quote:
Originally Posted by OrangeBill
2 - if there are NO attributes, its shows as an array ie - surrounded by []
However, if there ARE attributes, it is not an array - missing the [ ]

... "arrtibutes":{"Color":"Yellow","Size":"S"},"price" :19.99,"weight":0.5,...

Can this be fixed?

["Color":"Yellow","Size":"S"] is not a valid JSON. "[" and "]" can be used for plain lists only (like ["Color", "Size"]), so X-Cart converted its PHP array to a valid JSON object correctly.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote