How can I count list from mysql result. I am trying to make cart list

This is mysql table

This is my php file

this is my block, without if else condition i manage to get 1st item only

error im getting
error

thank you in advance

Can you show your responseContent (before converting to a list)
The problem lies there as you are only getting a single list item, made up of all your returned items

this is result for response content

In your blocks you need to be testing for the length of the list global row, try like this:

image

1 Like

Hi Timai, I tried but only list 1 is appear, when i do list > 2 it didnt show any

mit block

Mobile ui

currently I have 5 horizontal layout for item. when list is not null then only the layout is visible

You probably want to do something like this:

image

However, I would suggest you consider using the dynamic components extension, in order to build your cart dynamically as the number of items grows....

1 Like

its working now, my bad put at else


Thank you for your time

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.