Hey, hey,
I want to open articles (com_content) for tos and tos2 (privacy statement) in a popup.
I copied tos.php and tos2.php to my template and changed the url to the article.
Here are my issues...
tos opens a popup with "Terms of service" but no other text or my tos article.
tos2 opens a new tab with my privacy article.
How do I get both my articles inside the popup?
Do I need to edit more?
Here's my link snippet from tos2.php<a href="<?php echo JRoute::_ ('index.php?option=com_content&view=article&id=2', FALSE) ?>" class="terms-of-service" id="terms-of-service2" rel="facebox" target="_blank">
<span class="vmicon vm2-termsofservice-icon"></span>
<?php echo vmText::_ ('COM_VIRTUEMART_CART_TOSTWO_READ_AND_ACCEPTED') ?>
</a>
Thank you.
Wim
remove the target="_blank" ?
No. (I had already tried that ;) )
I don't Think the url is important for the popup to work.
The link is.
To show articles I decided to use Articles Anywhere.
In tos.php and tos2.php I changed lines 49-50 from
<h2><?php echo vmText::_ ('COM_VIRTUEMART_CART_TOS') ?></h2>
<?php echo $cart->vendor->vendor_terms_of_service ?>
to
{article id="123"}[text]{/article}
For tos.php my issue is now solved.
However tos2.php still does not popup.And I believe that (part of) the issue lies in line 48 in tos2.php
<div id="full-tos">
1. When both tos and tos2 are displayed on the same page there are 2 id="full-tos", which is incorrect. (ids need to be unique)
2. When I change that line to id="full-tos2" the container is no longer hidden. (#full-tos has an inline style="display:none;", #full-tos2 does not).
I feel that there is some code missing for tos2...
Regards,
Wim
PS...
When tos2.php is displayed in account maintenance (view-user taak-editaddresscart) #full-tos is not hidden either...
I do get a popup, but it displays the message
QuoteThe requested content cannot be loaded.
Please try again later.
PS2...
When tos.php is displayed in account maintenance #full-tos (of tos2)
is (also) hidden...
Is only one tos in core VM.
Your code for tos2 is only your custom, then you have to find your custom solutions:
- wait if someone write the right code there
- hire developer
Is not bug or mistake in VM.
We use two tos in one page, then I paid our developer to develop for me.
I'm sorry, but there is a tos2 in core VM.
/components/com_virtuemart/sublayouts/tos2.php
And from what I have read on the forum tos2.php can be used to add an extra checkbox on the cart for i.e. privacy consent.
http://forum.virtuemart.net/index.php?topic=139105.msg488736#msg488736
http://forum.virtuemart.net/index.php?topic=139004.0
Regards,
Wim
ok, thanks for info :)
if it should be an popup use the following code in row 15 in tos2.php:
?>
<script id="box-js2" type="text/javascript" >//<![CDATA[
jQuery(document).ready(function($) {
$('div#full-tos2').hide();
var con = $('div#full-tos2').html();
$('a#terms-of-service2').click(function(event) {
event.preventDefault();
$.fancybox ({ div: '#full-tos2', content: con });
});
}); //]]>
</script>
<?php
and if it should be the vendor legal info you must change row 62 to:
<?php echo $cart->vendor->vendor_legal_info ?>
for me it's an bug whats never beenworked on.the Script in the orignal version is not loading...