Go Back   Free website templates > Web Template Help > PHP and MySQL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Join now to share free website templates or post on the forum. If you have never been on a forum before read the FAQ. It's quick, easy and free to join!
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-16-2010, 03:13 AM
Member
 
Join Date: Jan 2010
Posts: 37
Jholden is on a distinguished road
Default Need help with oscommerce.

I am in need of some help with oscommerc, my store is running off it. The thing is all i have figured out how to do is change the color. I am looking to have a box added with icons and change things around and adjust other things. Putting products in is easy and i can do that but the modify php is proving to be difficult. If any one can help that would be so much appreciated. I will post the files on request or can email them direct.
Reply With Quote
  #2 (permalink)  
Old 01-16-2010, 09:49 AM
enigma1's Avatar
Programmer
 
Join Date: Dec 2009
Posts: 48
enigma1 will become famous soon enough
Default

Ok if you're new to the osc, the most important part is to know the basics for the common layout elements of the framework.

There is a header file: catalog/includes/header.php. That file contains whatever appears on the header of your site.

The left navigation column that contains various boxes that appear on the left is located in the catalog/includes/column_left.php. The file contains various conditions to display boxes depending on what page is viewed.

The right navigation column contains various boxes that appear on the right is located in the catalog/includes/column_right.php. It is similar to the left navigation column

The footer contents is in catalog/includes/footer.php and contains whatever appears on the footer of your store.

Now the boxes have various styles that are pre-set via the catalog/includes/classes/boxes.php. There are various classes in that file with the entries for infoBox and infoBoxContents typically used to create the boxes in the left/right navigation columns. There're some CSS references which can help to find the appropriate styles in the catalog/stylesheet.css

To simply add a new box, you first create a new box file in catalog/includes/boxes folder. You then edit one of the navigation column files to include the new box file. These are the 2 basic steps. And sure go ahead post the specifics of your question.
Reply With Quote
  #3 (permalink)  
Old 01-18-2010, 08:30 PM
Member
 
Join Date: Jan 2010
Posts: 37
Jholden is on a distinguished road
Default

Well i am having a few problems. My site is BlackHorseMotorsports.com i took all content down to show some of the problems.

1. I cant seem to find in the header.php file a way to get rid of the top --> catalog text.
2. I need to create a box on the right that houses our Facebook, twitter, and myspace icon.
3. I want to replace the Manufators box, and instead of just searching by manufatore you can do model, then choose make. But i cant seem to figure out how to create that function
4. I also noticed that the logo uptop looks really off so i want to change the logo and then make it cover the whole top.
5. I am really looking for any other advice or ideas to change it, i am not gonna open it till i feel it is right. There is just something off on it.
Reply With Quote
  #4 (permalink)  
Old 01-19-2010, 08:12 PM
enigma1's Avatar
Programmer
 
Join Date: Dec 2009
Posts: 48
enigma1 will become famous soon enough
Default

Quote:
1. I cant seem to find in the header.php file a way to get rid of the top --> catalog text.
The breadcrumb display is located by default in your catalog/includes/header.php
comment out or remove the following line:
Code:
    <td class="headerNavigation">&nbsp;&nbsp;<?php echo $breadcrumb->trail(' &raquo; '); ?></td>
Quote:
2. I need to create a box on the right that houses our Facebook, twitter, and myspace icon.
Use the catalog/includes/boxes/information.php file, duplicate it with a different name (eg: newbox.php). The change the links in the array so instead of this:

'<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .

you could have
Code:
'<a href="' . http://www.example.com . '">' . tep_image(DIR_WS_IMAGES . facebook.jpg, 'facebook alt text') . '</a><br>' .
'<a href="' . http://www.example.com . '">' . tep_image(DIR_WS_IMAGES . twitter.jpg, 'twitter alt text') . '</a><br>' .
 '<a href="' . http://www.example.com . '">' . tep_image(DIR_WS_IMAGES . twitter.jpg, 'myspace alt text') . '</a><br>' .
just change the Example Web Page links to whatever links you need for the social networks, upload the images to the catalog/images/ directory for each one. You also need to make the new box visible. Depending which panel you want it on (lets say left nav column) open the catalog/includes/column_left.php file. Just after
require(DIR_WS_BOXES . 'information.php');
you add:
require(DIR_WS_BOXES . 'newbox.php');
where the newbox.php is the file you duplicated earlier on. Open your browser clear its cache see if the box is there.

Quote:
3. I want to replace the Manufators box, and instead of just searching by manufatore you can do model, then choose make. But i cant seem to figure out how to create that function
Requires quite some effort to have a hierarchy of fields with the search. Perhaps you can improve the search first of all by using ajax where the relevant options are filtered as the visitor types in.
osCommerce Community Add-Ons

Quote:
4. I also noticed that the logo uptop looks really off so i want to change the logo and then make it cover the whole top.
The logo should be in the catalog/includes/header.php file. Now usually the logo itself is a clickable image separate from the rest of the header that puts the visitor in the home page, not a background. In any case check the headerdiv class in your catalog/stylesheet.css it's where the background is setup. Ideally the header should be sliced and the various items should be placed separately.
Reply With Quote
  #5 (permalink)  
