Using Magento CE 1.9 I cannot get PayPal Pro Hosted to work with our custom theme. We use one page checkout. It seems the required template files don't get included.

Here's what I know:

  1. If I revert back to the default theme it works so I know the Payment Method settings are ok.

  2. Using Debug mode of PayPal I can see (in payment_hosted_pro.log) that the call to PayPal is made correctly and the response is received correctly.

  3. Using the javascript console I can see that the request to checkout/onepage/saveOrder/form_key/XXX/ is fired correctly and the response is as I would expect.

  4. Using the default theme with template hints enabled I see that in step 5 of onepage checkout it includesfrontend/base/default/template/paypal/hss/js.phtml, which contains the hidden div and javascript required to make everything work.

  5. Using my custom theme, the above template file is not included.

So, number 5 seems to be the crux of the problem, but I cannot figure out how this is included in the default theme and why it is not being included in my custom theme. Can anyone explain that?

I have looked through the various dafault layout xml files and none of those seem to reference that template file.

Digging deeper I found that app/code/core/Mage/PayPal/Block/Iframe.php file contains the code that sets that template file and renders the HTML, but I cannot figure why that is fired for the default template and not for my custom one.

Can anyone shed any light on this? Ideas and suggestions are much appreciated.

Many thanks


I have figured this out. Here is what is needed in a custom theme in order to use onepage-checkout with PayPal Pro Hosted:

The themename/template/checkout/onepage/review/info.phtml must include the following call, after the list of shopping cart items:

<?php echo $this->getChildHtml('items_after'); ?>

The corresponding layout file themename/layout/checkout.xml must include the items_after block referenced above. So, the following should appear within the checkout_onepage_review section of checkout.xml:

<block type="core/text_list" name="checkout.onepage.review.info.items.after" as="items_after" translate="label">
    <label>Items After</label>

Once these two steps are done, the frontend/base/default/template/paypal/hss/js.phtml file will be automatically rendered in the review stage of the onepage checkout.

The final thing is to check whether the theme is overriding the default opcheckout.js and if it is then ensure that the theme's version of this file is functionally compatible with Paypal Payments Pro Hosted. That may need a bit of debugging, or try using the default version of that file (may not work, theme creators often customise this js).

Hopefully this may be helpful to others.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.