Faktura bude mat rok, mesiac a cislo. Napr: 210200001
classes/order/order.php
Vyhladat:
/**
* Generate a unique reference for orders generated with the same cart id
* This references, is useful for check payment.
*
* @return string
*/
public static function generateReference()
{
return strtoupper(Tools::passwdGen(9, 'NO_NUMERIC'));
}
public function orderContainProduct($id_product)
{
$product_list = $this->getOrderDetailList();
foreach ($product_list as $product) {
if ($product['product_id'] == (int) $id_product) {
return true;
}
}
return false;
}
Zamenit:
/**
* Gennerate a unique reference for orders generated with the same cart id
* This references, is usefull for check payment.
*
* @return string
*/
public static function generateReference()
{
$query = new DbQuery();
$query->select('MAX(id_order) as max');
$query->from('orders');
$query->where('id_cart' > 0);
$order = Db::getInstance()->getRow($query);
$reference = $order['max'] +1 ;
$date_reference = StrFTime("%y%m", Time());
return $date_reference.sprintf('%05d', $reference);
}
public function orderContainProduct($id_product)
{
$product_list = $this->getOrderDetailList();
foreach ($product_list as $product) {
if ($product['product_id'] == (int) $id_product) {
return true;
}
}
return false;
}