Ich werde die hookPayment() in cashondelivery Modul ändern, dies zu tun:
public function hookPayment($params)
{
if (!$this->active)
return ;
global $smarty;
// Check if cart has product download
if ($this->hasProductDownload($params['cart']))
return false;
//Check whether the cod done exceeds the daily limit if yes dont display the cod option
$cod_limit = Configuration::get('PS_KITS_COD_DAILY_LIMIT');// number of cod
$sql = "select count(*) AS cod_count from ps_orders where module='cashondelivery' and date(date_add) = CURDATE() and (current_state= 3 or current_state=4)";
if ($row = Db::getInstance()->getRow($sql)){
$cod_count = $row['cod_count'];
}
if ($cod_count >= $cod_limit){
return ;
}
$smarty->assign(array(
'this_path' => $this->_path, //keep for retro compat
'this_path_cod' => $this->_path,
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/'
));
return $this->display(__FILE__, 'payment.tpl');
}
Sie können dies nicht von out-of-the-box Prestashop. Sie müssen ein eigenes Modul erstellen und die Zahlungshaken anklicken, um die DB abzufragen und zu sehen, wie viele Nachzahlungen an einem bestimmten Tag geleistet wurden. –
"Wählen Sie Anzahl (*) AS cod_count von ps_orders wo Modul = 'callondelivery' und Datum (date_add) = CURDATE() und (current_state = 3 oder current_state = 4)" - Diese Abfrage ist Ritus? Bitte überprüfen Sie meine Antwort, die ich gepostet habe Ich werde die hookPayment in candondelivery Modul ändern –