dimaportenko / magento-react-native

React Native mobile app for Magento 2.x
MIT License
297 stars 158 forks source link

Home page sliders image not show and featuredCategories products not showing #120

Closed samsonegba closed 4 years ago

samsonegba commented 4 years ago

Describe the bug Hello, I am new to Magento and React Native as well, I followed the instructions and compiled the app, installed Magento and everything works fine except for the home page. The homepage displays the slider's caption but not the image itself, I have tried and restarted the app and local server many times, every other pages works fine, but the homepage doesn't.

Expected behavior I expected the homepage block to display with image as I carefully uploaded the image in path "wysiwyg/home/"and copied the image path to the slider->image JSON param

Screenshots Screenshot 2020-02-27 at 4 31 33 PM Screenshot 2020-02-27 at 4 33 42 PM Screenshot 2020-02-27 at 4 34 55 PM

Additional context Add any other context about the problem here.

dimaportenko commented 4 years ago

@samsonegba can you share your cms block config here?

samsonegba commented 4 years ago

Okay its just as the basic structure you provided

{ "slider": [ { "title": "New Luma Yoga Collection", "image": "wysiwyg/home/slide1.jpg" }, { "title": "Even more ways to mix and match", "image": "wysiwyg/home/slide2.jpg" }, { "title": "Find conscientious, comfy clothing in our eco-friendly collection", "image": "wysiwyg/home/slide3.jpg" } ], "featuredCategories": { "42": { "title": "Woman Sales" }, "41": { "title": "Man Sales" } } }

Screenshot 2020-02-28 at 11 06 21 AM

dimaportenko commented 4 years ago

Try to clear mobile app data. To do this you need to add persistor.purge(); at the end of src/store/index.js

samsonegba commented 4 years ago

I uninstalled the app from my physical device I added persistor.purge(); at the end of src/store/index.js ran react-native run-android and it installs but unfortunately its still the same Screenshot 2020-02-28 at 1 24 08 PM

Is the html element the expected response from server?

dimaportenko commented 4 years ago

I see your problem

Screenshot 2020-02-28 at 16 25 47

you have to press hide editor. In WYSIWYG editor mode it will wrap content with html tags.

samsonegba commented 4 years ago

Okay so as i mentioned earlier, I am new to react native and Magento. So regarding this issue, I had to figure what knowledge I was missing to be able to debug the issue, turns out I needed to learn react-redux, so I did a quick course on it. Now I tracked to issue of sliders from the reducers to the HomeSlider component. Finally it turns out the images I uploaded in magento backend wasn't uploaded at all or perhaps wasn't uploaded to the selected directory. About the featured products not showing, I checked the JSON and the items value is empty array.

Will update when I fix see why that is.

samsonegba commented 4 years ago

I see your problem

Screenshot 2020-02-28 at 16 25 47

you have to press hide editor. In WYSIWYG editor mode it will wrap content with html tags.

In your code, you filtered the html tags anyways

samsonegba commented 4 years ago

Okay, so its fixed now, the feature product was my bad. When I created the categories, I selected some products during creating the category.. but apparently they didn't reflect, so I edited some products and added new categories to the product. Thanks you @troublediehard for this awesome system.

dimaportenko commented 4 years ago

Welcome! Glad to hear you solved your issues.