sanjeevyadavIT / magento_react_native

🛒 MageCart: E-commerce app for Magento 2.x written in React Native
GNU General Public License v3.0
281 stars 124 forks source link

JSON Parse error: Unexpected Identifier "New" #23

Closed siprabin closed 5 years ago

siprabin commented 5 years ago

When I try to run using react-native run-android opening the application in my mobile. but showing the error in Home Page.

JSON Parse error: Unexpected Identifier "New"

Can anyone help?

sanjeevyadavIT commented 5 years ago

Hi @siprabin, Did you change the magento url to your own magento website url???

If yes, then you need to create new a CMS block in Magento admin and follow these steps

Setup new CMS block in Magento Admin which will be used in MageCart HomePage

  1. goto Content > Blocks > Add New Block
  2. Put your config inside Content section (config sample)
  3. save your block and put this newely created cms ID in src/config/magento.js to home_cms_block_id parameter

the config sample looks like this

{
    "slider":[
       {
          "title":"Roadaster sale",
          "image":"wysiwyg/home/banner1.jpg"
       },
       {
          "title":"Sunglasses sale",
          "image":"wysiwyg/home/banner2.jpg"
       },
       {
          "title":"jeans, trouser, Skirts & more",
          "image":"wysiwyg/home/banner3.jpg"
       }
    ],
    "featuredCategories":{
       "30":{
          "title":"Woman Sale"
       },
       "31":{
          "title":"Man Sale"
       }
    }
}

As you can see there are three images wysiwyg/home/banner1.jpg, wysiwyg/home/banner2.jpg, wysiwyg/home/banner3.jpg you need to upload images and mention in config

Also the number 30 and 31 are actually category Id for women sale and men sale respectively, you need to provide correct category id.

If you are still confuse let me know. Or if you did that correctly and error is something else, please mention clears steps from cloning to running the app

siprabin commented 5 years ago

Working fine now. Thanks @alexakasanjeev

sanjeevyadavIT commented 5 years ago

Happy to help @siprabin, if you want to contribute back to the project, it's really easy I have written detail guide on how to do that.

And little late, but thanks to you I wrote the new setup guide with images , https://github.com/alexakasanjeev/magento_react_native/wiki/Setup