Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

    • CommentAuthoroutlaw386
    • CommentTimeJul 25th 2013
     

    I was wondering if there was a way to directly go to paypal after checkout instead of going to the page that gives you payment options

    I've had some users who were confused at the checkout area and clicked outta it. And I got a notification saying a purcahse had been submitted but they haven't paid. I think being redirected to paypal right away would be easier.

    Anyway this could be done?

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJul 26th 2013 edited
     
    Project Admin

    Try adding the following line of javascript code to the very bottom of OIO's "purchase_payment.tpl" template file. It should auto-submit the form, as soon as the payment page starts to load:

    <script>window.onload = function() { if(document.paypal) document.paypal.submit(); }</script>

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoroutlaw386
    • CommentTimeJul 26th 2013
     

    Hi Simon, where would I find this file?

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoroutlaw386
    • CommentTimeJul 26th 2013
     

    ok I found this file, its in the template core folder. Added the code at the bottom nothing seemed to have happened

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJul 29th 2013 edited
     
    Project Admin

    Sorry, made a mistake in the code. Should be window.onload, not window.load (corrected the example above).

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoroutlaw386
    • CommentTimeJul 29th 2013
     

    Ok I put the code at the bottom nothing seemed to change. After checkout it goes to the page attached. And I get a auto notification that a purchase has been submitted.

    Instead of going to that page I would like to go straight to the paypal checkout page.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJul 30th 2013
     
    Project Admin

    Yes, it will still need to go to that page first - the javascript should then auto submit the form as soon as you hit the page, redirecting you to the paypal page after a couple of seconds.

    Going directly to paypal from the purchase form is a bigger change, this is a quick fix that should give the same result.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoroutlaw386
    • CommentTimeAug 1st 2013
     

    Ok here is how to code looks I put it at the bottom but its not riderecting maybe i made a mistake. This is the last paragraph of the script

    </td>
    </tr>
    <?php } ?>
    <tr>
    <td></td>
    <td>
    <?php
    $proc = strtolower($data->payment_processor);
    if(!empty($oiopub_plugin[$proc])) {
    echo '<div id="processor">' . "\n";
    $oiopub_plugin[$proc]->form($rand_id);
    echo '</div>' . "\n";
    } else {
    echo __oio("An error has occurred. Unable to load the required payment module.");
    die();
    }
    ?>
    </td>
    </tr>
    </table>
    <?php } else { ?>
    <b><?php echo __oio("This purchase code exists, but the transaction is already complete!"); ?></b>
    <?php } ?>

    <?php } ?>

    </div>
    <script>window.onload = function() { if(document.paypal) document.paypal.submit(); }</script>

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeAug 3rd 2013
     
    Project Admin

    Hmmm that does look correct. What's the url for the purchase page on your site? I'd like to go through the form and see why the javascript isn't working.

    Need help?  Quick start guide | Troubleshooting | All help topics