cre loaded – how to update from version 6.4.0 to version 6.4.1

This process is best described as ‘updating’ and I’d only recommend doing this between minor versions in sequence – eg 6.3.1 -> 6.3.2, or 6.4.0 -> 6.4.1. If you’re going to jump from 6.3.x to 6.4.x I’d recommend reading up on how to upgrade between major versions.

‘Updating’ means:

  • your store’s current database gets updated by any changes in the update update patch for the database
  • you manually overwrite your old store’s files and folders using the folders/files from the update
  • you don’t have to create a new blank database or change permissions on folders/files

Sounds straight forward? Should be, but the 6.4.0 -> 6.4.1 update isn’t for some.
Here are the steps I used:

Step 1: make sure you download and extract the correct update to your computer (this is a Pro version update example)

choose the correct cre loaded update example pro version

After extracting the contents from the patch itself, you should have catalog.zip and a pdf Guide to Installation. Delete this guide as nothing in it applies to Updating, only Upgrading. Instead go to the Cre Loaded site and scan the only information they give on the Updating process: Here is Cre Loaded’s official document on updating.

Step 2: backup your current database and store
There are a couple of reasons for doing this – the obvious (if you stuff up the update, you’ve still got the original files) but also if you have a modified site you may lose some or all of these modifications in the update (so you’ll need your originals to get back on track.)

Step 3: upload and overwrite your store’s folders and files as per the update

Step 4: type the url to your store with /upgrade on the end – eg www.mystore.com/upgrade

This will bring up the update page – confusingly called the ‘Upgrade Wizard’ with blah about versions 6.2 and 6.3 and no mention of 6.4.0.

cre loaded update upgrade screen

Once you click the big blue Update button you might be lucky and get this:

You have successfully updated your Cre Loaded database

… or like me, you’ll get this ominous screen of fail:

cre loaded configuration files error on update

Why the ‘Existing configuration files cannot be accessed’ message? Because when Cre wrote the upgrade scripts, they assumed that everyone’s Admin folder is called, well, ‘Admin.’ But if you’ve decided to make hackers work a little harder and renamed your store’s Admin folder to something other than ‘Admin’, this is why you’re seeing this error.

How to fix this: here’s the top part of the script that is at fault:

/upgrade/templates/pages/upgrade.php


                

The lines you need to edit are 29, 30 and 34, replacing the word ‘youradminfolder’ with the actual name of your admin folder.
Try Step 4 again and your database should be successfully updated.

Maybe next time Cre will create a better updater … please.

add currency dropdown to menu bar

If you run an e-commerce website that accepts multiple currencies, then customers will appreciate being able to change currencies quickly.

currency dropdown added to cre63_ats template

This modification adds a currency dropdown to a menu bar (part of the cre63_ats template for Cre Loaded), however it will work for all osCommerce-based carts with minor tweaks.

            
    currencies);
                   $currencies_array = array();
                   while (list($key, $value) = each($currencies->currencies)) {
                  $currencies_array[] = array('id' => $key, 'text' => $value['title']);
                }
                  $hidden_get_variables = '';
                  reset($_GET);
                  while (list($key, $value) = each($_GET)) {
                  if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y') ) {
                  $hidden_get_variables .= tep_draw_hidden_field($key, $value);
                }
              }
            }
                  echo tep_draw_form('currencies', tep_href_link(basename($PHP_SELF), '', $request_type, false), 'get');
                  echo tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();"') . $hidden_get_variables . tep_hide_session_id();
                  echo '';
    ?>

Disable any ‘Switch to Default Language Currency’ setting you may have enabled in your Configuration panel.

sitemonitor

This free to download version of SiteMonitor is based on a contribution written by Jack_mcs and modified by pyramids for cre loaded in 2006. This version updated April 2011.

What it does:
SiteMonitor emails you any changes to the files and folders you specify to monitor. It compares various file details with a reference file created at installation and if the current file details don’t match the reference, off goes the email to you. After creating the reference file, SM is best run as a cronjob daily.

How it works:
SM takes a snapshot (reference.txt) of files and folders specified by you and compares this to the current details of your files and folders.
SM watches for -

  • any new files to monitored folders
  • any deletions
  • any changes in file size
  • any changes in permission settings
  • any time stamp mismatches (so watching for file changes even if size kept the same)

SM can also be used to journal changes you make to your own website, as it writes all details to log.txt.

This version:
This version of SiteMonitor does not have the Admin interface of the original contribution by jack_mcs, which means you must hardcode the settings in the SM file first before running it. However the advantage here is that there is only 1 file to deal with – all of the functions etc have been combined into one script.

SM is also ideally run as a cronjob (an automated server process that you set and forget.)

The downloadable .zip (37KB) contains:

  1. sitemonitor files in their directory structure (the main programme)
  2. SM_instructions.txt (a short list of instructions, plus example reference file, log file, and email message)
  3. Version Checker (so you can keep up-to-date with new releases)

Fill out your name, email address to receive an email with the download link (37KB, zip file):
[lab_subscriber_download_form download_id=4]

admin security issue (2009) – all oscommerce-based carts

A security loophole was discovered mid-2009 in the Admin code whereby a hacker could manipulate the admin page url to bypass the login / password function. It affected osCommerce and all derivatives of it – Cre Loaded, oscMax etc. Cre Loaded version 6.4.0a applied this patch – if you are running versions prior to 6.4.0a then you should definitely keep reading.

Files to check:
admin/includes/application_top.php around line 56
/includes/application_top.php around line 46

The two lines of code that should be replaced may both occur in each file depending on your version.

This code should be replaced asap (ie bad):

$PHP_SELF = (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] :
$_SERVER['SCRIPT_NAME']);

and / or

$PHP_SELF = (isset($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_SERVER_VARS['SCRIPT_NAME']);

This code is the replacement (ie good):

$PHP_SELF = $_SERVER['SCRIPT_NAME'];

One simple change to the code – no need to pay to get this done!

free smooth javascript scroller for the bestsellers scroll infobox

The HTML ‘marquee’ tag is used to make the product images scroll vertically in the bestsellers_scroll infobox. It works, but creates a choppy display (as this horizontal example of the tag shows):

Hello! This is an example of a horizontal marquee plus image marquee scroll effect using wordpress icon

—————————————————————————————————————

The following code is for a vertical scroll effect that is much smoother. There are some user editable settings in the jscript file defining delay, speed and mouse over actions. Colours are set in the #marqueecontainer css script.

This is a fairly easy mod to do – 1 new file, 3 small modifications to existing files.

Create this new file from the code below: /includes/javascript/marquee.js


/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=500 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee

Add this line into: /templates/your template/mainpage.tpl.php


Modify your file: templates/your template/boxes/best_sellers_scroll.php

$info_box_contents[] = array('align' => 'center',
                             'text' => '
' . $bestsellers_list . '
'); new $infobox_template($info_box_contents, true, true, $column_location);

Add this at the end of the file: template/your template/stylesheet.css

#marqueecontainer{
position: relative;
width: 200px; /*marquee width */
height: 100px; /*marquee height */
background-color: white;
overflow: hidden;
border: 1px solid orange;
padding: 2px;
padding-left: 4px;
}

ideas and help with oscommerce-based shopping carts