Author Topic: Open articles for tos and tos2 in popup  (Read 2306 times)

iWim

  • Jr. Member
  • **
  • Posts: 81
Open articles for tos and tos2 in popup
« on: April 13, 2021, 11:36:44 AM »
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
Code: [Select]
<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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10878
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.8.8
Re: Open articles for tos and tos2 in popup
« Reply #1 on: April 17, 2021, 21:51:37 PM »
remove the target="_blank"  ?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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

  • Jr. Member
  • **
  • Posts: 81
Re: Open articles for tos and tos2 in popup
« Reply #2 on: April 18, 2021, 12:30:42 PM »
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
Code: [Select]
<h2><?php echo vmText::('COM_VIRTUEMART_CART_TOS'?></h2>
<?php echo $cart->vendor->vendor_terms_of_service ?>
to
Code: [Select]
{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
Code: [Select]
<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
Quote
The 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

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1707
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Open articles for tos and tos2 in popup
« Reply #3 on: April 18, 2021, 13:19:55 PM »
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

  • Jr. Member
  • **
  • Posts: 81
Re: Open articles for tos and tos2 in popup
« Reply #4 on: April 18, 2021, 16:09:27 PM »
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

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1707
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Open articles for tos and tos2 in popup
« Reply #5 on: April 19, 2021, 14:03:23 PM »
ok, thanks for info :)
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