WordPress.org

Ready to get started?Download WordPress

Forums

eShop
Will all do respect (4 posts)

  1. vadimg88
    Member
    Posted 3 years ago #

    I have installed this plugin for a client as he requested, He also requested to add a simple gateway. A gateway that only queries another site and returns an error code or success code based on the transaction. When i started browsing how the gateways and the plugin is built i got a serious headache! I've never seen a code messier then these written in this plugin, I have no idea why people are writing in this type of manner, It's messy, it's not readable, It's written in the worst way possible and worst thing is that it's not even documented. How can one do something about it when he tries to do the least as implement a simple gateway and fails.

    It's just a shame, All i wanted is to develop something for this plugin but for a few hours i just tried to figure out why the things that i am trying to do which are very simple just fails when used inside this plugin.

    just wanted to share my experience as a developer using and developing for this plugin. I still can't figure out how to add more then just one screen after the checkout process (Wanted to redirect him to another form where he submits his credit card information and then once that form is submitted to redirect him to a page it processes the info provided and returns true/false whether the transaction was completed or not).

    Thank You.

  2. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    It was never designed to be extensible, so I'm retrofitting as I go along. However that part is likely to remain as is for a while until I can trim down some of the duplication that has crept in over time.

    Yes the code does need a little tidying up, again it is, albeit slowly.

    The original scripts I based it on didn't have much in the way of inline documentation either by the way.

    The majority of the gateway code is contained within a couple of files, and eventually I'll be adding in necessary actions/filters so that new merchant gateways can be added via a secondary plugin making it a lot easier all round.

    Oh and thanks for letting me know, shame you couldn't have emailed me sooner though.

  3. vadimg88
    Member
    Posted 3 years ago #

    Thank you for the reply. Could you at least direct me to the right place on how to enable another screen after submitting the cart information and completing the checkout process? Or showing some example code that does that?

    Thanks again.

  4. elfin
    Moderator
    Plugin Author

    Posted 3 years ago #

    After the checkout information has been confirmed the last page in the process is the redirect page, in the majority of merchant gateways it is found within the switch statement:

    switch ($eshopaction) {
        case 'redirect':

    The value is set here:

    if($eshopoptions['checkout']!=''){
    $p->autoredirect=add_query_arg('eshopaction','redirect',get_permalink($eshopoptions['checkout']));
    ...

    So if you wanted to add something in between confirmation and the redirect you'd need to add something like:

    $p->interim=add_query_arg('eshopaction','interim',get_permalink($eshopoptions['checkout']));

    and then code as required. (adding a section to the switch statement).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags