Skip to content

Conversation

@SuperSimpleDev
Copy link
Owner

No description provided.

@aliffashraff
Copy link

Hi ! I have questions about the paypal payment method part. May i know hoe do you redirect to the third party such as paypal/


document.querySelector('.js-search-button')
.addEventListener('click', () => {
const search = document.querySelector('.js-search-bar').value;
Copy link

@antaugustol antaugustol Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One extra featured that I find useful:
The amazon header is repeated in amazon.html, checkout.html and tracking.html so, I decided to extract it to its own module.
Note: the event listeners for the search bar/button must be placed in the header module.

// using cart-class.js oop
import { cart } from '../data/cart-class.js'
import { products, loadProductsFetch } from '../data/products.js'
import { renderAmazonHeader, displayCartQuantity } from './partials/header.js'

renderAmazonHeader()
loadPage()

// loading products from backend https://supersimplebackend.dev/products
async function loadPage() {
  await loadProductsFetch().catch(() => alert('error'))
  renderProductsGrid()
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another feature that I add was making the paymentSummary sticky , so even though you have multiple products in your cart you can still have access/see your payment summary :>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice idea

}

// Extra feature: make the cart empty after creating an order.
resetCart();
Copy link

@CreatorsHiring CreatorsHiring Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is making my orders.html broken it becomes empty , i got it i should have kept reset cart in try{ } below addOrder

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a feature where if you search for sth not in the keywords or name, it tells you The search doesn't match any products and takes you back to amazon.html
Screenshot 2025-11-09 134939

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations to everyone who made it this far, you've made a good progress and work. Be proud of yourself and never stop learning).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants