Question: Fetch Order Data In Payment Form

Fetch Order Data In Payment Form

How do I access fields from the sim_sales record while in the add_payment and edit_payment forms? I've tried to sort it out on my own, unsuccessfully, so I'm obviously not understanding how

SS

Scott Smith

Asked
How do I access fields from the sim_sales record while in the add_payment and edit_payment forms? I've tried to sort it out on my own, unsuccessfully, so I'm obviously not understanding how to do it. Can you help?
  • MS

    Mian Saleem

    Answered
    Hello,

    The add payment modal code is in the `themes/default/views/sales/index.php`. You can make ajax call to get the sale data. I think, you need to list click event on `.add_payment`. You can search for `.add_payment` to check the modal load code.

    For edit payment, you can set the sale data in `edit_payment` method of `app/controllers/Sales.php` to pass it to the view and use.

    Thank you
  • SS

    Scott Smith

    Answered
    Sorry, I was away on vacation for a while.

    I'm not sure I understand how to translate that into actual code.

    In fact, I'm sure I don't. I already know WHERE the changes would need to go, but I don't know now HOW they need to be done. If I knew that, it would already be done.

    Can you offer any additional direction?
  • MS

    Mian Saleem

    Answered
    Hello,

    The add payment modal has been move to `addSalePayment` of sales controller and new view file `themes/default/views/sales/add_payment.php`

    You can check the update.

    Thank you
  • SS

    Scott Smith

    Answered
    I will look into it asap.
  • Login to Reply