Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Anyone know whats wrong with this code?


yoursoccershirts

Recommended Posts

Hi lads

 

ive a problem, im getting this message when i try to view the home page of my site.

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/y48624/public_html/shop/includes/application_top.php on line 312

 

Ive checked the line in question and ive posted it below, does anyone see any problem with the line, ive no idea about code.

 

Line 312 = $navigation->add_current_page();

 

Also how do i change the Banner at the top of my page, ive designed a new banner and i want to change the image and not have the oscommerce at the top of the page

 

thanks in advance for any replys.

Link to comment
Share on other sites

it should be:

// navigation history
 if (tep_session_is_registered('navigation')) {
if (PHP_VERSION < 4) {
  $broken_navigation = $navigation;
  $navigation = new navigationHistory;
  $navigation->unserialize($broken_navigation);
}
 } else {
tep_session_register('navigation');
$navigation = new navigationHistory;
 }
 $navigation->add_current_page();

 

did you installed any contributions which can cause the problem?

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

Hi lads

 

ive a problem, im getting this message when i try to view the home page of my site.

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/y48624/public_html/shop/includes/application_top.php on line 312

 

Ive checked the line in question and ive posted it below, does anyone see any problem with the line, ive no idea about code.

 

Line 312 = $navigation->add_current_page();

 

Also how do i change the Banner at the top of my page, ive designed a new banner and i want to change the image and not have the oscommerce at the top of the page

 

thanks in advance for any replys.

Code looks ok. You should have

 

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

} else {

tep_session_register('navigation');

$navigation = new navigationHistory;

}

$navigation->add_current_page();

Link to comment
Share on other sites

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Line 312 = $navigation->add_current_page();

 

This is register globasl problem.

 

Navigation is stored as a session variable and its no more available as global.

 

so place isset($_SESSION['navigation'])

{

$navigation = $_SESSION['navigation'];

}

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

thanks very much lads got the problem sorted.

 

Now my next problem is all my images for products and the website butons are not showing up expect for the text and an x.

 

also i want to add images to my home page index is this possible and if so whats the code and what line is it possible to enter them.

 

Again lads cheers in advance, im new to this kind of thing and your help is very much appreciated your a very friendly bunch on here :).

Link to comment
Share on other sites

The only images I can't see are the ones for the buttons.

 

You probably have a .htaccess file in your /shop/includes folder.

 

Rename it to text.htaccess and see if the button images become available.

 

I'm not sure what other images you're referring to?

:unsure:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

The only images I can't see are the ones for the buttons.

 

You probably have a .htaccess file in your /shop/includes folder.

 

Rename it to text.htaccess and see if the button images become available.

 

I'm not sure what other images you're referring to?

:unsure:

 

 

cheers mate gonna give this a try. Edit: searched the Shop/includes folder and can't find any .htaccess file at all ????, where in the includes folder does it usually be?

 

the other images im talking about are just pictures on my pc i wanna add to my home page/index.php file page any ideas.

Link to comment
Share on other sites

Upload the images to your /shop/images folder.

 

In your /shop/index.php file find this code:

 

		  <tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>

Change it to something like this:

 

		  <tr>
		<td class="main"><?php echo TEXT_MAIN; ?></td>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td  align="center"><?php echo tep_image(DIR_WS_IMAGES . 'IMAGE_NAME_HERE'); ?>
	  </tr>
	  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>
	  </tr>

In this code here:

 

		  <tr>
		<td><?php echo tep_image(DIR_WS_IMAGES . 'IMAGE_NAME_HERE'); ?>
	  </tr>

Change this text:

 

IMAGE_NAME_HERE

 

To the name you want to use.

 

On UNIX file names are case-sensitive so image.jpg is NOT the same as imageJPG

 

Not sure how much you know about HTML but to put more than one image on each row the code would look something like this:

 

		  <tr>
		<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'image1.jpg'); ?>
		<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'image2.jpg'); ?>
		<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'image3.jpg'); ?>
	  </tr>

