Payment on customer

Hi all LiteCart users a small question has a store that we would like to be able to set payment methods for each customer.  For example, a customer may have a case in delivery invoive and a card.  Another customer may have only cards another may have cash and cards.  Or if they exist so you can put paid sweets on a customer category or so.

Very good shop easy to work on

tim

No such preexisting add-on. But if you search for an existing property in the customer profile you can see all places you can modify to squeeze a new property in.

Example:
https://github.com/litecart/litecart/search?q=lastname

The payment module needs a condition:
if (!in_array(__CLASS__, preg_split('#\s*,\s*#', customer::$data['payment_modules'], -1, PREG_SPLIT_NO_EMPTY))) return;

Hello
Ok but want to be able to set so that some can pay by invoice others only by card etc.

tim

Yes that is what I had in mind. So..

  1. Add a new property to the customer object in the database lc_customers.
  2. Edit the entity object so the platform can load and save the data.
  3. Edit the edit_customer backend page so you can manage this data.
  4. Add that condition to your modules having them check if they are allowed to be displayed.

Thanks

This thread has been closed due to long inactivity. Posting to it is not possible.
View code on GitHub