Giter VIP home page Giter VIP logo

magentwo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

magentwo's Issues

SKU with slashes REST API problem

Hi,

When product SKU has slashes, the API does not handle that case properly.

Sample.

2.4.2 :165 > Magentwo::Product['4759119/104/OS']
I, [2023-03-08T14:08:17.251754 #17316]  INFO -- : Net::HTTP::Get exmaple.com//rest/V1/products/4759119/104/OS?
error 404: {"message"=>"Wniosek nie odpowiada żadnej ścieżce."}

I can encode slashes, so it works fine for 'GET'.

2.4.2 :176 > Magentwo::Product[('4759119/104/OS').gsub('/', '%2f')]
I, [2023-03-08T14:13:38.125959 #17316]  INFO -- : Net::HTTP::Get mage.libertymotors.pl//rest/V1/products/4759119%2f104%2fOS?
 => #<Magentwo::Product:0x000055ce6bb1c058 @id=19505, @sku="4759119/104/OS", @name="Komin termoaktywny Alpinestars Camo Neck Tube, kolor czarny/szary, rozmiar one size", @attribute_set_id=52, @price=119, @status

But it's getting complicated on the 'save'.

Looks like the p.sku is used and it's not 'encoded' properly.

2.4.2 :178 > p.price
 => 119
2.4.2 :179 >   
2.4.2 :181 >   p.save
I, [2023-03-08T14:17:52.582321 #17316]  INFO -- : Net::HTTP::Put mage.libertymotors.pl//rest/V1/products/4759119/104/OS
error 404: {"message"=>"Wniosek nie odpowiada żadnej ścieżce."}

We are using 0.1.91 - ruby 2.4
gem 'magentwo', '~> 0.1.91'

I can imagine, that changing p.sku to encode slashes as %2f, will force change of the SKU too, so i'ts not the option.

Looks like the best would be to 'encode' the slashes in SKU in generating the REST URI.

Can you fix it on 0.1. ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.