Questions tagged cart

Explore the latest questions and answers asked by our top developers.

Counter On Navbar Product Angular

I have a problem, I’m creating a simple ecommerce where I have the product component and the Cart component. In the navbar i put a counter with routerLink to the cart page. I would like to implement the logic that the count is updated when the product is purchased. I use a service. What can […]

Where to save shop cart for e-commerce website – Angular

I’am developing an online store for a client using Angular 9 as a front-end framework. I want to keep the user’s shopping cart data even after reload the page so I used browser cookies to save it. I also save Token there. My questions are : is it a best practice to use cookies/session storage […]

By khadija L
Published
Categorized as angular, cart, cookies, e-commerce Tagged , , ,

Angular – How can I add amounts in a button?

My problem is, that I can’t add amounts in a button. My code looks like this: navbar.component.html: <button>0,00$</button> <button function="onClick()">Add 5</button> and navbar.component.ts import { Component, ElementRef, ViewChild } from ‘@angular/core’; @Component({ selector: ‘app-navbar’, templateUrl: ‘./navbar.component.html’, styleUrls: [‘./navbar.component.scss’], }) export class NavbarComponent { onClick(){ //add 5 when clicked } } I would really appreciate it […]

By Smasher
Published
Categorized as angular, angular-material, button, cart Tagged , , ,

increment totalAmount each time add product

I have a problem when I add a product the totalAmount shows me 20 I don’t know why? and if I increment the totalAmount doesn’t move how can I do it? thanks ts.file productList = [ { id: 1, name: ‘Louis Vuis’, price: 10, qtn: 1 }, { id: 2, name: ‘shubert helmet’, price: 20, […]

By Vinodea Richard
Published
Categorized as angular, cart, javascript, typescript Tagged , , ,

update the quantity without creating a new row with angular as simply as possible

I try to do a shopping cart each time I add the same item it creates a new line for me, I would like to update the Quantity, do I have to make a loop that goes through an array? ts.file productList = [ { id: 1, name: ‘Louis Vuis’, price: 10, qtn: 1 }, […]

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq