Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    How to store ordered image into database

    Knowledge Base
    2
    5
    732
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Keerthi last edited by Keerthi

      Hi,

      Can anyone please help me how to store ordered image into orders table along with grand total and quantity etc. All ordered data is storing at packeages/Webkul/Checkout/src/Cart.php, for reference please find below the screenshot,thanks in advance

      Screenshot (109).png

      1 Reply Last reply Reply Quote 0
      • K
        Keerthi last edited by

        Hi,

        Can anyone please suggest me, how to store ordered image into database from order summary page. Thanks in advance

        1 Reply Last reply Reply Quote 0
        • R
          rahul last edited by

          Hello @Keerthi

          You need to customise for it & can do as -

          1. Add column 'image' in oder_item table.
          2. Insert base image when order gets placed.
          3. Show this image where you want.

          This is the way, you can achieve it.

          If you only want to show images for order without inserting, then ca do as -

          Every order is place for product & product have images. So if you want to product images at order page then can retrieve according to product & need not to do above thing.

          Thanks

          1 Reply Last reply Reply Quote 0
          • K
            Keerthi last edited by Keerthi

            Hi Rahul,

            I have created one more column called "image" in order_item table and then I have added image in orderItem.php model. but image is not storing into database when order get placed. Please help me

            1 Reply Last reply Reply Quote 0
            • R
              rahul last edited by

              Hi @Keerthi

              You also need to override cart functionality beacuse every order is placed on basis of cart data, so when you add item in cart you also need to store your base image path there. So create column in cart_item table to store image there. For it you have to create own your cart facades as we created in Checkout package.

              Now you need to override add cart fuctionality for which you need to create your own route & coontroller and when user clicks on Add to cart then this controller will be called and store image in cart_item table.

              After doing all of this you need to ovveride checkout's save order functionality for which you can do the above process and when this controller called you can see this

              $order = $this->orderRepository->create(Cart::prepareDataForOrder());
              

              in OnepageController.php's saveOder function.

              in this code, your Cart::prepareDataForOrder() function should be used which we override before.

              Thanks

              1 Reply Last reply Reply Quote 0
              • First post
                Last post