Advertisement:

Author Topic: include in next update...already premium!  (Read 1551 times)

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
include in next update...already premium!
« on: October 04, 2013, 09:40:15 pm »
Hello,

About your second problem, I think their still fixing that problem when I tried to post a same problem earlier.

But I manage to solve the problem..

Follow this..
1. Locate ModelPayment.php -> /oc-content/plugins/payment/ModelPayment.php
2. Find the code:
Code: [Select]
public function getTable_premium() {
        return DB_TABLE_PREFIX . 't_payments_premium';   
}

Changed it to:
Code: [Select]
public function getTable_premium() {
        return DB_TABLE_PREFIX . 't_item';               
}


3. Find the code:
Code: [Select]
public function premiumFeeIsPaid($itemId) {
        $this->dao->select('*');
        $this->dao->from($this->getTable_premium());
        $this->dao->where('fk_i_item_id', $itemId);                           
        $this->dao->where(sprintf("TIMESTAMPDIFF(DAY,dt_date,'%s') < %d", date('Y-m-d H:i:s'), osc_get_preference("premium_days", "payment")));
        $result = $this->dao->get();
        $row = $result->row();
        if (isset($row['dt_date'])) {
            return true;
        }
        return false;
    }

Changed it to:
Code: [Select]
public function premiumFeeIsPaid($itemId) {
        $this->dao->select('*');
        $this->dao->from($this->getTable_premium());
        $this->dao->where('pk_i_id', $itemId);                           
        $result = $this->dao->get();
        $row = $result->row();
        if ($row) {
            if ($row['b_premium'] == 1) {
                return true;
            } else {
                return false;
            }
        }
        return false;
    }

Hope this helps!