Jump to content

vmn

Members
  • Content count

    89
  • Joined

  • Last visited

Profile Information

  • Real Name
    Veli-Matti
  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Should the link to 4.0.1 be https://apps.oscommerce.com/gBmPX&purchase-without-account-phoenix
  2. I could not figure out how to make the #3 change in the ht module. The account block has no id and my jquery knowledge is limited. I keep my change. I'ts so simple. I've got another, too. I hide the create account link, if the shopping cart is empty. Actually, I hide create account links everywhere, if the cart is empty. This may prevent fake accounts.
  3. You are welcome! #2: The original text "Thank You, I do not wish to keep my customer data stored, please delete my customer data." is not strictly true, because at least order processing data remains. I admit, guest accounts hanging around is not a big problem, especially after adding the missing deletes. #3. Good point. I review the ht module.
  4. Ok. It may take a while before I upgrade to Phoenix.
  5. Im using your addon PWA for BS 3.0.4 in Osc 2.3.4.1CE Quite often guests just close the browser on checkout success page without clicking the continue button. This may leave orphan rows in customers, address_book, customers_info, customers_basket and customers_basket_attributes tables. 1. If a new guest account is created with the same email as an old one, the old guest is removed from customers and address_book tables, but not from customers_info, customers_basket and customers_basket_attributes tables. In the latter tables the previous guest row remains and a row for the new guest is created. In account_pwa.php find $check_guest = tep_db_fetch_array($check_guest_query); if ( tep_not_null($check_guest) ) { tep_db_query("delete from customers where customers_id = '". $check_guest['customers_id'] . "' and customers_guest = '1'"); tep_db_query("delete from address_book where customers_id = '". $check_guest['customers_id'] . "' and customers_guest = '1'"); } insert after the second delete //VMN2019.11.23 delete also these tep_db_query("delete from customers_info where customers_info_id = '". $check_guest['customers_id'] ."'"); tep_db_query("delete from customers_basket where customers_id = '". $check_guest['customers_id'] ."'"); tep_db_query("delete from customers_basket_attributes where customers_id = '". $check_guest['customers_id'] ."'"); 2. I decided to add a remainder to always click "Continue" (this may help reducing zombies): in includes/languages/english/modules/content/checkout_success/cm_cs_pwa_keep_account.php find define('MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_TEXT_DELETE_ACCOUNT', '<strong>Thank You, I do not wish to keep my customer data stored, please delete my customer data.</strong>'); replace with define('MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_TEXT_DELETE_ACCOUNT', '<strong>Thank You, I do not wish to keep my customer data stored, other than necessary to process the order.</strong><br><br><div class="alert alert-danger">Please always click the "Continue" button before closing the browser or leaving this page.</div>'); 3. I also decided to hide the account navbar block for guests, because it may be a bit confusing to them, e.g. there is no order history for them. in includes/modules/navbar_modules/nb_account.php find the isEnabled function and replace it with: function isEnabled() { //VMN2019.11.24 hide account block for guests if (!tep_session_is_registered('customer_is_guest')) { return $this->enabled; } else { return false; } } Any comments?
  6. vmn

    Google XML Sitemap SEO

    I could not get the running from command-line to work without the following changes. My catalog resides in a sub-folder where I also wanted to put the sitemap. I'm redirecting all traffic pointing to document root to a sub-folder called portal. The direcotry structure is: / /portal /shop Maybe this is why it did not work. in index.php after include_once('includes/application_top.php'); insert $run_env = php_sapi_name(); echo 'Environment:' . $run_env . "\n"; if ($run_env === 'cli' || $run_env === 'cgi-fcgi') { //DO NOT CHECK IP } else { if (! empty(GOOGLE_XML_SITEMAP_SECURE_IP)) { $safe_ips = explode(',', GOOGLE_XML_SITEMAP_SECURE_IP); if (! in_array($_SERVER['REMOTE_ADDR'], $safe_ips)) { header("location:http:127.0.0.1"); } } } after echo 'For your convenience here is the <strong>CRON command</strong> for your site:' . "\n\n"; replace echo "\t" . '<strong>php ' . dirname($_SERVER['SCRIPT_FILENAME']) . '/index.php</strong>' . "\n\n"; with echo "\t" . '<strong>php ' . __FILE__ . '</strong>' . "\n\n"; in sitemap.class.php before $this->base_url = $domain_name; add $run_env = php_sapi_name(); if ($run_env === 'cli' || $run_env === 'cgi-fcgi') { if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'this->savepath:' . $this->savepath . "\n"; $temp = getcwd(); $temp .= (substr($temp, -1) !== '/') ? '/' : ''; //append a slash if needed if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'temp:' . $temp . "\n"; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'DIR_FS_CATALOG:' . DIR_FS_CATALOG . "\n"; $this->savepath = substr($temp, 0, strpos($temp, DIR_FS_CATALOG)) . $this->savepath; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'this->savepath:' . $this->savepath . "\n"; } I noticed that categories are retrieved multiple times (in all shop languages): find $sql = "SELECT c.categories_id as cID, c.date_added, c.last_modified as last_mod replace $sql = "SELECT distinct c.categories_id as cID, c.date_added, c.last_modified as last_mod after $path = (($pos = strpos(DIR_FS_CATALOG, "googlesitemap")) !== FALSE) ? substr(DIR_FS_CATALOG, 0, -strlen('googlesitemap') - $slash) : DIR_FS_CATALOG; insert $run_env = php_sapi_name(); if ($run_env === 'cli' || $run_env === 'cgi-fcgi') { if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'path:' . $path . "\n"; $temp = getcwd(); $temp .= (substr($temp, -1) !== '/') ? '/' : ''; //append a slash if needed if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'temp:' . $temp . "\n"; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'DIR_FS_CATALOG:' . DIR_FS_CATALOG . "\n"; $path = substr($temp, 0, strpos($temp, DIR_FS_CATALOG)) . $path; if (GOOGLE_XML_SITEMAP_SHOW_DIAGNOSTIC == 'true') echo 'path:' . $path . "\n"; } There is some unnecessary stuff, e.g.: class MySQL_DataBase (because DB handling is done in the core). I removed all usage of the class MySQL_DataBase.
  7. vmn

    Google XML Sitemap SEO

    Thanks, GOOGLE_XML_SITEMAP_SECURE_IP is working now.
  8. vmn

    Google XML Sitemap SEO

    I could not find any reference to GOOGLE_XML_SITEMAP_SECURE_IP in the code.
  9. vmn

    Google XML Sitemap SEO

    I just started using this addon in my v2.3.4.1 CE. I noticed that anybody knowing the name of googlesitemap directory can run the sitemap creation. This may not be harmful, but the result page revealed my full Cpanel path, including my user id. I first renamed the directory. This also required some code changes, which I made. I also protected the directory with .htaccess: Require ip my.server.ip Require forward-dns my.dynamic.vpn.adddress This code seems to have no effect, whether it is in application_top.php or not: /**** Begin Google Sitemap Manual Run ****/ if (strpos(GOOGLE_XML_SITEMAP_MANUAL_IP, $_SERVER['REMOTE_ADDR']) !== FALSE) { $future_date = strtotime('+' . GOOGLE_XML_SITEMAP_MANUAL_RUN . ' day'); if ($future_date <= date('Y-m-d')) { tep_redirect(HTTP_SERVER . DIR_WS_HTTPS_CATALOG . 'googlesitemap/index.php'); // } } /**** End Google Sitemap Manual Run ****/ Did I miss something?
  10. vmn

    Store Mode BS

    Hi, I noticed that my fix for commenting out the ExpiresDefault line in .htaccess does not check whether the line is already commented out. This happens if I switch between offline and offline-test without switching to online in between. Also someone may have intentionally commented it out. So, in includes/modules/header_tags/ht_store_mode.php: find: $file = preg_replace('@ExpiresDefault@','#ExpiresDefault',$file); //VMN replace the line with: //Is ExpiresDefault already commented out by us? //VMN if ( strpos($file, '#Store Mode comment:ExpiresDefault') === false ) { //VMN $file = preg_replace('@ExpiresDefault@','#Store Mode comment:ExpiresDefault',$file); //VMN } //VMN find: $file = preg_replace('@#ExpiresDefault@','ExpiresDefault',$file); //VMN replace the line with: $file = preg_replace('@#Store Mode comment:ExpiresDefault@','ExpiresDefault',$file); //VMN
  11. I found a quite elegant way to tailor/translate the message. I added this code at the end of template.top, after footer.php: <script> $("input[required], select[required]").on('change', function() { this.setCustomValidity(""); }); $("input[required], select[required]").on('invalid', function() { this.setCustomValidity("<?php echo FORM_INPUT_VALUE_MISSING; ?>"); }); </script> Define the constant in includes/languages/english.php: define('FORM_INPUT_VALUE_MISSING','This value is required'); and includes/languages/yourlanguage.php e.g. in finnish.php define('FORM_INPUT_VALUE_MISSING','Tämä on pakollinen tieto'); I've tested this in Windows 10 Chrome and Firefox, and in Android Firefox and Brave.
  12. vmn

    Store Mode BS

    Works for me, too.
  13. vmn

    Store Mode BS

    I forgot to point out, that I only plan to use and have tested the "offline" mode. I use a local environment to develop and test my changes. "Logoff customers Do you want to logoff customers? Applies on all modes except online." This does not apply to "offline" mode. After noticing the above, I also wanted to clarify what happens, if a customer has a non-empty shopping cart, in case of maintenance. This is my new maintenance message text: define('TEXT_MAINTENANCE_MESSAGE_ENGLISH', 'We are currently maintaining the Web Shop.<br><br>We apologize for any inconvenience this may cause.<br><br><strong>If your shopping cart was not empty, it will be preserved as follows</strong>:<ul style="text-align:left"><li>logged in customers:<strong> always</strong> (even if you close your browser)</li><li>others: <strong>unless</strong> you close your browser</li></ul>'); I checked the html source with W3C Markup Validation Service (https://validator.w3.org/). Based on the results I made the following changes in maintenance.php: -after header("Retry-After: 3600"); -added header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); -replaced <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> -with <!DOCTYPE html> -removed <meta http-equiv="Cache-Control" content="no-cache"> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <meta name="HandheldFriendly" content="true"> I tested the offline mode with my Android phone. No problems with scaling down the output. -replaced <style type="text/css"> -with <style> Buttons without a form: -replaced <form> <input type="button" class="button" value="Continue" onclick="window.location.href='<?php echo dirname($_SERVER["REQUEST_URI"])."/index.php?language=en";?>'" /> </form> -with <button class="button" onclick="window.location.href='<?php echo dirname($_SERVER["REQUEST_URI"])."/index.php?language=en";?>'">Continue</button>
  14. vmn

    Store Mode BS

    Sorry for the delay. I updated to 1.2.1. Looks good, thanks.
  15. vmn

    Store Mode BS

    Thanks @raiwa. Please find below my answers to your comments. If one knows how this addon works, it may be possible to view htaccess backups by accessing them directly. This only applies to php files. <Files *.php> Order Deny,Allow Deny from all </Files> So, I prefer Require ip <allowed ip's> .htaccess RewriteRule is using 302. 302 = Found 307 = Temporary Redirect I prefer 307. What's the point of hiding the backtime information, if it's empty?
×