Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Add an Image to Payment Method

Add an Image to Payment Method

Locked

Views: 1,621

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
13 Sep 2008, 10:54 AM
#1
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Add an Image to Payment Method

Hi everyone,

I located this code in tpl_checkout_payment_default.php found in includes/templates/barebones/templates/

It controls the display of the credit card images on the payment information section of the check out page.

I want to add an image immediately to the right of the last credit card image in the row. Its the same size and will hopefully line up nicely with the others.

What additions do I have to make to the code below to make that happen?

<?php if (SHOW_ACCEPTED_CREDIT_CARDS != '0') { ?> <?php if (SHOW_ACCEPTED_CREDIT_CARDS == '1') { echo TEXT_ACCEPTED_CREDIT_CARDS . zen_get_cc_enabled(); } if (SHOW_ACCEPTED_CREDIT_CARDS == '2') { echo TEXT_ACCEPTED_CREDIT_CARDS . zen_get_cc_enabled('IMAGE_'); } ?>Thanks in advance for the help!
17 Sep 2008, 8:05 AM
#2
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Add an Image to Payment Method

:::bump:::

Any advice from the ZC gurus?

I believe my problem is that I don't know how to add an image in a php file, or what I need to know to do so.

Is it as simple as learning the proper syntax, or is there something additional I need to know?

Can I use html code, or do I need to use a combination of html & css, or do I need to use php syntax?

Having the actual code I can just plug in would be nice, but I'd much rather learn how to do this for myself so that going forward, I'll be able to do so independently.

Can someone please point me in the right direction on where/how to begin?

Thanks in advance :smile:

17 Sep 2008, 9:23 AM
#3
s_t_e_v_e avatar

s_t_e_v_e

Zen Follower

Join Date:
Aug 2006
Location:
UK
Posts:
430
Plugin Contributions:
0

Re: Add an Image to Payment Method

as long as you keep a backup, you can try modifying the template files. You can use html within these templates... If you look through a few of them, you should be able to see how the php and html is coded...

adding an image would a simple html IMG tag... but with a little php to make sure the correct folder is used...

for example,

<img src="<?php echo DIR_WS_TEMPLATE_IMAGES; ?>image.jpg" alt="alt text" />

This will display an image that you can upload into your includes -> templates -> YourTemplateFolder -> images folder.

Now you just have to consider whereabouts you wish to put the above line...

18 Sep 2008, 9:36 PM
#4
scriptjunkie avatar

scriptjunkie

Totally Zenned

Join Date:
Jul 2008
Posts:
772
Plugin Contributions:
0

Re: Add an Image to Payment Method

That's awesome, thanks Steve!

I'll play around with that tonight and see what I can accomplish :)

I see this a lot in the files:

<?php echo DIR_WS_"SOME_ZC_FOLDER_HERE"; ?> some html stuff here />

and I have a couple questions about it.

Understanding the code I'm modifying will go a long way in being able to answer my own questions.

Does the DIR=Directory?

What does the WS reference?

What is "?php echo DIR_WS" telling me about the folder and/or html stuff that follows it?

I see a lot of talk about PHP 'calling' stuff from files. Is that what the php echo string does - calls stuff?