Zen Cart Logo
Forums / Addon Templates / Help with some PHP editing a new template (Picaflor)

Help with some PHP editing a new template (Picaflor)

Views: 7,260

Results 1 to 20 of 85
2 Apr 2013, 7:14 PM
#1
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Help with some PHP editing a new template (Picaflor)

There are a few things I need help editing on my site still and a lot of it seems like it's PHP.

But where can I find the index.html so I can edit things like body etc? All I can find are PHP files

To start I'm having issues with the logo showing up

The website is http://visionaryscience.net/ and I have uploaded the new logo & edited the code correctly (I thought) but not sure why the logo image isn't showing up? Anyone have any ideas? I followed the Picaflor directions as follows:

Create your logo in your image editing program and upload it to includes/templates/yorkshire_clean/images.

Open includes/languages/english/yorkshire_clean/header.php in a plain text editor. Find this code on or around line 24:

define('HEADER_ALT_TEXT', 'Yorkshire Clean :: Free Template by www.picaflor-azul.com');
define('HEADER_LOGO_WIDTH', '235px');
define('HEADER_LOGO_HEIGHT', '60px');
define('HEADER_LOGO_IMAGE', 'logo.png');

    Replace "Yorkshire Clean :: Free Template by www.picaflor-azul.com" with your site name and tag line here
    Replace "235px" with your logo width
    Replace "60px" with your logo height
    Replace "logo.png" with the name of your logo image

define('HEADER_ALT_TEXT', 'Your store name :: your store tag line');
define('HEADER_LOGO_WIDTH', 'height in px');
define('HEADER_LOGO_HEIGHT', 'width in px');
define('HEADER_LOGO_IMAGE', 'your logo name .png');
<?php
/**
 * @package languageDefines
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: header.php 2940 2006-02-02 04:29:05Z drbyte $
 */

// header text in includes/header.php
  define('HEADER_TITLE_CREATE_ACCOUNT', 'Create Account');
  define('HEADER_TITLE_MY_ACCOUNT', 'My Account');
  define('HEADER_TITLE_CART_CONTENTS', 'Shopping Cart');
  define('HEADER_TITLE_CHECKOUT', '<span class="header-checkout">Checkout</span>');
  define('HEADER_TITLE_TOP', 'Top');
  define('HEADER_TITLE_CATALOG', 'Home');
  define('HEADER_TITLE_LOGOFF', 'Log Out');
  define('HEADER_TITLE_LOGIN', 'Log In');
  define('HEADER_TITLE_PROMO1', '<span class="promo-big">FREE SHIPPING</span><br />on all orders over <span class="promo-green">$50.00</span>');

// definiitions for header icons
  define('HEADER_ICON_HOME', 'home.png');
  define('HEADER_ICON_LOGOFF', 'logoff.png');
  define('HEADER_ICON_ACCOUNT', 'account.png');
  define('HEADER_ICON_LOGIN', 'login.png');
  define('HEADER_ICON_CART', 'cart.png');
  define('HEADER_ICON_CHECKOUT', 'checkout.png');


// added defines for header alt and text
  define('HEADER_ALT_TEXT', 'VisionaryScience.net Bringing Tomorrows Vision Today');
  define('HEADER_SALES_TEXT', 'Bringing Tomorrows Vision Today');
  define('HEADER_LOGO_WIDTH', '574px');
  define('HEADER_LOGO_HEIGHT', '120px');
  define('HEADER_LOGO_IMAGE', 'visionarysciencelogo.jpg');

// header Search Button/Box Search Button
  define('HEADER_SEARCH_BUTTON','Search');
  define('HEADER_SEARCH_DEFAULT_TEXT', 'Enter search keywords here');

?>
2 Apr 2013, 7:52 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Help with some PHP editing a new template (Picaflor)

You have the image listed as visionarysciencelogo.jpg. The browser is looking for visionarysciencelogo.png.

BTW, there are no HTML files to edit in Zencart. All pages are created on the fly from PHP files and database data and presented to the browser as HTML.

2 Apr 2013, 7:55 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help with some PHP editing a new template (Picaflor)

There is no index.html to edit. All the HTML output is created at runtime by various PHP files with info from the database, and sent to your browser. When you click a link to another page, the one you are on evaporates and the next one is built and sent to you.
So you need to locate the correct PHP file that builds the element you want to edit. What exactly do you want to change aside from the logo?

It is currently looking for
includes/templates/template_default/images/visionarysciencelogo.png
because it couldn't find
includes/templates/yorkshire_clean/images/visionarysciencelogo.png
but you say you are using visionarysciencelogo.jpg, and when I change the HTML output using Firebug to look for that, the logo displays correctly on your site.

2 Apr 2013, 7:58 PM
#4
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

