WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: msherifam01 on January 29, 2014, 09:44:09 AM

Title: image as submit button
Post by: msherifam01 on January 29, 2014, 09:44:09 AM
Hi,

In wb bakery module i want to change the submit buttons to image.

original code: <input type="submit" name="add_to_cart" class="mod_bakery_bt_add_f" value="[ADD_TO_CART]" />

my code: <input type="image" src="my source" name="add_to_cart" class="mod_bakery_bt_add_f" value="[ADD_TO_CART]" />

my code does work in chrome but not in IE and Mozilla.

Please advice
Title: Re: image as submit button
Post by: jacobi22 on January 29, 2014, 10:15:43 AM
1. Please use the bakery threads for questions about bakery - thanks

2. use css only für button images. here an example
for my actual shop i use 4 different images with a width from 140px, 175px, 270px and 600px
and a subfolder for the buttons called bakery/images/bakery_buttons

search in your source code for the css-class like
Quote
<input type="submit" name="add_to_cart" class="mod_bakery_bt_add_f" value="[ADD_TO_CART]" />

here my css
Code: [Select]
.mod_bakery_bt_cart_f {
height:30px;
width:140px;
background: url("images/bakery_buttons/menuitem140.png") no-repeat scroll center center transparent;
border: 0 none !important;
cursor: pointer;
padding: 0;
margin-top:32px;
}
Title: Re: image as submit button
Post by: msherifam01 on January 29, 2014, 10:26:19 AM
Sorry for the wrong category..

When i use css as yours it doesnot have any impact.

i am running the code on localhost. will it behave different if i use server?
Title: Re: image as submit button
Post by: jacobi22 on January 29, 2014, 10:33:41 AM
it doesnt work, if you use a code like this
<input type="image"

Quote
When i use css as yours it doesnot have any impact.
i am running the code on localhost. will it behave different if i use server?

no, why?
if its not work on localhost, something goes wrong. check the path to your own button image and clear the browser cache after every code change
Title: Re: image as submit button
Post by: msherifam01 on January 29, 2014, 11:25:58 AM
Thanx buddy...
its working fine...
i didnt register the css. thats why there was no impact when i change css.

<?php
        if(function_exists('register_frontend_m odfiles')) {
                register_frontend_m odfiles('css');
                register_frontend_m odfiles('js');
        }
?>
did this.
work like charm...
Title: Re: image as submit button
Post by: jacobi22 on January 29, 2014, 11:32:42 AM
good job ;-)

use this method for all the other buttons (if you want), i need not all payment methodes, so i've only 17 image buttons in bakery