Advertisement:

Author Topic: A couple of minor problems with payment plugin  (Read 3537 times)

CJD

  • Newbie
  • *
  • Posts: 16
A couple of minor problems with payment plugin
« on: September 03, 2013, 11:46:51 am »
I have a couple of small problems with the payment plugin, in the user account, on the "LISTINGS PAYMENT STATUS" and "BUY CREDIT FOR PAYMENTS" pages.

Firstly, I have the Carousel plugin on my site which displays the carousel (only) on the site's home page, but for some reason the carousel shows up on both of the user account pages.  My code in the header.php file is...

Code: [Select]
<?php if( osc_is_home_page() ){ ?>
<?php if (function_exists('carousel')) {carousel();} ?>
<?php ?>

Can anyone tell me why the carousel is showing up on the payment pages and how I might stop it?

The second problem I have is that in my early testings of my new site, when I create a listing and then make it premium via the admin panel, the listing in the users account panel still shows the option to "Make premium".  Is this a bug?

Thanks in advance for your help.

kaluka19

  • Newbie
  • *
  • Posts: 30
Re: A couple of minor problems with payment plugin
« Reply #1 on: September 03, 2013, 12:10:49 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!
« Last Edit: September 03, 2013, 12:12:58 pm by kaluka19 »

AVBestDeals

  • Full Member
  • ***
  • Posts: 121
Re: A couple of minor problems with payment plugin
« Reply #2 on: September 03, 2013, 08:05:36 pm »
Hi kaluka-19

Thanks for the code sharing...

AVBestDeals


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!

kaluka19

  • Newbie
  • *
  • Posts: 30
Re: A couple of minor problems with payment plugin
« Reply #3 on: September 04, 2013, 06:14:52 am »
Hope it helps. Your welcome.

CJD

  • Newbie
  • *
  • Posts: 16
Re: A couple of minor problems with payment plugin
« Reply #4 on: September 06, 2013, 09:56:51 am »
Thank you kaluka19 - worked perfectly.

Anyone have any ideas regarding my first problem?  Why does my carousel, which is only supposed to show on the home page, show up on the payment pages in the user account?

Code: [Select]
<?php if( osc_is_home_page() ){ ?>
<?php if (function_exists('carousel')) {carousel();} ?>
<?php ?>

Is there anything wrong with my code?  Or is there another way to do this?

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: A couple of minor problems with payment plugin
« Reply #5 on: September 06, 2013, 03:09:23 pm »
In modern theme: You have put the carousel code in header -- this is the cause of the 'problem'. You have to move it into main.php after <body> tag and header loading line. Also, remove first if statement and last closure php lines, listen to Jay's instructions from carousel help file.

In bender theme: http://forums.osclass.org/general-help/how-to-add-content-above-category-list-bender-theme/
« Last Edit: September 06, 2013, 03:43:35 pm by dev101 »

CJD

  • Newbie
  • *
  • Posts: 16
Re: A couple of minor problems with payment plugin
« Reply #6 on: September 11, 2013, 07:18:22 am »
I put the code in the header.php file because if the carousel goes in the main.php file, it appears within the #main div, which really messes up the layout because #main is narrower than I want my carousel to be.  It works perfectly in the header.php file, except that it strangely appears on the account payment pages.  Is there no way to prevent the payment pages from registering as "home" pages and showing the carousel code?

aide2001

  • Guest
Re: A couple of minor problems with payment plugin
« Reply #7 on: September 11, 2013, 01:39:53 pm »
you could put it in the main.php but the first thing before any other div(have you tried that to see what it looks like)

CJD

  • Newbie
  • *
  • Posts: 16
Re: A couple of minor problems with payment plugin
« Reply #8 on: September 12, 2013, 09:45:23 am »
Wish I could.  But the #main div opens in header.php and closes at the bottom of main.php.  So the only way to avoid having the carousel inside the #main div is to put it above where it opens in header.php.

aide2001

  • Guest
Re: A couple of minor problems with payment plugin
« Reply #9 on: September 13, 2013, 10:58:35 am »
mmm, strange, can you give me your website addy. I have this plugin for my site and all is fine so i will check the html code against mine.

CJD

  • Newbie
  • *
  • Posts: 16
Re: A couple of minor problems with payment plugin
« Reply #10 on: September 16, 2013, 09:59:12 am »
Testing the site currently at: http://101.0.64.151/~buysell/

You can login with username "test" and pw "password".  If you click on My Account and then go to LISTINGS PAYMENT STATUS or BUY PREMIUM CREDIT, you'll see what I mean.

I've also just noticed that the jQuery menu doesn't work properly in PM related account pages Inbox, Outbox and PM Settings.

Thank you for the effort aide2001.

CJD

  • Newbie
  • *
  • Posts: 16
Re: A couple of minor problems with payment plugin
« Reply #11 on: September 18, 2013, 10:27:46 am »
I've solved the problem in a hack-y way, by inserting style code on the offending pages to manually hide the carousel...

Code: [Select]
<style type="text/css">#carousel { display: none !important; }</style>
It's not ideal, but it works.

Now to figure out why my jQuery menu is not working on the PM pages.