Virtuemart setting "Checkout" link to target="new"
I know this question is specific to VM only but I have run out of options. I'm usually ok with minimal php code editing开发者_如何转开发, but his is over my head.
I can not find the php that relates to the "checkout" link
I need to have it open in a new window ie. target="new"
Reason being; VM is running in an iframe (facebook) and for Paypal to work I need to pull the user out of iframe and into new window on checkout.
You can find the checkout link in
components/com_virtuemart/themes/default/templates/pages/shop.cart.tpl.php
(If you're not using the default theme then replace 'default' with the name of your theme's directory).
You might have had trouble finding the checkout link because VirtueMart uses language files, so the text for the checkout link is actually PHPSHOP_CHECKOUT_TITLE
and looked up from administrator/components/com_virtuemart/languages/common/
e.g. english.php
. The workflow is recursively grep
for the text to find it in the language file then recursively grep
for its reference to find where it's used.
The checkout link is generated by a call to vmCommonHTML hyperlink, which takes the following parameters:
function hyperLink( $link, $text, $target='', $title='', $attributes='' )
...
So you'd need to specify the target in the third parameter, so change:
echo vmCommonHTML::hyperlink( $href, $text, '', $text, $class_att );
to
echo vmCommonHTML::hyperlink( $href, $text, 'new', $text, $class_att );
精彩评论