Apply Payment Type to Existing Customers

From ISoft Wiki
Jump to: navigation, search

ITrack Enterprise currently has a setting for payment types where you can apply them to new customers, but you may also want to assign the new payment type to existing customers. These queries can help you with that:

#Get the list of payment types, starting with the most recently created
SELECT * FROM paymentmethod ORDER BY paymentmethodid DESC;

#Apply a paymentmethodid to all customers, if a customer already has the payment type
#this query will handle that fine
INSERT IGNORE INTO `customerpaymentmethod` (customerid, paymentmethodid)
SELECT customer.`customerid`, <paymentmethodid> FROM customer;