I made both a jpg & .png & neither one of them were showing up for me.

Normally I only use .png's when I need a transparent background.

Since I already have the .jpg file uploaded, what/where do I need to change the HTML output code to reflect this?

2 Apr 2013, 8:08 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

Since I already have the .jpg file uploaded, what/where do I need to change the HTML output code to reflect this?
Not html but php

Look for

/includes/languages/english/template_name/header.php

Replace template_name with your template name

2 Apr 2013, 9:09 PM
#6
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Ahh wonderful! It seems I finally got it to work. Needs a little CSS, but at least it's there!

Now what about cleaning up the stuff at the bottom:

Copyright © 2013 VisionaryScience.net. Powered by Zen Cart.
Zen cart templates by Picaflor Azul.

I want to leave the Copyright 2013 visionaryscience.net

But I want to delete the rest.

Thanks.

2 Apr 2013, 9:33 PM
#7
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Help with some PHP editing a new template (Picaflor)

It's in english.php, though I think a small link is the least we can do to say 'thanks' for a great piece of free shopping cart software.

2 Apr 2013, 11:29 PM
#8
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Hmm, when I delete ```
'</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>'


define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' . STORE_NAME . '</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>');


Any idea why?
2 Apr 2013, 11:55 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

Try this

define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' . STORE_NAME . '</a>);
3 Apr 2013, 5:43 PM
#10
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Help with some PHP editing a new template (Picaflor)

kobra:

Try this

define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' . STORE_NAME . '</a>);


I just wanted to post to let you know that if you read the readme.html file included in the template package most of your questions will be answered ;)

Thanks,

Anne
12 Apr 2013, 8:00 AM
#11
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Any idea why when I deleted some of the menu tabs out it added in those 3 HEADER_TITLE tabs? I can't seem to get them to disappear?

Per the instructions I edited the includes/languages/english/extra_definitions/yorkshire_clean/headermenu.php file and just deleted the entire block of tab I didn't want and was left with this:

/*bof categories definitions*/
define('HEADER_TITLE_CATEGORIES','Shop');

/*bof information definitions*/
define('HEADER_TITLE_INFORMATION','Info');
define('TITLE_GENERAL','General Info');
define('TITLE_CUSTOMERS','Customers');
define('TITLE_NEWSLETTERS','Newsletters');

/*bof connect with us*/
define('TITLE_CONNECT','Connect');

/*bof contact us form definitions*/
define('HEADER_TITLE_CONTACT_US','Contact Us');
define('TITLE_CONTACT_US','Have a Question?');
define('TEXT_CONTACT_US','Your short message goes here.');

/*bof customer service*/
define('HEADER_TITLE_CUSTOMER_SERVICE','Service');
define('TITLE_SHIPPING','Shipping');
define('TEXT_SHIPPING_INFO','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam interdum feugiat ipsum vehicula sollicitudin. Integer sed lacus eget risus consectetur ullamcorper. Pellentesque rutrum ullamcorper faucibus. Nam porttitor iaculis enim, mattis tristique velit tristique bibendum. ');
define('TITLE_CONFIDENCE','Shop with Confidence');
define('TEXT_CONFIDENCE','Here you can write a few short sentencs about why your customers can buy with conficence from your store.  You might also want to outline your payment options here.');
define(PAYMENT_ICON,'payments.png');

This is what I took out:

/*bof quick links definitions*/
define('HEADER_TITLE_NEW_PRODUCTS','New Products');
define('HEADER_TITLE_ALL_PRODUCTS','All Products');
define('HEADER_TITLE_SPECIALS','Specials');
define('HEADER_TITLE_SEARCH','Search');
define('HEADER_TITLE_QUICK_LINKS','Quick Links');





/*bof manufacturers definitions*/
define('HEADER_TITLE_MANUFACTURERS','Brands');





/*bof information definitions*/
define('HEADER_TITLE_INFORMATION','Info');
define('TITLE_EZ_PAGES','Useful Links');
define('TITLE_GENERAL','General Info');
define('TITLE_CUSTOMERS','Customers');
define('TITLE_NEWSLETTERS','Newsletters');
12 Apr 2013, 8:06 AM
#12
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

includes/languages/english/extra_definitions/yorkshire_clean/headermenu.php

This is just the language file with defines for what text is to be displayed

Look in your templates/yorkshire_clean area for a tpl file that builds to menu
or maybe
modules/yorkshire_clean

12 Apr 2013, 8:13 AM
#13
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Hmm, I'm not sure where you mean exactly as I can't seem to find anything with a tpl extension?

Should I just be able to edit the navigation tabs through the admin section instead of having to edit code?

12 Apr 2013, 8:24 AM
#14
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

It's the tpl_mega_menu.php I have to edit, but not sure what exactly what to edit yet

12 Apr 2013, 8:26 AM
#15
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

It is tpl_mega_menu.php in the templates /common folder

12 Apr 2013, 8:34 AM
#16
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

JohnnyScience:

Any idea why when I deleted some of the menu tabs out it added in those 3 HEADER_TITLE tabs? I can't seem to get them to disappear?

Per the instructions I edited the includes/languages/english/extra_definitions/yorkshire_clean/headermenu.php file and just deleted the entire block of tab I didn't want and was left with this:

/bof categories definitions/
define('HEADER_TITLE_CATEGORIES','Shop');

/bof information definitions/
define('HEADER_TITLE_INFORMATION','Info');
define('TITLE_GENERAL','General Info');
define('TITLE_CUSTOMERS','Customers');
define('TITLE_NEWSLETTERS','Newsletters');

/bof connect with us/
define('TITLE_CONNECT','Connect');

/bof contact us form definitions/
define('HEADER_TITLE_CONTACT_US','Contact Us');
define('TITLE_CONTACT_US','Have a Question?');
define('TEXT_CONTACT_US','Your short message goes here.');

/bof customer service/
define('HEADER_TITLE_CUSTOMER_SERVICE','Service');
define('TITLE_SHIPPING','Shipping');
define('TEXT_SHIPPING_INFO','Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam interdum feugiat ipsum vehicula sollicitudin. Integer sed lacus eget risus consectetur ullamcorper. Pellentesque rutrum ullamcorper faucibus. Nam porttitor iaculis enim, mattis tristique velit tristique bibendum. ');
define('TITLE_CONFIDENCE','Shop with Confidence');
define('TEXT_CONFIDENCE','Here you can write a few short sentencs about why your customers can buy with conficence from your store. You might also want to outline your payment options here.');
define(PAYMENT_ICON,'payments.png');

> 
> This is what I took out:
> 
> ```
/*bof quick links definitions*/
define('HEADER_TITLE_NEW_PRODUCTS','New Products');
define('HEADER_TITLE_ALL_PRODUCTS','All Products');
define('HEADER_TITLE_SPECIALS','Specials');
define('HEADER_TITLE_SEARCH','Search');
define('HEADER_TITLE_QUICK_LINKS','Quick Links');





