Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing "buttons"?


wyrmpit

Recommended Posts

I know I asked this once before but it was months back and I never really got the answer I was looking for...

 

On my not yet "live" installation of Oscommerce, the form buttons look like they're actually HTML/Java style virtual buttons. I'd like to replace them with an actual image button set. How would I go about making this happen?

 

http://www.wyrmpit.com

Link to comment
Share on other sites

Any ideas?

It looks like you have the CSS buttons contribution installed. You could try going over the instructions backwards to revert back to using graphical buttons instead of the CSS ones.

Link to comment
Share on other sites

It looks like you have the CSS buttons contribution installed. You could try going over the instructions backwards to revert back to using graphical buttons instead of the CSS ones.

 

Well, I sure never installed it. Maybe it came added in on the OSCommerce install I originally downloaded? My "buttons" have always looked like this. =(

 

Anyone know where I might snoop around in the code to kill this contribution?

Link to comment
Share on other sites

Well, I sure never installed it. Maybe it came added in on the OSCommerce install I originally downloaded? My "buttons" have always looked like this. =(

 

Anyone know where I might snoop around in the code to kill this contribution?

Where did you download your oscommerce from? www.oscommerce.com?

 

I told you already how you might go about doing it! Goto the contribution section and search for CSS Buttons. There are two contribs that I can see so you will need to search to see if the code within these contributions is in your oscommerce files. It should be quite straight forward (or straight backwards actually) if the instructions are in the form of:

 

Find this code

 

Replace with this code

 

You will be able to work backwards in the instructions of whichever contrib you find to be installed.

Link to comment
Share on other sites

Yes, I downloaded my original install from here. I did implement the "Basic Design Pack" at one point however, which I have now learned included the "CSS Buttons Everywhere" contribution.

 

So...I tracked down "CSS Buttons Everywhere," as well as its father contribution, "CSS Buttons," and had a look at their install code.

 

They noted that my catalog/includes/functions/html_output.php files had been edited to replace instances of "tep_image_button" code with "tep_css_button" code. Upon inspecting my output_html.php file however, I only found the comments for the CSS Button contributions...the original "tep_image_button" code was still intact!

 

I couldn't locate any reference to this mystery "tep_css_button" code at all...

Link to comment
Share on other sites

Yes, I downloaded my original install from here. I did implement the "Basic Design Pack" at one point however, which I have now learned included the "CSS Buttons Everywhere" contribution.

 

So...I tracked down "CSS Buttons Everywhere," as well as its father contribution, "CSS Buttons," and had a look at their install code.

 

They noted that my catalog/includes/functions/html_output.php files had been edited to replace instances of "tep_image_button" code with "tep_css_button" code. Upon inspecting my output_html.php file however, I only found the comments for the CSS Button contributions...the original "tep_image_button" code was still intact!

 

I couldn't locate any reference to this mystery "tep_css_button" code at all...

If you post the tep_image_button code I'll have a look for you

Link to comment
Share on other sites

If you post the tep_image_button code I'll have a look for you

 

// The HTML form submit button wrapper function
// Outputs a button in the selected language
// BEGIN: CSS Buttons Everywhere
function tep_image_submit($image, $value = '-AltValue-', $parameters = '') {
global $language;
$css_submit = '<input type="submit" class="cssButton" value="' . tep_output_string($value) . '" />';
return $css_submit;
}
// END: CSS Buttons Everywhere

////
// Output a function button in the selected language
 // BEGIN: CSS Buttons Everywhere
function tep_image_button($image, $value = '-AltValue-', $parameters = '') {
global $language;
$image = '<div class="cssButton"> ' . tep_output_string($value) . ' </div>';
return $image;
}
// END: CSS Buttons Everywhere

 

Obviously there is some sort of CSS mess going on in there, but the code otherwise looks the same as the original OsCommerce html_output.php file, at least as it was described in the "CSS Buttons Everywhere" install .txt.

 

Thanks for the help =)

Link to comment
Share on other sites

// The HTML form submit button wrapper function
// Outputs a button in the selected language
// BEGIN: CSS Buttons Everywhere
function tep_image_submit($image, $value = '-AltValue-', $parameters = '') {
global $language;
$css_submit = '<input type="submit" class="cssButton" value="' . tep_output_string($value) . '" />';
return $css_submit;
}
// END: CSS Buttons Everywhere

////
// Output a function button in the selected language
 // BEGIN: CSS Buttons Everywhere
function tep_image_button($image, $value = '-AltValue-', $parameters = '') {
global $language;
$image = '<div class="cssButton"> ' . tep_output_string($value) . ' </div>';
return $image;
}
// END: CSS Buttons Everywhere

 

Obviously there is some sort of CSS mess going on in there, but the code otherwise looks the same as the original OsCommerce html_output.php file, at least as it was described in the "CSS Buttons Everywhere" install .txt.

 

Thanks for the help =)

