retrive the data from database code add the custom function from the plugin file
retrive the data from database code add the custom function from the plugin file
$donorQuery->joinRaw("JOIN ({$donationQuery->getSQL()}) AS sub ON donors.id = sub.donorId");
if ($this->shouldIncludeAddress()) {
$donorQuery->attachMeta('give_donormeta',
'donors.ID',
'donor_id',
['give_phone', 'give_phone'],//added code
['_give_donor_address_billing_line1_0', 'address_line1'],
['_give_donor_address_billing_line2_0', 'address_line2'],
['_give_donor_address_billing_city_0', 'address_city'],
['_give_donor_address_billing_state_0', 'address_state'],
['_give_donor_address_billing_zip_0', 'address_zip'],
['_give_donor_address_billing_country_0', 'address_country'],
);
}
how to add a phone no query in this function without disturbing it to add a custom function it
Assuming _give_donor_phone is the meta key for the phone, try this
$donorQuery->attachMeta('give_donormeta',
'donors.ID',
'donor_id',
['_give_donor_phone', 'phone_number'],
['_give_donor_address_billing_line1_0', 'address_line1'],
['_give_donor_address_billing_line2_0', 'address_line2'],
['_give_donor_address_billing_city_0', 'address_city'],
['_give_donor_address_billing_state_0', 'address_state'],
['_give_donor_address_billing_zip_0', 'address_zip'],
['_give_donor_address_billing_country_0', 'address_country']
// ... Other existing fields ...
);
December 29, 2023
Turbo Multi-language Translator
Make the better internet purchasing globaly
Turbosify SEO Speed Booster
5.0 (7)•Free plan available
Get better conversions by improving store loading speed
Installed
Turbo Multi-language Chat - AI Customer service in one hand
December 29, 2023