Or if they are large and you only want one per row it would need to look somethinig like this:

 

		  <tr>
		<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'image1.jpg'); ?>
	  </tr>
	  <tr>
		<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'image2.jpg'); ?>
	  </tr>
	  <tr>
		<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'image2.jpg'); ?>
	  </tr>

As always, backup any file before making any edits.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

If you're using your Control Panel File Manager you may have to "toggle" something to "see" .htaccess files as they are hidden by default on UNIX.

 

Check all the folders in this path:

 

/shop/includes/languages/english/images/buttons/button_quick_find.gif

 

All the folders should have 755 permissions, then when you get to the top, all the images need 644 permissions.

 

Check that as it could also be a permissions problem.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

If you're using your Control Panel File Manager you may have to "toggle" something to "see" .htaccess files as they are hidden by default on UNIX.

 

Check all the folders in this path:

 

/shop/includes/languages/english/images/buttons/button_quick_find.gif

 

All the folders should have 755 permissions, then when you get to the top, all the images need 644 permissions.

 

Check that as it could also be a permissions problem.

 

 

Ive just checked my folder and tbh i don't have a buttons file this must be the problem is there a file i can upload?

 

Also tried uploading the pictures to the index.php file it doesn't work this is the code im using.

 

 

<tr>

<td class="main"><?php echo TEXT_MAIN; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'yoursoccershirts-liverpoolpromotion.jpg'); ?>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td>

</tr>

 

 

the name of the pic in my images folder is the same as ive entered in the code.

Link to comment
Share on other sites

yoursoccershirts-liverpoolpromotion.jpg doesn't exist in your /shop/images folder.

 

Check again.

 

You can get the images for the buttons anywhere you download osCommerce source files.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

You put it in your /shop/images/promotions folder.

 

Either move it, or change the code to:

 

<?php echo tep_image(DIR_WS_IMAGES . 'promotions/yoursoccershirts-liverpoolpromotion.jpg'); ?>

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Ok this is really starting to get on my nerves, whats wrong in this code the picture is just a x icon. :(

 

The image is in my promotions folder so i can't see the problem.??

 

<tr>

<td class="main"><?php echo TEXT_MAIN; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td align="center"><?php echo tep_image(DIR_WS_IMAGES . 'promotions/Juventuspromotion.jpg'); ?>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

 

The Image is a jpg image i converted it.

Link to comment
Share on other sites

Check the file name.

 

It should be: JuventusPromotion.jpg

 

Remember, they ARE case-sensitive on Unix.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Check the file name.

 

It should be: JuventusPromotion.jpg

 

Remember, they ARE case-sensitive on Unix.

 

 

Opps Germ your a gentleman :), sorry for been a pain in your skull lol.

 

Ok maybe you can help me on my next item,

 

I want to add a drop box in the products page, my website will be selling soccer shirts and on a product page i want to add a drop box so people can select what name/number they want printed on the back.

 

Also i want to edit my Banner on my home page how is this done? :D

 

I know what your thinking, "this guys pushing his luck" ;)

Link to comment
Share on other sites

use attributes functionality it comes with oscommerce.

 

 

Left column there is a link attributes in admin use it.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

This post will help with changing the banner:

 

How Do I ...? All the basic install questions regularly asked..., change text, boxes, layout, fonts, dates, breadcrumb and more...

 

Tip #19

 

I don't think you're pushing anything.

 

I've been at work and although I work with PC's all day I didn't have time to get online to see how you were progressing.

 

I missed last Friday at work and had to do some catching up today.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

This post will help with changing the banner:

 

How Do I ...? All the basic install questions regularly asked..., change text, boxes, layout, fonts, dates, breadcrumb and more...

 

Tip #19

 

I don't think you're pushing anything.

 

I've been at work and although I work with PC's all day I didn't have time to get online to see how you were progressing.

 

I missed last Friday at work and had to do some catching up today.

 

Cheers mate didn't want to seem like i was hounding you, your help is much appreciated, i owe you a few drinks at this stage :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...