Advertisement:

Author Topic: Payment Plugin already premium status  (Read 2372 times)

kaluka19

  • Newbie
  • *
  • Posts: 30
Payment Plugin already premium status
« on: September 03, 2013, 10:08:05 am »
Hi All,

Does anyone know how to configure the Already Premium! status?

I have tested one published ad and set Mark as Premium in the Listings manager in the osclass admin. But when I go back to User My Account area, in Listing Payment status, still the option is Make Premium.

Anyone who can help?

 

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Payment Plugin already premium status
« Reply #1 on: September 03, 2013, 10:47:00 am »
We're working on fix that

kaluka19

  • Newbie
  • *
  • Posts: 30
Re: Payment Plugin already premium status
« Reply #2 on: September 03, 2013, 10:48:23 am »
mmm... <sigh>

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: Payment Plugin already premium status
« Reply #3 on: September 03, 2013, 10:53:51 am »

kaluka19

  • Newbie
  • *
  • Posts: 30
Re: Payment Plugin already premium status
« Reply #4 on: September 03, 2013, 11:13:16 am »
Oh! My! Solved my own problem.. a little tweak on ModelPayment.php ..

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: Payment Plugin already premium status
« Reply #5 on: October 04, 2013, 09:41:43 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!


your own tweak..great fix!

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: Payment Plugin already premium status
« Reply #6 on: November 12, 2013, 08:54:26 pm »
@_conejo et all
is this fix, messing with the auto delete of the premiums ???

frici84

  • Guest
Re: Payment Plugin already premium status
« Reply #7 on: January 06, 2014, 04:17:08 pm »
hy

I have the same problems, does not work.

I tested it and nothing happens. :(  :(

/Bender theme/