/*bof manufacturers definitions*/
define('HEADER_TITLE_MANUFACTURERS','Brands');





/*bof information definitions*/
define('HEADER_TITLE_INFORMATION','Info');
define('TITLE_EZ_PAGES','Useful Links');
define('TITLE_GENERAL','General Info');
define('TITLE_CUSTOMERS','Customers');
define('TITLE_NEWSLETTERS','Newsletters');

Never remove the DEFINE and its CONSTANTS. If you DELETED the above, you need to put them back.

DEFINE statements are edited (not deleted), by simply removing/altering the VARIABLE TEXT in the second set of single quotes.

EG:
CORE VERSION : define('HEADER_TITLE_INFORMATION','Info');
EDIT VERSION : define('HEADER_TITLE_INFORMATION',''); (removes the text from the site)
ALTER TEXT: define('HEADER_TITLE_INFORMATION','More Information'); (CHANGES the text in the site)

12 Apr 2013, 8:51 AM
#17
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Ok does it matter what order I put them back in?

I edited & deleted out a bunch of code pertaining to the tabs I wanted gone in the tpl.mega.menu.php file... that's still ok right?

12 Apr 2013, 8:52 AM
#18
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

Ok does it matter what order I put them back in?
Replace it with a fresh unedited copy

12 Apr 2013, 9:00 AM
#19
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Ok what about editing the tpl.mega_menu.php that was ok right?

12 Apr 2013, 9:06 AM
#20
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

JohnnyScience:

Ok does it matter what order I put them back in?

I edited & deleted out a bunch of code pertaining to the tabs I wanted gone in the tpl.mega.menu.php file... that's still ok right?

That's a different matter...

Generally, you should not DELETE any code. It is far better to COMMENT OUT code that you do not want to be used.

This requires a lot of CARE, because PHP in particular can fall over even if just one quote mark is wrong (or removed).

As you know, in HTML, the COMMENTING OUT takes the form of: <! -- (html code here) -->

In PHP, commenting out can take several forms, depending on WHAT you are commenting out.

Single line:

  if (!isset($_GET['main_page']) || !zen_not_null($_GET['main_page'])) $_GET['main_page'] = 'index';

preceed the line with //

 // if (!isset($_GET['main_page']) || !zen_not_null($_GET['main_page'])) $_GET['main_page'] = 'index';

Several lines:
/* code or
words here */

/*
I dont want these words to affect
the php in any way
so I enclose them in comments
 */
  require('includes/application_top.php');