News:

Support the VirtueMart project and become a member

Main Menu

Open articles for tos and tos2 in popup

Started by iWim, April 13, 2021, 11:36:44 AM

Previous topic - Next topic

iWim

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

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

iWim

#2
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...

pinochico

#3
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.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

iWim

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

pinochico

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Otto0815

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...