Jump to content
BrockleyJohn

[Addon] Store Times BS

Recommended Posts

11 minutes ago, YePix said:

that's how you do it

No, not really.
you could report an issue on the github repository, even could offer the bug fix.
Regardless if the repository owner accept your fix or not.... a link to your issue would have done the job.

( i encourage you to experiment , i know you have the potential............ i checked your work on the german CLUB, i speak and read ( mwa.... not really) fluent german..... i am 50% german).

Good Luck!!!!!!
PS:  i made the concept for the takeaway (pizzapizza) concept in laravel......... for multi-stores.
( if you are serious and have a range of potential cliënts......... we might can set up something in that area).

Edited by fridgebox

- ICECAT specialist.
(Icecat: open feed with product information, data-sheets for oscommerce.)
- CSV IMPORT specialist.
(manage your suppliers via supplier manager)
Contact me via PM.

Share this post


Link to post
Share on other sites

open the file "ht_store_times.php" in: catalog/includes/modules/header_tags/ folder

and search for the following code:

      if (defined('MOD_CON_HDR_STORE_TIMES_DIVERT_PAGES') && MOD_CON_HDR_STORE_TIMES_DIVERT_PAGES == 'True') {
        if (tep_not_null(MOD_CON_HDR_STORE_TIMES_CLOSE_PAGES)) {
          $pages_array = array();

          foreach (explode(';', MOD_CON_HDR_STORE_TIMES_CLOSE_PAGES) as $page) {
            $page = trim($page);

            if (!empty($page)) {
              $pages_array[] = $page;
            }
          }
        
          if (in_array(basename($PHP_SELF), $pages_array)) {
		        $store_status = sew_is_store_open();
            if ($store_status <> 'open' && $store_status <> 'open-override') tep_redirect('store_times.php');
          }
        }
      }
		}

replace this code with:

if (MODULE_CONTENT_HEADER_STORE_TIMES_STATUS == 'True') {  // new code for close the header_tags redirect
      if (defined('MOD_CON_HDR_STORE_TIMES_DIVERT_PAGES') && MOD_CON_HDR_STORE_TIMES_DIVERT_PAGES == 'True') {
        if (tep_not_null(MOD_CON_HDR_STORE_TIMES_CLOSE_PAGES)) {
          $pages_array = array();

          foreach (explode(';', MOD_CON_HDR_STORE_TIMES_CLOSE_PAGES) as $page) {
            $page = trim($page);

            if (!empty($page)) {
              $pages_array[] = $page;
            }
          }
        
          if (in_array(basename($PHP_SELF), $pages_array)) {
		        $store_status = sew_is_store_open();
            if ($store_status <> 'open' && $store_status <> 'open-override') tep_redirect('store_times.php');
          }
        }
      }
		}
} // new code for close the header_tags redirect

 

Edited by YePix

Share this post


Link to post
Share on other sites
19 minutes ago, YePix said:

what is so difficult to understand? did you install the addon "store times"?

not matter if i install it or not.

The module creator ( even that he does it wrong on github), took the effort to commit his code , with the option for YOU and ME and OTHERS to correct HIS code on GITHUB.
You ( as i assume you take yourself serious), should learn to use the correct channels for that.
you could have created an issue for it on there, when you made the issue, a link to the issue would be sufficient to know and understand and find out what the issue is, now it is just a fix in the dark. it only is here on the forum, yet your fix MUST be in the original code, for that GITHUB is a good place. ( do not be offended, i just try to learn you):
screenshot-github.com-2019_09.11-01_46_22.thumb.png.2aff5f674076d564a3b0ae1efeccb414.png


- ICECAT specialist.
(Icecat: open feed with product information, data-sheets for oscommerce.)
- CSV IMPORT specialist.
(manage your suppliers via supplier manager)
Contact me via PM.

Share this post


Link to post
Share on other sites

let it be good. Here is the forum and the corresponding posting to the addon. Everyone interested in this post has read and decides for yourself whether it will be used or not. here is oscommerce and not github. end of this discussion.

Share this post


Link to post
Share on other sites
3 minutes ago, YePix said:

et it be good. Here is the forum and the corresponding posting to the addon. Everyone interested in this post has read and decides for yourself whether it will be used or not. here is oscommerce and not github. end of this discussion.

NOPE not so EASY my friend , here you have the option to show your commitment, it's not that easy to paste a fix here in the forum if you are so RIGHT about it......... put it here 🙂 i told you i teach you.......... now do it the right way....... show your commitment........... your words............. not github............. oscommerce.............. here it is)
image.thumb.png.f553110e1ecb37bcd427c8a9bc14024f.png


- ICECAT specialist.
(Icecat: open feed with product information, data-sheets for oscommerce.)
- CSV IMPORT specialist.
(manage your suppliers via supplier manager)
Contact me via PM.

