Jump to content

(SOLVED) Some basic HTML/CSS help?


Recommended Posts

Hello.

I am trying to replace the text here "Buy It" written in white with an image of a button.

http://www.jahwaggysdubplatedownloads.com/gb/home/10-test-product-1.html


Can someone kind out there show me where I need to edit and the code I should use please? I realize I need to link to an image which I will upload.

Edited by Twinkles (see edit history)
Link to comment
Share on other sites

so go to the localization > translations

 

from the first drop down select "modules translation", click on flag

 

now you will see list of modules and available to translate / change fields. search for this module and this strin "Buy it !" and change translation

Link to comment
Share on other sites

ahh so in this case you have to modify the module .tpl file, instead the simple "Buy it" use code with button.

unfortunately i don't know how this module looks like (especially sources) so it's hard to say what and where you have to change / add

Link to comment
Share on other sites

This might work for you.

 

Locate the tpl file as vekia said. Search for the link you want to change to a button, replace the code with this one:

 

<a class="button" href="{$link->getPageLink('CHANGETHISTOWHEREEVERTHELINKMAYLEAD.php', true)}" title="{l s='Buy it!'}">{l s='Buy it!'}</a>

Link to comment
Share on other sites

  • 4 weeks later...

Sorry for the late reply - been away. I am not sure what to change. I have found the lable in the tpl file - but not sure what to change. I just want a small image (button) instead of the text "Buy It Now"

 

Code from the tpl is this :-

 

{/if}
			    <span class="mp3_label">{$download.display_filename}</span>
		    {if $download.physically_filename neq ''}
			    <span class="mp3_label"><a onclick="$('#idCombination').val({$download.id_product_attribute});$('#add_to_cart .exclusive').click();$('#idCombination').val(0);">{l s='BUY IT NOW !' mod='mp3downloadmagavenue'}</a></span>			   
		    {/if}

Link to comment
Share on other sites

  • 2 weeks later...

OK maybe I am not able to do this. 

 

I can create a new class in the CSS no problem.  (Or could I use an absolute path to image - like www.website.com/myimage/someimage.gif ???)

 

But after this I am lost as to what you mean.  Sorry for being a newbie but huh? 

Link to comment
Share on other sites

Thanks  Vekia - but thats my problem, I am not sure what to change on  the tpl.

 

For the css

 

I added the follow to the global.css excatly as below.

 

.buyitnowsingle{
url("img/icon/cart.gif")
}

 

Then I get stuck as what to do next in the tpl file.  Somewhere I guess with this code?

 </object>
                {/if}
                    <span class="mp3_label">{$download.display_filename}</span>
                {if $download.physically_filename neq ''}
                    <span class="mp3_label"><a onclick="$('#idCombination').val({$download.id_product_attribute});$('#add_to_cart .exclusive').click();$('#idCombination').val(0);">{l s='BUY IT NOW !' mod='mp3downloadmagavenue'}</a></span>                
                {/if}
            </div>
Link to comment
Share on other sites

 <span class="mp3_label"><a class="buyitnowsingle" onclick="$('#idCombination').val({$download.id_product_attribute});$('#add_to_cart .exclusive').click();$('#idCombination').val(0);">{l s='BUY IT NOW !' mod='mp3downloadmagavenue'}</a></span>                

and in:

.buyitnowsingle{

background: url("img/icon/cart.gif")

}

 

define also width and height related to the size of your img/icon/cart.gif image size

Link to comment
Share on other sites

Thanks Vekia - but I must be stupid - I copy the code as you have suggested,  but it still appears as text.  I can changeit via CSS if I use background image - but it does not show the image itself. I noticed the URL does not get picked up in Firefox either?

Link to comment
Share on other sites

yess because there is still {l s='BUY IT NOW !' mod='mp3downloadmagavenue'}

i checked sources of your code and it looks like:

.buyitnowsingle{
url("img/icon/cart.gif")
	height:100%;
	width:100%
}

you should use:

.buyitnowsingle{
background: url("img/icon/cart.gif");
height:100%;
width:100%
}

and of course you need to upload cart image to the img/icon/cart !

Link to comment
Share on other sites

ah we really are close - I cant quite find where it goes ;)

 

It shows the text width etc - soooo close.

<span class="mp3_label"><a class="buyitnowsingle" onclick="$('#idCombination').val({$download.id_product_attribute});$('#add_to_cart .exclusive').click();$('#idCombination').val(0);">width="25"height="25"</a></span>  
Link to comment
Share on other sites

i mean height and width in css styles ;)

 

use this style:

.buyitnowsingle {
display: inline-block;
background: url("http://www.jahwaggysdubplatedownloads.com/themes/default/img/icon/add.png") no-repeat;
height: 35px;
width: 35px;
}

and this code:

<span class="mp3_label"><a class="buyitnowsingle" onclick="$('#idCombination').val({$download.id_product_attribute});$('#add_to_cart .exclusive').click();$('#idCombination').val(0);"></a></span>  
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...