Old 01-20-2010, 06:00 PM
Member
 
Join Date: Jan 2010
Posts: 37
Jholden is on a distinguished road
Default

I did it as you said and now it is throwing a code.
Code:
Parse error: syntax error, unexpected ':', expecting ')' in /home/content/b/l/a/blackhorsemoto/html/catalog/includes/boxes/social.php on line 23
I cant seem to find it tho, i check 23 and all others its not there.
Reply With Quote
  #6 (permalink)  
Old 01-20-2010, 08:38 PM
enigma1's Avatar
Programmer
 
Join Date: Dec 2009
Posts: 48
enigma1 will become famous soon enough
Default

ok, can you post the contents of the file

catalog/includes/boxes/social.php

so I can try it locally and fix any errors.
Reply With Quote
  #7 (permalink)  
Old 01-21-2010, 01:13 AM
Member
 
Join Date: Jan 2010
Posts: 37
Jholden is on a distinguished road
Default

Code:
<?php
/*
  $Id: information.php 1739 2007-12-20 00:52:16Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
?>
<!-- information //-->
          <tr>
            <td>
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

  new infoBoxHeading($info_box_contents, false, false);

  $info_box_contents = array();
  $info_box_contents[] = array('text' => '<a href="' . http://www.facebook.com/profile.php?ref=profile&id=100000532294498 . '">' . tep_image(DIR_WS_IMAGES . facebook_32.png, 'facebook alt text') . '</a><br>' .
					 '<a href="' . http://twitter.com/BlackHorseMotor . '">' . tep_image(DIR_WS_IMAGES . twitter_32.png, 'twitter alt text') . '</a><br>' .
 					 '<a href="' . http://www.youtube.com . '">' . tep_image(DIR_WS_IMAGES . youtube_32.png, 'youtube alt text') . '</a><br>' .
					 '<a href="' . http://www.flicker.com . '">' . tep_image(DIR_WS_IMAGES . flickr_32.png, 'flicker alt text') . '</a><br>' .
					 '<a href="' . http://www.myspace.com . '">' . tep_image(DIR_WS_IMAGES . myspace_32.png, 'myspace alt text') . '</a><br>' .

  new infoBox($info_box_contents);
?>
            </td>

          </tr>
<!-- information_eof //-->
Reply With Quote
  #8 (permalink)  
Old 01-21-2010, 09:26 AM
enigma1's Avatar
Programmer
 
Join Date: Dec 2009
Posts: 48
enigma1 will become famous soon enough
Default

ok I tested it here and corrected the issues. Most of them had to do with strings missing the single quotes

Code:
<?php
/*
  $Id: information.php 1739 2007-12-20 00:52:16Z hpdl $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
?>
          <tr>
            <td>
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => BOX_HEADING_SOCIAL);

  new infoBoxHeading($info_box_contents, false, false);

  $info_box_contents = array();
  $info_box_contents[] = array('text' => '<a href="http://www.facebook.com/profile.php?ref=profile&id=100000532294498">' . tep_image(DIR_WS_IMAGES . 'facebook_32.png', 'facebook alt text') . '</a><br>' .
                                         '<a href="http://twitter.com/BlackHorseMotor">' . tep_image(DIR_WS_IMAGES . 'twitter_32.png', 'twitter alt text') . '</a><br>' .
                                         '<a href="http://www.youtube.com">' . tep_image(DIR_WS_IMAGES . 'youtube_32.png', 'youtube alt text') . '</a><br>' .
                                         '<a href="http://www.flicker.com">' . tep_image(DIR_WS_IMAGES . 'flickr_32.png', 'flicker alt text') . '</a><br>' .
                                         '<a href="http://www.myspace.com">' . tep_image(DIR_WS_IMAGES . 'myspace_32.png', 'myspace alt text') . '</a>'
                              );

  new infoBox($info_box_contents);
?>
            </td>
          </tr>
I added a box-header text BOX_HEADING_SOCIAL
You need to edit the catalog/includes/languages/english.php and setup a new definition for the string. Something like:

define('BOX_HEADING_SOCIAL', 'Social Links');
Reply With Quote
  #9 (permalink)  
Old 01-21-2010, 04:05 PM
Member
 
Join Date: Jan 2010
Posts: 37
Jholden is on a distinguished road
Default

That worked brilliantly. You are blessed at programming. So i went into the footer (haha im slowly learning) to try and edit out the powered by oscommerce, and to try and center everything but couldnt find the area. What line am i looking for? What is the code to center?
Reply With Quote
  #10 (permalink)  
Old 01-21-2010, 06:03 PM
enigma1's Avatar
Programmer
 
Join Date: Dec 2009
Posts: 48
enigma1 will become famous soon enough
Default

the footer contents are in catalog/includes/footer.php

You should be able to comment out or remove the sections you don't want. The first table by default contains the visitors and date details. It may be the reason why the copyright info of your store is not centered. The HTML code that I see has a paragraph around the copyright but its part of the second table cell. In any case if you cannot figure it out post the contents of the file here.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:28 PM.



mouseover mouseover mouseover