Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Notice: Undefined index: customer in /srv/disk2/2305237/www/shop.winterparkstampshop.com/includes/modules/navbar/nb_account.php on line 22


otismo

Recommended Posts

Suggest you apply to join the Phoenix Club on this forum - this issue has been answered there.
If you want to change any text - from admin go to Tools>Define Languages and click the files there, change or add text and save.
For example, change or add text to the index (home) page in files beginning with modules/content/index/

Link to comment
Share on other sites

Hi !

Thanks Again !

On my HomePage it says in very large type "Welcome on Winter Park Stamp Shop".

I want to change it to read Welcome to the Winter Park Stamp Shop.

What would really help is a list of all editable content files with links/navigation to the location of the files.

If such a list exists, would you please kindly send me a link ?

Thank You !

Cheers !

Link to comment
Share on other sites

14 hours ago, otismo said:

On my HomePage it says in very large type "Welcome on Winter Park Stamp Shop".

I want to change it to read Welcome to the Winter Park Stamp Shop.

That language define can be found in includes/languages/english/modules/content/index/cm_i_title.php.

You need to remember that Phoenix has gone modular, and nearly every area on a page is controlled by a module. On the index page alone there are several, and the same with the products page and shopping cart and a few other pages. Most language definitions are somewhere in the language folder but may take some finding. Paypal I think is the only ones that aren't.

As to your other error. if you have not already joined the Phoenix club here is a comment that was given there when someone had a similar error. In the file with the error they changed line 22 to

if (array_key_exists('customer', $GLOBALS) && $GLOBALS['customer'] instanceof customer) {

and the error seemed to go away. (Note that that code is not in the very latest version.)

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

That is a bad use of array_key_exists.  Replacing it with

if (isset($GLOBALS['customer']) && $GLOBALS['customer'] instanceof customer) {

will always return the same answer and be faster.  Because isset is faster than array_key_exists and because it saves the instanceof check in a circumstance when it always fails.  The only time to use array_key_exists is when you need to know the difference between never set and defined but set to null.  Which you don't here.  Because if it is null, it is not an instance of customer.  So the expression will return false whenever isset and array_key_exists return different results regardless of which is used. 

It is pretty rare to be in a situation where one should use array_key_exists.  It gets recommended by people who are offended that PHP traditionally treated all undeclared variables as having a value of null.  But the truth is that there are very few situations where one wants to know if something was not declared versus declared with a null value.  And of course most of those situations can be fixed by simply setting explicitly to false rather than null.  So it's pretty much only when interacting with someone else's code that one has any reason to use array_key_exists over isset. 

In this particular case, array_key_exists is itself slower and in addition, whenever it returns true and isset false, the instanceof will be false.  So it will be even slower (because it does the instanceof check after getting a true from array_key_exists) to return the exact same result as isset.  Note that

(isset($GLOBALS['customer']) || array_key_exists('customer', $GLOBALS))

is faster (on average) than using array_key_exists alone.  But as I said, in this particular case, you want a false result when the two differ anyway.  So it's both easier and faster to just use isset. 

Always back up before making changes.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...