Jump to content

sprintf warning message on payment selection


Leo Clark

Recommended Posts

hi there,

i am getting this warning

Warning: sprintf(): Too few arguments in /home/creativebrazil/www/includes/content/gateway.inc.php on line 253

everytime i hit on continue to select the paypal payment.

below is the code:

################################################################################

##

## Admin E-Mail Fix by Sir William -- http://www.swscripts.com/

// notify shop owner of new order

if($basket['mailSent']==0){ // send only if not sent already for current order number

include("classes/htmlMimeMail.php");

$mail = new htmlMimeMail();

if($basket['shipCost']>0){

$emailShipCost = $basket['shipCost'];

} else {

$emailShipCost = "0.00";

}

$text = sprintf($lang['front']['gateway']['admin_email_body_1'],

$cart_order_id,

formatTime(time()),

$ccUserData[0]['title']." ".$ccUserData[0]['firstName']." ".$ccUserData[0]['lastName'],

$ccUserData[0]['email'],

priceFormat($basket['subTotal']),

priceFormat($emailShipCost),

priceFormat($basket['tax']),

priceFormat($basket['grandTotal']),

$ccUserData[0]['title']." ".$ccUserData[0]['firstName']." ".$ccUserData[0]['lastName'],

$ccUserData[0]['add_1'],

$ccUserData[0]['add_2'],

$ccUserData[0]['town'],

$ccUserData[0]['county'],

$ccUserData[0]['postcode'],

countryName($ccUserData[0]['country']),

$basket['delInf']['title']." ".$basket['delInf']['firstName']." ".$basket['delInf']['lastName'],

$basket['delInf']['add_1'],

$basket['delInf']['add_2'],

$basket['delInf']['town'],

$basket['delInf']['county'],

$basket['delInf']['postcode'],

countryName($basket['delInf']['country']),

str_replace("_"," ",$_POST['gateway']),

str_replace("_"," ",$basket['shipMethod']));

if(!empty($_POST['customer_comments'])){

$text .= sprintf($lang['front']['gateway']['admin_email_body_2'],

$_POST['customer_comments']);

}

$text .= $lang['front']['gateway']['admin_email_body_3'];

$text .= $prodtext;

$mail->setText($text);

// uncomment the following two lines to have the order message come from customer

// $mail->setReturnPath($ccUserData[0]['email']);

// $mail->setFrom($ccUserData[0]['firstName']." ".$ccUserData[0]['lastName'].' <'.$ccUserData[0]['email'].'>');

// uncomment the following two lines to have the order message come from store admin

$mail->setReturnPath($config['masterEmail']);

$mail->setFrom($config['masterName'].' <'.$config['masterEmail'].'>');

$mail->setSubject($lang['front']['gateway']['newOrderSubj'].$cart_order_id);

$mail->setHeader('X-Mailer', 'CubeCart Mailer');

$send = $mail->send(array($config['masterEmail']), $config['mailMethod']);

}

################################################################################

##

i searched the forum and could not find the problem listed.

please help.

thanks!

leo

Link to comment
Share on other sites

  • 2 months later...

I have seen this error too.

The problem may be that you changed the language file for the admin_email_body_1 message and now the number of %s does not have the same number as the number of parameters in the sprintf.

When I saw it the person added a % as text, but if you want that you should use %%.

Link to comment
Share on other sites

I have seen this error too.

The problem may be that you changed the language file for the admin_email_body_1 message and now the number of %s does not have the same number as the number of parameters in the sprintf.

When I saw it the person added a % as text, but if you want that you should use %%.

thanks robix,

i understood what you said, but i dont believe i changed the language.

i will check the %s.

i will let you know.

cheers.

Link to comment
Share on other sites

  • 3 weeks later...

I have also seen this when there has been an error uploading a skin, try uploading that again too :)

thanks anzuk.

i use legend. so, even an original skin?

i will try it and post here later.

leo

i finally realilzed something that may be obvious.

what happens is that the email sent to the store owner goes without any customer information.

it only shows the itens. i have this problem since my first install.

i even thought to suggest a more complete email to the store owner. ;)

now i will have to check all the variables to find out which one is missing empty/invalid.

lets see.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...