Advertisement:

Author Topic: <Resolved>Fixing Payment Plugin user-custom.php Issue  (Read 7144 times)

nootkan

  • Sr. Member
  • ****
  • Posts: 259
<Resolved>Fixing Payment Plugin user-custom.php Issue
« on: January 29, 2014, 03:52:53 am »
I have a problem when using the payment plugin in combination with the osshaft_colors theme that I would like someone to resolve for me.  This seems to be an issue with every theme except Bender, but I would like it to work with the osshaft_colors theme.  Here is the problem:  When I register with a dummy account and then login, I go to my account and click on the "listings for payment status" or "Buy credit for payments" links I get redirected to the default bender theme instead of my custom theme osshaft_colors.  I have searched and posted in this forum but no one seems willing to help me with this voluntarily so I am willing to pay for the solution.  I have done a lot of the ground work based on this post: http://forums.osclass.org/plugin-payments/payment-switching-from-modern-to-bender-and-back-again/ and finally got it to go to my custom pages, but the pages are not rendering properly and when I view the page source I see the closing head tag is missing among a few other things.  I just cannot seem to figure this out.  If you are an expert in php and if you're interested in working on this please pm me and I'll respond.
« Last Edit: February 04, 2014, 09:56:31 pm by nootkan »

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #1 on: January 29, 2014, 11:52:45 am »
Actually I think we should be able to help you here though it might take a bit longer.

Do you have a link to your website to see what is being displayed?

Also, have you debugged your code using F12 in IE or using Firefox Firebug or something?


Regards,
Eric

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #2 on: January 29, 2014, 12:31:29 pm »
@SmaRTeY, @nootkan
This bug is related to osc_add_route function problem. Thread here:
http://forums.osclass.org/plugins-20/payment-plugin-osc_add_route-bug/msg84095/#msg84095

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #3 on: January 29, 2014, 12:34:55 pm »
Thanks Frosti.

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #4 on: January 29, 2014, 02:00:32 pm »
I respect your arguments Tom, it does take a lot of time sometimes to analyse a piece of code to get something as simple as two drop downs for a main and sub category select. (but I managed hehe)

Maybe a tip to speed things up when analysing, I use Windows GREP nowadays to search through ALL php and/or js scripts. Works like a charme and does save me lots of time when looking for something. There are for sure other alternatives that do the same but GREP seems to do the job and it is free.  8)

Rewriting the whole plugin might be what is needed but who am I to argue, I haven't made 1 plugin yet so I wouldn't know how difficult it is.  ::)


Thanks,
Eric



nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #5 on: January 29, 2014, 05:46:44 pm »
Actually I think we should be able to help you here though it might take a bit longer.

Do you have a link to your website to see what is being displayed?

Also, have you debugged your code using F12 in IE or using Firefox Firebug or something?


Regards,
Eric
Eric, Here is the link to one of only two pages when logged out but it is still not rendering like the rest of the pages in the site.
http://www.nootkasoundclassifieds.com/payment/menu
I have used firebug and opera's inspect element features but it still escapes me.  Sorry I don't have anything to do with IE.  I keep thinking it is something simple like a missing tag or something but I'm sure the frustration is clouding my train of thought.     

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #6 on: January 29, 2014, 05:48:28 pm »
@SmaRTeY, @nootkan
This bug is related to osc_add_route function problem. Thread here:
http://forums.osclass.org/plugins-20/payment-plugin-osc_add_route-bug/msg84095/#msg84095

Thanks for the link to the thread, however it looks like it wasn't resolved either and php is not my strong point so I need some expert advice/help to get me through.

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #7 on: January 29, 2014, 05:50:14 pm »
Yes. Frosti is on the right track.
It is an issue between the plugin and Osclass 3.x-up. That like many other plugins call for a file or code that does not exist so defaults to the GUI theme.

To attempt to make all themes workable with this and all other plugins calling for all these files would be near impossible.

The only real solution is to re-write the plugins.... Not really practical ether.

I been looking at the possibility of modifying the needed bender files for use in other themes but bender has it's code scattered in many files so it is very time/labor intensive to "create a file containing all the pieces needed. This is far above my abilities and time.

Tom

Tom, thanks for staying in tune with this issue.  Hopefully _Conejo will revamp the plugin to be compatible with the new version.

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #8 on: January 29, 2014, 06:20:12 pm »
Hi nootkan,

I do get a script error but that doesn't have to be the issue, however to be sure could you see what happens if you comment out the following code regarding the rendering? If there's no difference you can undo the comment again.

Code: [Select]
<!-- requrire location -->
    <script type="text/javascript">
        $(document).ready(function() {
        if( $("form[name=item]").length > 0 ) {
                $('input[id="region"]').addClass("{required: true, messages: { required: 'Region is required'}}") ;
                $('input[id="city"]').addClass("{required: true, messages: { required: 'City is required'}}") ;
        }
        }) ;
    </script>

nootkan

  • Sr. Member
  • ****
  • Posts: 259
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #9 on: January 30, 2014, 04:52:43 am »
Eric, I don't see the javascript in the functions.php file or the user-custom.php file which are the two files that I had to modify to get to the point where I am at  now.  That error must be in another file.  I'll look around to see if I can find it.

I've attached the two files that I had to modify according to _Conejo's post here:
http://forums.osclass.org/plugin-payments/payment-switching-from-modern-to-bender-and-back-again/

Update: don't use these two files as they are wrong.  See the last post in this thread for the answer.
« Last Edit: February 04, 2014, 04:19:54 am by nootkan »

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #10 on: January 30, 2014, 10:53:32 am »
@SmaRTeY
Problem is not with plugin, but 1 new function:
Code: [Select]
osc_add_route('payment-user-pack', 'payment/pack', 'payment/pack', osc_plugin_folder(__FILE__).'user/pack.php', true);
above code does not work on modern theme, only bender, but:
Code: [Select]
osc_add_route('payment-user-pack', 'payment/pack', 'payment/pack', osc_plugin_folder(__FILE__).'user/pack.php');
works ok, but you do not get user menu and user header.
Works ok on bender (both codes).
I do not know, maybe way how to force users do not use other theme than bender. :o

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #11 on: January 30, 2014, 11:08:31 am »
Hi, I see Frosti,

seems to me that the function call is the only thing that is different (no true at the end). That would suggest that  the function is different in Bender theme from the os-shaft theme. Should look better at the differences because if the code works well in Bender it should just work in any other theme as well unless things are different.

Now all the plugin code will be the same  I think so what is left to check is the functions that come with both themes and specifically look at the the function where Frosti finds the differences in behaviour. Take it from there... is my guess

Regards,
Eric

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #12 on: January 30, 2014, 11:21:58 am »
@SmaRTeY
I got it solved:
http://forums.osclass.org/plugins-20/payment-plugin-osc_add_route-bug/msg84086/#msg84086

Problem is that older themes do not include user-custom.php file that needs to be created  ;)

SmaRTeY

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2519
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #13 on: January 30, 2014, 01:37:19 pm »
Hehe see, it wasn't that hard ;)

Great find Frosti,  a working plugin again and now I would really want the plugin to be updated so all files needed are there! (Sigh)

I would even go as far as doing a complete check on all the different themes and their added functions and bundle them with the default Bender since they are sometimes extra helpers or just value added functions to use with OsClass.

:)

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Fixing Payment Plugin user-custom.php Issue
« Reply #14 on: January 30, 2014, 03:29:36 pm »
@SmaRTeY
Plugins are ok, theme needs update.