Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

39 lignes
1.1 KiB

  1. import React from 'react';
  2. import Navbar from "@/components/_App/NavbarYamaha";
  3. import Footer from "@/components/_App/FooterYamaha";
  4. import PageBanner from '@/components/Common/PageBanner';
  5. import CheckoutContent from '@/components/Yamaha/Shop/Checkout';
  6. import * as Icon from 'react-feather';
  7. import CheckoutProduct from "api/shop/checkout";
  8. const Checkout = function ({ backend, checkout_product, ...props }) {
  9. return (
  10. <>
  11. <Navbar />
  12. <PageBanner pageTitle="Checkout" />
  13. <CheckoutContent checkout_product={checkout_product} backend={backend} />
  14. <Footer />
  15. </>
  16. )
  17. }
  18. export default Checkout;
  19. export async function getServerSideProps() {
  20. var checkout_product = [];
  21. const backend = process.env.BACKEND_SERVER_URI;
  22. var res = await CheckoutProduct.GetCheckoutproduct();
  23. if (res["STATUS"] === 1) {
  24. checkout_product = res["DATA"]["checkouts"];
  25. }
  26. console.log(checkout_product);
  27. return {
  28. props: { checkout_product, backend }, // will be passed to the page component as props
  29. };
  30. }