Jump to content

Archived

This topic is now archived and is closed to further replies.

NodsDorf

Where are %s and %d defined?

Recommended Posts

For example in the min order contribution the language file echoes:

define('MINIMUM_ORDER_NOTICE', "Minimum order amount for %s is %d. Your cart has been updated to reflect this.");

 

I need to change %s to model number instead of product name.

 

I think this was asked before but didn't see an answer and of course searching for %s isn't going to give me any results on these forums.

 

Any help is appreciated.

Share this post


Link to post
Share on other sites

You need to search the code for where MINIMUM_ORDER_NOTICE is used. It will have something like this:

sprintf(MINIMUM_ORDER_NOTICE, $a, $B);

The $a and $b could be text, like 'hello,' or some variable or defined constant. If the latter, you need to locate the source, again with the search, and change it there.

Share this post


Link to post
Share on other sites

That was painless.

 

Instructions say:

//Minimum quantity code
   if(MINIMUM_ORDERS == 'true'){
  $min_order_query = tep_db_query("select p.minorder as min_quant FROM " . TABLE_PRODUCTS . " p where p.products_id = '".$products[$i]['id']."'");
   while ($min_order = tep_db_fetch_array($min_order_query))  {
     if ($products[$i]['quantity'] < $min_order['min_quant'] ) {
           $products[$i]['min_quant']=$min_order['min_quant'];
     }
   }

    if ($products[$i]['quantity'] < $products[$i]['min_quant'] ) {
        $products[$i]['quantity']=$products[$i]['min_quant'];
       $cart->add_cart($products[$i]['id'],$products[$i]['quantity'],$products[$i]['attributes']);
       $cart_notice = sprintf(MINIMUM_ORDER_NOTICE, $products[$i]["name"], $products[$i]["min_quant"]);
   }
   }
   //End Minimum quantity code

 

Just changed last line

$cart_notice = sprintf(MINIMUM_ORDER_NOTICE, $products[$i]["name"], $products[$i]["min_quant"]);

to

$cart_notice = sprintf(MINIMUM_ORDER_NOTICE, $products[$i]["model"], $products[$i]["min_quant"]);

 

Thank you Jack!

Share this post


Link to post
Share on other sites

×