Comments (6)
Yeah, good point. I think for now I'll keep the current implementation and leave it up to the users to pass it how they would like in their own applications. Just feels a bit finicky and could break some applications.
from magento-laravel-api.
Interesting - haven't come across that before.
Are you able to access the API endpoint(s) by accessing the API directly? e.g. via curl: rest/default/V1/products/some-product-with-a/-slash
I came across this article but it's ages old: https://magento.stackexchange.com/questions/142056/how-to-get-magento2-product-with-rest-if-sku-has-slash
from magento-laravel-api.
I found the same issue on stackexchange.
This doesn't work:
public function getProduct($sku) { // $sku = '1234/56'
$result = $this->api('products')->show($sku);
if ($result->status() == 200) {
return $result->json();
}
And this works:
public function getProduct($sku) { // $sku = '1234/56'
$sku = urlencode($sku);
$result = $this->api('products')->show($sku);
if ($result->status() == 200) {
return $result->json();
}
from magento-laravel-api.
Are there any problems with URL encoding as the default on SKUs? I'm open to the idea if not :)
from magento-laravel-api.
@ahinkle sorry for the late reply. I don't think there are any problems when the URL for SKU is default encoded. But I'm not a expert on this.
from magento-laravel-api.
@ahinkle just found out one problem, when the SKU contains a space URL encoding changes the space to + (I don't understand why suppliers create SKU's with spaces)
https://stackoverflow.com/questions/5572718/php-convert-spaces-in-string-into-20 --> rawurlencode()
from magento-laravel-api.
Related Issues (20)
- Resolve custom attribute values
- Use Magento:: facade HOT 1
- Install Laravel 8.0 HOT 2
- Filtering data HOT 2
- Order Show undefined HOT 1
- Improve Documentation Readability HOT 2
- How can I get product special price data? HOT 3
- Add docblock helpers to specify API methods
- Add a nopages method for Orders? HOT 2
- Changes to use configs from constructor for multiple stores purpose. HOT 3
- Order Create (PUT) method HOT 1
- Change order status HOT 1
- Update documentation to include links to the official Magento documentation
- Update documentation to correct the static method calls of non static methods HOT 1
- Posting data into magento. HOT 1
- oauth support HOT 2
- Magento 2.4.4 support HOT 4
- laravel 9 support HOT 1
- Looking for maintainers HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magento-laravel-api.