Share this post


Link to post
Share on other sites

can confirm that this one works with Phoenix


Quo plus habent, eo plus cupiunt

Share this post


Link to post
Share on other sites

Hi!,

I think this piece of code are useless:

catalog/includes/modules/content/header/cm_header_store_times.php

  function install($parameter = null) {
    // check for installation settings of addon 8044 Store Closed and use if present
		if (file_exists(DIR_FS_CATALOG . 'includes/opencloz.php')){
      if (!defined('DIR_WS_INCLUDES')) define('DIR_WS_INCLUDES','../includes/');
			include_once( DIR_FS_CATALOG . 'includes/opencloz.php');
			initialize_open_cloze();
		}
		$params = $this->getParams();

This line?

      if (!defined('DIR_WS_INCLUDES')) define('DIR_WS_INCLUDES','../includes/');

 

Share this post


Link to post
Share on other sites

backwards compatibility with the settings of an old addon (but not with bs gold by the look of it)


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

What is meant by this line?

include_once( DIR_FS_CATALOG . 'includes/opencloz.php');
initialize_open_cloze();

 

Share this post


Link to post
Share on other sites
5 hours ago, YePix said:

include_once( DIR_FS_CATALOG . 'includes/opencloz.php'); initialize_open_cloze();

There are two lines. The first one is telling the code to load in a file named opencloz.php That file will most contain a function which the second line is executing.

Share this post


Link to post
Share on other sites
Am 6.9.2021 um 15:28 schrieb Jack_mcs:

There are two lines. The first one is telling the code to load in a file named opencloz.php That file will most contain a function which the second line is executing. 

Hi, that's already clear. However, this file does not exist with the add-on

Share this post


Link to post
Share on other sites
1 hour ago, YePix said:

Hi, that's already clear. However, this file does not exist with the add-on

You asked what the code meant, which is what I answered. If the file is missing, that is an issue with the addon. I can't help with that. But some addons get uploaded as partial changes so if there is an earlier version you may want to check it to see if the file is there. If not, maybe someone else knows the answer. If this addon is no longer supported or you can't find the answer, you might want to look at the Store Mode addon.

Share this post


Link to post
Share on other sites

@YePix

5 hours ago, YePix said:

Hi, that's already clear. However, this file does not exist with the add-on

 

@BrockleyJohn already answered this here:

On 3/30/2020 at 5:16 AM, BrockleyJohn said:

backwards compatibility with the settings of an old addon (but not with bs gold by the look of it)

 

But, to further clarify, let's look at the code snippet that PiLLaO posted (I have numbered the lines for clarity) ...

On 3/30/2020 at 4:01 AM, PiLLaO said:

 


1)  function install($parameter = null) {
2)    // check for installation settings of addon 8044 Store Closed and use if present
3)		if (file_exists(DIR_FS_CATALOG . 'includes/opencloz.php')){
4)      if (!defined('DIR_WS_INCLUDES')) define('DIR_WS_INCLUDES','../includes/');
5)			include_once( DIR_FS_CATALOG . 'includes/opencloz.php');
6)			initialize_open_cloze();
7)		}
8)		$params = $this->getParams();

 

The comment on line 2 states that it is checking to see if addon # 8044, "Store Closed", is installed. If I read this correctly, this is a *different* addon than the "Store Times BS" addon, and that the "Store Times BS" addon can work WITH the "Store Closed" addon (if installed).

Line 3 uses an IF statement to check to see if the file exists. I read this as that the file in question is from the "Store Closed" addon, *not* the "Store Times BS" addon (which is why this code is checking to see if it exists).

*IF* the file exists (ie: the "Store Closed" addon *is* installed), line 5 does an 'include_once' to load that file. If the file does not exist, the IF statement won't find it (right?), and will skip over the 'include_once' command.

Now, I have not downloaded the "Store Closed" addon to see if the file in questions is actually in that bundle.

HTH

Malcolm

Share this post


Link to post
Share on other sites

The stuff you are discussing is in the installation routine for this addon.

There is (potentially) a lot of setup involved in configuring all the store times when you first want to use the addon.

The previous addon 8044 worked with much older versions of oscommerce and was not compatible with the boostrap ce versions. It held the store times in a text file and not in the configuration settings.

This addon is a replacement of the old addon (commissioned by someone upgrading an old site). The installation checks to see if the old addon settings file was present on the site and copies the store times into the settings for the new addon.

That is all. Having the old addon is not required to run or install the new one.

This is mentioned in the documentation but I didn't think it needed labouring:

- On installation, picks up opening times and holidays from addon 8044 Store Open/Closed if available


Contact me for work on updating existing stores - whether to Phoenix or the new osC when it's released.

Looking for a payment or shipping module? Maybe I've already done it.

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

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

×