Jump to content
De Dokta

Modal Info Popup Layer for osc 2.3.4BS

Recommended Posts

Hi all,

 

Thank you for this great addon, I really needed an addon like this and it works good on my shop.

 

I just have a little request. When we add a product to the cart, the page refreshes first, and then the modal cart shows. Is there a way to avoid this refreshing ? The modal cart takes too long to appear.

Share this post


Link to post
Share on other sites

Just a warning that Google will now demote mobile pages in their search results which have an interstitial (popup), so it's not advisable to use this addon out of the box.

 

It is advised to alter this code using css/javascript/php so that it will hide interstitials on mobile responsive pages.

 

 


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

It's a modal CART, Google and other bots don't have to use cart, no ?


Get the latest Responsive osCommerce CE (community edition) here .

(Live   : OsC 2.2, php 5.4 & UTF-8  |  Local : OsC 234BS php7.2 Edge for future shop)

Share this post


Link to post
Share on other sites

It's a modal CART, Google and other bots don't have to use cart, no ?

 

Correct bonbec, that type of popup is safe. It is only interstitial type popups which are affected.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

I find the wording very interesting and is very specific about popups directly after coming from a search result.


I have a popup but it only shows on a second page load. In other words I don't ask for a sign-up as soon as a user arrives (which I think is very annoying) but rather  after the second or sometimes 3rd page load. Also the popup is very easy to dismiss.


 


"Showing a popup that covers the main content, either immediately after the user navigates to a page from the search results, or while they are looking through the page."


Share this post


Link to post
Share on other sites

@@douglaswalker Second and subsequent page popups are fine too Doug.


Let's make things easier for new osCommerce users http://forums.oscommerce.com/topic/402638-discussion-about-hard-coded-database-tables/?p=1718900  Getting there with osCommerce 2.4! :thumbsup:

Share this post


Link to post
Share on other sites

Hello, I'm trying to using this addon in the latest oscommerce 234 bootstrap (version 18 April 2017). It's seems to work but i'd like to respect the Google's rules about hide interstitials on mobile responsive pages.

Can anyone help me? I'm not a programmer, what do you think we can use to hide interstitials on mobile? @@media queries???

 

these are the only 2 files changed to work on the latest version

 

includes\modules\content\footer\cm_footer_popup.php

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

  class cm_footer_popup {
    var $code;
    var $group;
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

    function cm_footer_popup() {
      $this->code = get_class($this);
      $this->group = basename(dirname(__FILE__));

      $this->title = MODULE_CONTENT_FOOTER_POPUP_TITLE;
      $this->description = MODULE_CONTENT_FOOTER_POPUP_DESCRIPTION;

      if ( defined('MODULE_CONTENT_FOOTER_POPUP_STATUS') ) {
        $this->sort_order = MODULE_CONTENT_FOOTER_POPUP_SORT_ORDER;
        $this->enabled = (MODULE_CONTENT_FOOTER_POPUP_STATUS == 'true');
      }
    }

    function execute() {
      global $oscTemplate, $languages_id, $popups_id;

   $schedule_query = tep_db_query("select popups_id, expires_date, date_scheduled,status from popups");
    if (tep_db_num_rows($schedule_query)) {
      while ($schedule = tep_db_fetch_array($schedule_query)) {
        if (($schedule['status'] == '1') && tep_not_null($schedule['expires_date']) && (date('Y-m-d H:i:s') >= $schedule['expires_date'])) {
      tep_db_query("update popups set status = '0', date_status_change = now(), expires_date = NULL where popups_id = '" . (int)$schedule['popups_id'] . "'");
       }elseif (($schedule['status'] == '0') && tep_not_null($schedule['date_scheduled']) && (date('Y-m-d H:i:s') >= $schedule['date_scheduled'])) {
       tep_db_query("update popups set status = 1, date_status_change = now(), date_scheduled = NULL where popups_id = '" . (int)$schedule['popups_id'] . "'");
           } 
          }
      $popup_query = tep_db_query("select po.popups_id, pod.popups_id, pod.language_id, po.popups_title, po.popups_image, pod.popups_html_text from popups po, popups_description pod where status = '1' and po.popups_id = pod.popups_id and pod.language_id = '" . (int)$languages_id . "'");
          if (tep_db_num_rows($popup_query)) {
          $popup = tep_db_fetch_array($popup_query);

    if (tep_not_null($popup['popups_html_text'])) {
      $popup_html = $popup['popups_html_text'];
    } else {
      $popup_html = '';
      }
    if (tep_not_null($popup['popups_image'])) {
      $popup_image = tep_image('images/' . $popup['popups_image'], $popup['popups_title']) .'<br />';
    } else {
      $popup_image = '';
      }  
      $popup_string =  $popup_image . $popup_html;
    
      ob_start();
      include('includes/modules/content/' . $this->group . '/templates/popup.php');
	  $template = ob_get_clean();

      $oscTemplate->addContent($template, $this->group);
      }
     }
    } 

    function isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('MODULE_CONTENT_FOOTER_POPUP_STATUS');
    }

    function install() {
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Message Popup Footer Module', 'MODULE_CONTENT_FOOTER_POPUP_STATUS', 'true', 'Do you want to enable the Message popup content module?', '6', '1', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_FOOTER_POPUP_SORT_ORDER', '999', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");

    tep_db_query("drop table if exists popups;");
    tep_db_query("create table popups (popups_id int(11) not null auto_increment, popups_title varchar(64) not null,  popups_image varchar(64) not null, expires_date datetime, date_scheduled datetime, date_added datetime not null,  date_status_change datetime,status int(1) default '1' not null,PRIMARY KEY (popups_id))");
    tep_db_query("drop table if exists popups_description;");
    tep_db_query("create table popups_description (popups_id int(11) not null,language_id int(11) default '1' not null,popups_html_text text)");
    }

    function remove() {
      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
      tep_db_query("drop table if exists popups;");
      tep_db_query("drop table if exists popups_description;");
    }

    function keys() {
      return array('MODULE_CONTENT_FOOTER_POPUP_STATUS', 'MODULE_CONTENT_FOOTER_POPUP_SORT_ORDER');
    }
   }

