skadizz / angular2-presta Goto Github PK
View Code? Open in Web Editor NEWAngular services for consuming PrestaShop API ...
Angular services for consuming PrestaShop API ...
hi, I saw his project that I started to work on, but I noticed difficulties, for example, the price shown with the line item "item.price | currency" is excluded, and I would like to ask, how to show the discounted price.
I will shortly enter details about any updates
Thank you for your support and excuse me for my bad English
Hi,
I already implement to display my product information into my ionic application throughout Prestashop web service by using Get method.
eg.
this.http.get("http://www.example.com/api/products/?ws_key=xxxxxxxx&output_format=JSON&display=full").map(res => res.json()).subscribe(data => {
});
I also implement that new customer could sign up in the app, and customer data will be upload throughout Prestashop Web service. People who manage the back office could look at that a new customer sign up. I know that the default data for Prestashop is XML so I upload XML data back to its API.
eg.
//I only upload the data that Prestashop requires according to errors by testing, but I do not know //what data exactly Prestashop needs.
//I upload address without customer id, which makes address not display in the back office.
let customer = "<prestashop><customer><firstname>"+ this.newUser.first_name +"</firstname><lastname>" + this.newUser.last_name + "</lastname><email>" + this.newUser.email + "</email><passwd>" + this.newUser.password + "</passwd><active>1</active><newsletter>1</newsletter></customer></prestashop>" ;
let linkToCustomer = 'http://www.example.com/api/customers/?ws_key='+ this.apikey + '&output_format=JSON&display=full';
this.http.post(linkToCustomer, customer, {headers: headers}).map(res => res.json()).subscribe(data => {
});
The last step for me is to upload order after customers purchase. This step is quite difficult since each order interacts with several api pages such as api/orders, api/carriers, api/carts, api/orders_invoice and so on. I want to data could display on back office just like customers make an order through web broswer, and sales representatives could manage orders on back office.
Could you please give some suggestion about my problem.
Look forward to receiving your reply soon.
Cheers,
Yifei
Hi!
I send this issue for show how enable CORS without modify Prestashop code using a .htaccess
file. In this way only works with Apache HTTP server and miss configurations for others HTTP servers, like Nginx.
My prupose is for add this script in the main README
and help other users when working with SPA and need enable CORS.
Thank's for your project!
PD. Sorry for mi english!
<IfModule mod_headers.c>
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Headers "Content-Type, Authorization, Io-Format, Accept"
Header always set Access-Control-Allow-Methods "GET,POST,HEAD,DELETE,PUT,OPTIONS"
</IfModule>
<IfModule mod_rewrite.c>
# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
</IfModule>
I have tried this code into my ionic 3 application, but getting issue while run
angular2-presta.js:253 Uncaught TypeError: Object(...) is not a function
at angular2-presta.js:253
at Object. (angular2-presta.js:255)
at webpack_require (bootstrap cd5e1d1a7877d6e57d27:54)
at Object.350 (main.ts:5)
at webpack_require (bootstrap cd5e1d1a7877d6e57d27:54)
at Object.345 (main.ts:1)
at webpack_require (bootstrap cd5e1d1a7877d6e57d27:54)
at webpackJsonpCallback (bootstrap cd5e1d1a7877d6e57d27:25)
at main.js:1
Hello. I don't know why but i'm getting this error all time:
bundle update failed: 'PrestaService' is not exported by node_modules\angular2-presta\dist\index.js
(imported by src\app\app.component.ts). For help fixing this error see https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
And I don't know how to solve it. Any idea? thanks
How to access the category of a specific product?
I am looking for the list of active products, and at the time of showing it I would like to show: name, price and to which category the product belongs, but this last thing is not clear to me how I can do it.
I know this is not an error as such, but I would appreciate your comment.
I find problems trying to use ap2-image component in Ionic 4.
Angular tells me that is not declared, but if I try to include it in "declarations" of my app.module throws the error "declared in angular2-presta module and in module.app".
Is this about the new Angular version in Ionic 4?
Greetings.
node v7.7.2
angular 4.2.4
@angular/cli 1.3.2
// The following triggered the error 'No provider for Http'
constructor(private _prestaService: PrestaService) {}
Solved by adding the HttpModule
https://stackoverflow.com/questions/33721276/angular-2-no-provider-for-http
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.