Paypal Label missing in onepage checkout
I just upgraded from magento 1.4.0 to 1.6. I have 2 payment开发者_如何学运维 methods: paypal and credit/debit card.
My issue is that whilst I am getting the credit/debit card text next to the relevant radio button, I am NOT getting any paypal text (the label) next to the paypal radio button. I have a description in the title in paypal config but this is not getting picked up.
Can anyone help me? Thanks!
Although this isn't the ideal answer, here's the quick fix I used to manually add in the label. Go to app/design/frontend/base/default/template/mark.phtml
. I edited this file, simply adding a text label before the PayPal image:
<!-- PayPal Logo -->
Credit Card / PayPal <img src="<?php echo $this->escapeHtml($this->getPaymentAcceptanceMarkSrc())?>" alt="<?php echo Mage::helper('paypal')->__('Acceptance Mark') ?>" class="v-middle" />
<a href="<?php echo $this->getPaymentAcceptanceMarkHref()?>" onclick="javascript:window.open('<?php echo $this->getPaymentAcceptanceMarkHref()?>','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, ,left=0, top=0, width=400, height=350'); return false;"><?php echo Mage::helper('paypal')->__('What is PayPal?') ?></a>
<!-- PayPal Logo -->
Optionally, copy that file to app/design/frontend/default/yourtemplatedir/template/mark.phtml
if you don't want your change to be overridden in the next upgrade.
The ideal solution would be to find the file that creates the label in the first place and make the change there. Also, using the method that gets the PayPal title set in the configuration setting. But the above is the first, quick fix I found that works.
Instead of changing the mark.phtml
file, I prerer to avoid displaying that file.
I copied the block app\code\core\Mage\Paypal\Block\Standard\Form.php
to my local (app\code\local\...
) and changed
protected function _construct()
{
$this->_config = Mage::getModel('paypal/config')->setMethod($this->getMethodCode());
$locale = Mage::app()->getLocale();
$mark = Mage::getConfig()->getBlockClassName('core/template');
$mark = new $mark;
$mark->setTemplate('paypal/payment/mark.phtml')
->setPaymentAcceptanceMarkHref($this->_config->getPaymentMarkWhatIsPaypalUrl($locale))
->setPaymentAcceptanceMarkSrc($this->_config->getPaymentMarkImageUrl($locale->getLocaleCode()))
; // known issue: code above will render only static mark image
$this->setTemplate('paypal/payment/redirect.phtml')
->setRedirectMessage(
Mage::helper('paypal')->__('You will be redirected to the PayPal website when you place an order.')
)
->setMethodTitle('') // Output PayPal mark, omit title
->setMethodLabelAfterHtml($mark->toHtml())
;
return parent::_construct();
}
to
... the same
...
$this->setTemplate('paypal/payment/redirect.phtml')
->setRedirectMessage(
Mage::helper('paypal')->__('You will be redirected to the PayPal website when you place an order.')
)
->setMethodTitle('Paypal (my title)');
return parent::_construct();
}
adding my custom title and removing the mark file.
精彩评论