View Single Post
  #18  
Old 05-29-2012, 01:17 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Display company name as Email sender

To make the mod working correctly with X-Payments, a slight additional modification is required.

Alter the "modules/XPayments_Connector/xpc_func.php" script and add new code:

PHP Code:
$email_matcher "/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z](?:[a-z0-9-]*[a-z0-9])/";

if (
    
preg_match($email_matcher$result['merchantEmail'], $xpc_ematches)
    && isset(
$xpc_ematches[0])
) {
    
$result['merchantEmail'] = $xpc_ematches[0];


at the end of the xpc_prepare_cart function as follows:

PHP Code:
function xpc_prepare_cart($cart$refId$force_auth)
{
.....................................................
        
$result['merchantEmail'] = $admin_email;

    }

    
$email_matcher "/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z](?:[a-z0-9-]*[a-z0-9])/";

    if (
        
preg_match($email_matcher$result['merchantEmail'], $xpc_ematches)
        && isset(
$xpc_ematches[0])
    ) {
        
$result['merchantEmail'] = $xpc_ematches[0];
    }

    return 
$result;

__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote