Jump to content

[VYRIESENE] Vratenie tovaru - casovy limit platnosti


prsut

Recommended Posts

Ahojte,
vie mi niekto poradit, co mam upravit v kode tak, aby casovy limit platnosti vratenia tovaru sa ratal od DORUCENIA objednavky a nie od Vystavenia ?

Podla zakonov ma zakaznik pravo vratit tovar do 7 dni. System tych sedem dni rata od vystavenia objednavky, co je pre mna nevyhovujuce, pretoze ak to nemam na sklade, tak kym to pride mne a potom zakaznikovi, moze prejst aj viac ako 7 dni.

Dakujem

Link to comment
Share on other sites

U zakaznika je potom na stiahnutie potvrdenie v pdf formate, a tam sa docita, ze tovar moze vratit do 14 dni, co sa da pekne zneuzit...

A okrem toho, Zakaznik moze ziadat o vratenie len vtedy, ak je priznak objednavky nastaveny na "Dorucene".

Link to comment
Share on other sites

Takze tu je riesenie (v order.php)

   public function getNumberOfDays()
   {
       $nbReturnDays = intval(Configuration::get('PS_ORDER_RETURN_NB_DAYS'));
       $delivStatus = _PS_OS_DELIVERED_;
       if (!$nbReturnDays)
           return true;
       /*
       $result = Db::getInstance()->getRow('
       SELECT TO_DAYS(NOW()) - TO_DAYS(`delivery_date`)  AS days FROM `'._DB_PREFIX_.'orders`
       WHERE `id_order` = '.intval($this->id));
       */

       $result = Db::getInstance()->getRow('
       SELECT TO_DAYS(NOW()) - TO_DAYS(hist.`date_add`)  AS days 
       FROM 
       `'._DB_PREFIX_.'orders` AS ord, 
       `'._DB_PREFIX_.'order_history` AS hist
       WHERE ord.`id_order` = '.intval($this->id).' 
       AND
       ord.`id_order` = hist.`id_order` 
       AND 
       hist.`id_order_state` = '.intval($delivStatus));        

       if ($result['days'] <= $nbReturnDays)
           return true;
       return false;
   }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...