Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favorites Menu Implementation #57

Open
karastoyanov opened this issue Jul 2, 2023 · 5 comments
Open

Favorites Menu Implementation #57

karastoyanov opened this issue Jul 2, 2023 · 5 comments
Assignees
Labels
categories Categories Menu database Postgres DB management products Products display in front-end pyqt-gui QT Graphical User Interface

Comments

@karastoyanov
Copy link
Member

Favorites menu implementation

  • new menu file will be needed
  • new database table for the favorites items
  • favorites products should be read dunamically, based on currently loged in user
@karastoyanov karastoyanov converted this from a draft issue Jul 2, 2023
@karastoyanov karastoyanov added pyqt-gui QT Graphical User Interface categories Categories Menu labels Jul 2, 2023
@rayapetkova
Copy link
Collaborator

  1. New database table favourite_products added
  2. main_menu.py:
    • When the favourites button is clicked it calls a function open_favourites_func(). This function returns another function open_favourites(). This way the favourites_layout shows and the categories one hides.
  3. favourites.py:
    • The implemented inner join query gives us all the products that the user ('pesho') has marked as "favourite". All the layouts and labels of each product are made again.
  4. Need to do:
    • When the user has marked more than 3 products as favourite, they need to display in a scroll menu (or something else that will arrange them).

image
image

@rayapetkova rayapetkova added database Postgres DB management products Products display in front-end labels Jul 5, 2023
@karastoyanov
Copy link
Member Author

Wow, really god job! That one is by the books!

One idea that comes to my mind, to solve the issue with more than 3 products is, instead of having a groupbox where to push the labels for the products, to leave a GridLayout(remove the current groupbox) and every product to appear on coordinates(x, y). They inside a for loop, which will iterate all the favorites products for the currently logged in user, we can create new product layout on GridLayout(x, y+1) AND when we get to y = 2(third product on a row) then we can increase the x variable by 1, which means we will start drawing products on the next row.

That way we will create a grid with N numbers of rows, each row containg 3 columns. The questions is how the framework with draw them below 🤔

@karastoyanov karastoyanov moved this from Todo to In Progress in First Stable Version - market-app Jul 6, 2023
@karastoyanov
Copy link
Member Author

Last update:

  • ba76cef

  • 859f087

  • Scroll menu implented. Code the favorite button functionality --> remove the specific item from favorites table in the database.

@rayapetkova
Copy link
Collaborator

Last changes: f08087f

  • favourites.py: When the button favourites is clicked it goes to a function redirect_to_delete_postgres_func. Then the func delete_from_favourite_products is called and it executes a query to delete the product.

@rayapetkova
Copy link
Collaborator

Last changes: 0b405f0

  • The user can add a product from favourites to basket
  • Removed the first button (new one was added - removing the product from favourites) - same goes for 'basket'

@karastoyanov karastoyanov moved this from In Progress to Done in First Stable Version - market-app Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
categories Categories Menu database Postgres DB management products Products display in front-end pyqt-gui QT Graphical User Interface
Projects
Development

No branches or pull requests

2 participants