Jump to content

yifeilyf

Members
  • Posts

    18
  • Joined

  • Last visited

Profile Information

  • First Name
    Yifei
  • Last Name
    Luo

Recent Profile Visitors

358 profile views

yifeilyf's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Hi guys, Thanks for all your help. I just solve it. Delete the old .htaccess file and let it regenerate a new one, and everything works fine. Cheers
  2. Hi, Thanks for your reply. Do you know how could I change these image path manually? Which file do I need to modify? Cheers
  3. Hi guys, I think that my website is hacked by someone, and all product images cannot be shown entirely. I notice that image path is not correct when I inspect on chrome, which means the image path is changed. I find these uploaded images are in the different folder by looking at file manager. I attached an image to show what exactly I am saying. Anyone could help me change the image path back. Cheers, Yifei
  4. Hi guys, I installed Prestashop official payment addon Alipay for my Chinese customers. Everything works fine for setting up and payment. Only one problem is that it redirects the customer to a 404 page after paying successfully, and I think this addon does not add a page for that. Could you guys have a solution for that? Cheers, Yifei
  5. Hi, I really appreciate your reply. I try to add a new field in my register form by following this link "http://prestacraft.com/adding-new-fields-to-the-registration-form/#modal-fb". It works well before I interact my ionic mobile app with Prestashop shop. After I encounter this issue, I delete every single line from this tutorial, and this error goes away. I do not know why. Cheers, Yifei
  6. Hi guys, When I enter my back office, I click to edit my customer. There is an error. "Notice on line 654 in file /home/linkarwi/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code [8] Undefined index: query". The weird thing is when I enter into every single customer page, the customer information is not correct, and one of them is that the email is our customer supporter? Also, the code on 654 line is comments which I attach a picture. Anyone could help. Cheers
  7. Hi guys, I am working on a mobile application. I am doing signup page to help new customers to register their account. I already figure out post data to Prestashop database. I use the ionic framework with angular js. The following code is test code. let body = "<prestashop><customer><firstname>yifei</firstname><lastname>luo</lastname><email>[email protected]</email><passwd>21312312</passwd><hear_from_us>Most</hear_from_us></customer></prestashop>" ; // JSON.stringify(customerData) this.http.post(link, body, {headers: headers}).map(res => res.json()).subscribe(data => { console.log(data); console.log(body); }, (err) => { console.log(err); }); After I click signup button, this action triggers. When I check my API throughout API, I can see this (image 1), which means that my data post into the database successfully. When I open my back office, I could see the new customer (image2). However, it does not show the status of enabling. When I click the edit button. I receive the error (image 3). I go through my file manager and find these code (image 4 and image 5). Anyone could help about this. Cheers, Yifei update: The first error solved. The second one is confused about "Notice on line 654 in file /home/linkarwi/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code [8] Undefined index: query" . The weird thing is that it is comment on 654 line????
  8. One of my friends gives me some suggestion about changing the code. I add the code "JSON.stringify". I use simple data to test it. let headers = new Headers(); headers.append('Content-Type', 'application/json'); let body = { message: '123' }; this.http.post(link, JSON.stringify(body), {headers: headers}).map(res => res.json()).subscribe(data => { console.log(data); console.log(body); }, (err) => { console.log(err); }); It does not work but the error is different. The following image is what I got about the error. He told me that Prestashop maybe only accepts retrieve data from the server. He asks me whether I could install npm CORS into PrestaShop to enable CORS. This is the link "https://github.com/expressjs/cors", but I do not know how to do it. I think that Prestashop could not enable CORS as the default setting. Anyone know how to enable it????? Cheers
  9. Hi guys, I meet the similar problem. Could you guys check my post whether you have a solution now? https://www.prestashop.com/forums/topic/615060-ionic-mobile-application-accesses-prestashop-web-serviceget-method-works-but-post-not/ Cheers, Yifei
  10. I ask someone, and they talk me that Prestashop cannot post by itself, and it needs to install CORS into it. However, I do not know how to setup CORS. Also, I found two links which may relate to my question. https://stackoverflow.com/questions/30868991/update-put-a-json-object-with-ajax-prestashop/44502249#44502249 http://forge.prestashop.com/browse/PSCSX-3025 https://stackoverflow.com/questions/25526949/adding-products-to-prestashop-1-6-0-9-with-webservice Please have a look. Cheers
  11. Hi guys, I am working on an Ionic mobile application, and this app needs to interact with Prestashop online shop. First of all, I set up my web service on back office and access external program to access by Get and Post method (image 1) First of all, I retrieve product information from Prestashop online shop throughout Web service, and it works perfectly. The following code is one of my Get methods. loadProducts(){ this.http.get('http://www.linkarwine.com/api/products/?ws_key='+ this.apikey +'&output_format=JSON&display=full&filter[id]=[20|23|26|40|44|64|68|39|66|72]').map(res => res.json()).subscribe(data => { //console.log(data); //console.log(data['products'][0]['id']); this.products = data.products; //console.log(this.products[0]['manufacturer_name']); }, (err) => { console.log(err); }) } Currently, I am working on customer signup page, which means I need to post new customer data into Prestashop throughout Web Service. This image (image 3) shows that my application "signup" page. The following code is my "signup" function, and you could find my post method down below. signup(){ let customerData = { customer: {} } customerData.customer = { "email": this.newUser.email, "first_name": this.newUser.first_name, "last_name": this.newUser.last_name, "password": this.newUser.password, "billing_address": { "first_name": this.newUser.first_name, "last_name": this.newUser.last_name, "address_1": this.newUser.billing_address.address_1, "address_2": this.newUser.billing_address.address_2, "city": this.newUser.billing_address.city, "state": this.newUser.billing_address.state, "postcode": this.newUser.billing_address.postcode, "country": this.newUser.billing_address.country, "email": this.newUser.email, "phone": this.newUser.billing_address.phone }, "shipping_address": { "first_name": this.newUser.first_name, "last_name": this.newUser.last_name, "address_1": this.newUser.shipping_address.address_1, "address_2": this.newUser.shipping_address.address_2, "city": this.newUser.shipping_address.city, "state": this.newUser.shipping_address.state, "postcode": this.newUser.shipping_address.postcode, "country": this.newUser.shipping_address.country } } if(this.billing_shipping_same){ this.newUser.shipping_address = this.newUser.billing_address } //send data to prestashop throughout API let link = 'http://www.linkarwine.com/api/customers/?ws_key='+ this.apikey + '&output_format=JSON&display=full'; this.http.post(link, customerData).map(res => res.json()).subscribe(data => { console.log(data); }, (err) => { console.log(err); }); } } However, it does not work. This image (image 4) is what I got about its error. I already asked many people, and they told me that it may be caused by Cross-Origin Resource Sharing (CORS) because I try to change chrome into firefox, and it does mention about that. Then I add some code into my .htaccess file throughout web hosting file manager. like this <IfModule mod_headers.c> <FilesMatch "\.(ttf|ttc|otf|eot|woff|svg)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule> but it does not work. Then I try to use postman to test my url. As always, my get method works fine. But I get this (image 5) when I try to use post, which may cause by data format??? I know XML format is default for Prestashop. According to this image (image 6), it should not be related to CORS problem, right??????? Anyone could give me some suggestion or information about it. Thanks so much Yifei
  12. Hi, I already figure out how to fetch data throughout Prestashop web service, but I do not know how to display these data in my app. The following image is my provider file, which I follow this link "https://www.youtube.com/watch?v=vuc4dp0qHSc". Please have a look Cheers, Yifei
  13. Hi, I really appreciate your help. I already looked at Prestashop Web Service documentation. The following image is what I get currently. However, I notice that I copy these links and paste another web page, and I have to type my username and password, which means that if I access data from my Prestashop, I may need to interact with my authorization. Also, I saw that you give me a JSON format but I find data that I get from the documentation is XML format. Currently, I follow this link "http://doc.prestashop.com/display/PS16/Web+service+tutorial". Look forward to receiving your reply. Cheers, Yifei
  14. Hi guys, I am working on the Ionic framework, and I am thinking about connecting this mobile app with my current Prestashop in order to get product data. I am learning with some tutorials online, and they only have solutions with Woocommerce API. I just wonder if you guys could provide some information about how to connect these two platforms together. Cheers, Yifei
×
×
  • Create New...