That code outputs CSS buttons. You need to methodically work though the instructions in the css buttons everywhere contrib to revert your code back to using the graphical buttons. It's quite easy - you will be able to do it!

Link to comment
Share on other sites

That code outputs CSS buttons. You need to methodically work though the instructions in the css buttons everywhere contrib to revert your code back to using the graphical buttons. It's quite easy - you will be able to do it!

 

Ok, some how I managed to copy-and-paste the wrong things in there. However, once I've replaced the "CSS Buttons Everywhere" code with the original code cited in the contribution's install file, the CSS buttons are indeed gone...but now NO buttons exist, only text links where the CSS buttons used to be. :o The button files are still in their original location.

Link to comment
Share on other sites

Ok, some how I managed to copy-and-paste the wrong things in there. However, once I've replaced the "CSS Buttons Everywhere" code with the original code cited in the contribution's install file, the CSS buttons are indeed gone...but now NO buttons exist, only text links where the CSS buttons used to be. :o The button files are still in their original location.

There could be a problem with your html_output or config files making the path to the languages/english/images/buttons folder incorrect. Check these files and make sure the correct directory is being used to locate the button images.

Link to comment
Share on other sites

There could be a problem with your html_output or config files making the path to the languages/english/images/buttons folder incorrect. Check these files and make sure the correct directory is being used to locate the button images.

 

You lost me there. None of the references to the '/images/ folder in those files seems to have absolute paths. They're all relative calls, which makes things very confusing. There are so many different /images/buttons folders, as well as configure.php and html_ouput.php files, I don't know which should say what.

Link to comment
Share on other sites

You lost me there. None of the references to the '/images/ folder in those files seems to have absolute paths. They're all relative calls, which makes things very confusing. There are so many different /images/buttons folders, as well as configure.php and html_ouput.php files, I don't know which should say what.

The way links are created in osc is by concatenating the various path strings in the config files. The html_output file call to the images (for a fresh osc) should read:

 

src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '"

 

If this is right and your settings in the catalog config file are correct there must be some other problem. You could try a file comparison program (third time I have recommended this tonight - starting to feel a bit like a broken record) to easily see the differenced between you code and the original release.

Link to comment
Share on other sites

The way links are created in osc is by concatenating the various path strings in the config files. The html_output file call to the images (for a fresh osc) should read:

 

src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '"

 

If this is right and your settings in the catalog config file are correct there must be some other problem. You could try a file comparison program (third time I have recommended this tonight - starting to feel a bit like a broken record) to easily see the differenced between you code and the original release.

 

In /catalog/includes/functions/html_output.php, my code reads:

 

$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';

 

Based on your example I assume this to be "correct." As for the /catalog/configure.php file ( this is the configure.php file you're referring to, yes? ), I'm not sure how exactly it should look. This is the only line that specifically references an /images directory:

 

define('DIR_WS_IMAGES', 'images/');

 

Now, assuming both of these lines read as they should, and the relative button files DO exist in /catalog/includes/languages/english/images/buttons ( this is the correct path, right? ), that must mean that the actual "button" calls themselves must be looking for the image in the wrong place, or with the wrong image name, right? ( I'm not a programmer, sorry if my lingo is innaccurate )

 

i.e. when a Buy Now "button" ( or in my case, text link ) is generated, that Buy Now function is looking for an image for itself in the wrong place, or with a file name other than the default ( button_buy_now.gif )?

 

If that might be the case, where do I find the code for the individual buttons functions?

Link to comment
Share on other sites

In /catalog/includes/functions/html_output.php, my code reads:

Based on your example I assume this to be "correct." As for the /catalog/configure.php file ( this is the configure.php file you're referring to, yes? ), I'm not sure how exactly it should look. This is the only line that specifically references an /images directory:

Now, assuming both of these lines read as they should, and the relative button files DO exist in /catalog/includes/languages/english/images/buttons ( this is the correct path, right? ), that must mean that the actual "button" calls themselves must be looking for the image in the wrong place, or with the wrong image name, right? ( I'm not a programmer, sorry if my lingo is innaccurate )

 

i.e. when a Buy Now "button" ( or in my case, text link ) is generated, that Buy Now function is looking for an image for itself in the wrong place, or with a file name other than the default ( button_buy_now.gif )?

 

If that might be the case, where do I find the code for the individual buttons functions?

That code looks fine to me.

 

You could try looking at the code for the buy now button in product_info.php:

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

Link to comment
Share on other sites

That code looks fine to me.

 

You could try looking at the code for the buy now button in product_info.php:

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

My code seems to match that exactly:

 

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>

 

This is getting depressing.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...