Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Kvarnsund committed May 28, 2023
2 parents 826ce65 + 08e0acc commit a842791
Show file tree
Hide file tree
Showing 2 changed files with 1,220 additions and 567 deletions.
6 changes: 3 additions & 3 deletions src/imat/MainViewController.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.*;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
Expand Down Expand Up @@ -123,12 +124,11 @@ public void initialize(URL url, ResourceBundle rb) {

void updateCart() {
vboxCart.getChildren().clear();
vboxCheckoutCart.getChildren().clear();
for (ShoppingItem shoppingItem : iMatDataHandler.getShoppingCart().getItems()) {
vboxCart.getChildren().add(new CartCard(shoppingItem, this));
vboxCheckoutCart.getChildren().add(new CartCard(shoppingItem, this));
}
vboxCheckoutCart.getChildren().clear();
vboxCheckoutCart.getChildren().addAll(vboxCart.getChildren());
vboxCart.getChildren().addAll(vboxCheckoutCart.getChildren());
labelCartTotal.setText(iMatDataHandler.getShoppingCart().getTotal() + " kr");
din_varukorg_antal_varor.setText(
iMatDataHandler.getShoppingCart().getItems().size() + " varor klara för leverans hem till din dörr!");
Expand Down
Loading

0 comments on commit a842791

Please sign in to comment.