includes\modules\content\footer\templates\popup.php

<?php

if (($_SERVER['HTTPS'] !== 'on') && (!tep_session_is_registered('popup'))) { ?>

  
<script src="ext/jquery/jquery-2.2.3.min.js"></script>

  
<div class="modal fade" id="popupModal">  
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
      </div>
<div class="modal-body">
      <center><h5><?php echo $popup_string; ?></h5></center>
     </div>
        <div class="modal-footer">
        <button type="button" class="btn btn-default pull-right" data-dismiss="modal"> <?php echo IMAGE_BUTTON_CONTINUE;?> <span class="glyphicon glyphicon-chevron-right"></span></button>
        </div>
      </div>
     </div>
    </div>
	
<script type="text/javascript">
$(window).load(function(){$('#popupModal').modal('show');});
</script>


<?php
tep_session_register('popup');
  }
?>

Any help is appreciate.

Marco

Share this post


Link to post
Share on other sites
On 28/11/2016 at 9:51 AM, grandpaj said:

 

Did you  ever get this sorted. I also now run site full SSL but modal doesn't work.

 

Cheers

 

Grandpa

Hi, as you asked the question, did you find an answer, as I too run a shop with full SSL?

regards

Mike


osC BS gold live - osC CE in development (awesome)

Share this post


Link to post
Share on other sites

@grandpaj

i just tried the following change and it seemed to fix the problem

in file includes/module/content/footertemplates/popup.php

find :

if (($_SERVER['HTTPS'] !== 'on') && (!tep_session_is_registered('popup')))    { ?>

replace with :
if ((!tep_session_is_registered('popup'))) { ?>

That works I hope

Mike


osC BS gold live - osC CE in development (awesome)

Share this post


Link to post
Share on other sites

Hello friends,

Just try this module in the Spanish version of @raiwa and it seems it does not work.

I do not see the a new entry: Popup Manager after uploading all the files according to the instructions.

someone tried it?

Best regards

Valqui


Running Old EDGE, setting up Frozen and playing with Phoenix !

Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

Hi all,

The installation instructions are incomplete. You have to install content module and just there the Popup Manager menu appears in the admin.

Could someone upload a new package with the correct installation instructions? I do not know how to do it :(

Now I creat the baner but I do not see it.

any ideas?

Best regards

Valqui


Running Old EDGE, setting up Frozen and playing with Phoenix !

Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

 

@raiwa @frankl @grandpaj @bonbec

Could someone try this addon lately on EDGE version 22/02/2018 ?

The installation instructions are incomplete. You have to install content module and just there the Popup Manager menu appears in the admin.

Could someone upload a new package with the correct installation instructions? I do not know how to do it :(

Best regards

Valqui


Running Old EDGE, setting up Frozen and playing with Phoenix !

Community Oscommerce fan :heart:

 

Share this post


Link to post
Share on other sites

I am sorry Valqui, I don't use this addon but another for my modal cart on an EDGE version of 2017.

This addon don't appears on the module section after install ?


Get the latest Responsive osCommerce CE (community edition) here .

(Live   : OsC 2.2, php 5.4 & UTF-8  |  Local : OsC 234BS php7.2 Edge for future shop)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×