Zen Cart Logo
Forums / General Questions / How to make the link point to php file?

How to make the link point to php file?

Locked

Views: 2,520

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
16 Dec 2009, 8:13 AM
#1
andrewmax81 avatar

andrewmax81

New Zenner

Join Date:
Nov 2009
Location:
kuching
Posts:
43
Plugin Contributions:
0

How to make the link point to php file?

Hi All,

i have try on few days already on how to set this link to point to this particular php file.

can any1 give me a tutorial?

Thanks.

My page is https://www.all-in-1-shop.com/test1

my following is broken or haven being created but i wanna know how to set it pointed directed to this particular php file.

About Us, Payment Method, Delivery Method, Order Information, Privacy Policy, New Products, Shopping Instruction.

kindly tell me which command to use and where shall i store the new php file for it to be link.

thank you Very Much

regards,

Andrew

16 Dec 2009, 9:54 AM
#2
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Re: How to make the link point to php file?

You seem to have some mods installed. For those mods, I can't give an answer as I don't know what they are and may not be familiar with them.

For the default Zen Cart pages, here's one way of doing things.

You can point to a particular php file by overriding the specific template file that affects the area containing the links you want to change. You then create the link by using the *zen_href_link() *function. The file name that the zen_href_link() function uses can be looked up in the /includes/filenames.php file.

For example, the following code will point to the Shipping Information page:

<a href="<?php echo zen_href_link(FILENAME_SHIPPING); ?>">The Shipping Information page</a>
16 Dec 2009, 4:40 PM
#3
andrewmax81 avatar

andrewmax81

New Zenner

Join Date:
Nov 2009
Location:
kuching
Posts:
43
Plugin Contributions:
0

Re: How to make the link point to php file?

Hi,

i still cant get it

16 Dec 2009, 4:42 PM
#4
andrewmax81 avatar

andrewmax81

New Zenner

Join Date:
Nov 2009
Location:
kuching
Posts:
43
Plugin Contributions:
0

Re: How to make the link point to php file?

Hi all,

it gave me custom error 404

T_T

can give me in detail? Tnx

17 Dec 2009, 5:09 AM
#5
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Re: How to make the link point to php file?

Ok, let's simplify this.

Which particular link on your site do you want to change? Specifically, is it a link on the top of the page or one at the bottom of the page?

Do you have any mods on your site and have you tried working with Zen Cart templates?

17 Dec 2009, 6:25 AM
#6
andrewmax81 avatar

andrewmax81

New Zenner

Join Date:
Nov 2009
Location:
kuching
Posts:
43
Plugin Contributions:
0

Re: How to make the link point to php file?

Hi,

Both Top and bottom.

and what do u mean by this?

( Do you have any mods on your site and have you tried working with Zen Cart templates? )

let say my file was store at

/includes/templates/classic/shopping_instruction/shopping_instruction.php

and from top the shopping instruction how should i make the link pointed to the above data?

17 Dec 2009, 7:06 PM
#7
andrewmax81 avatar

andrewmax81

New Zenner

Join Date:
Nov 2009
Location:
kuching
Posts:
43
Plugin Contributions:
0

Re: How to make the link point to php file?

andrewmax81:

Hi,

( Do you have any mods on your site and have you tried working with Zen Cart templates? )

ok i get wat u mean by top quote. actually its the original template.
i use the original and change at 1st but now i have my own folder call classic.

19 Dec 2009, 9:57 AM
#8
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Re: How to make the link point to php file?

I think here's what's happening in your case. It seems you are working against the Zen Cart system instead of with it.

Here's what I think you need to know before you can accomplish what you want to do cleanly:

  • Understand the Zen Cart template and override system. It does take some time but will definitely smooth your upgrade path in future. Moreover, you can more easily undo your changes if you make mistakes with your new templates.

  • Understand how to edit the existing Define Pages or create EZ-Pages to place your commonly used contents e.g. Shipping Information.
    Judging from what you said about having created your own template with a "classic" folder, I'm afraid you still haven't grasped the templating and overriding concept yet. What you've effectively done is to make use of the same "Classic" default template that shipped with Zen Cart.

You mentioned creating your shopping cart instruction page in /includes/templates/classic/shopping_instruction/shopping_instruction.php file. If you understand the templating concept, you should actually place your page in one of the relevant folders under* /includes/languages/.../...* folder instead. That way, you can make use of Zen Cart's templating system and allow your store to cater to multiple languages.

Pls don't take it the wrong way that I'm being harsh on you. I'm just pointing out what you can do to save yourself future headaches. I know coz I have made similar mistakes before when I was starting out. :smile:

Ok, I'll cut down on too much theory and prepare something you can download and try on your system for practical purposes in the next post.

19 Dec 2009, 11:00 AM
#9
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Re: How to make the link point to php file?

Here's an Attachment #6794 that I've made that you can put into your own store for trying out what I meant.

To install the template, just copy the contents of "/includes" directory in the zip file to the corresponding directory of your store's (and not admin's) "/includes" directory. After that go to your Admin and switch over to the new template named "My Template" and reset the sideboxes by going to the Tools > Layout Boxes Controller screen. View your Store again and you should see the new template.

The template I created replaces the define pages 2, 3, and 4 with placeholder contents for Payment Method, Delivery Method, and Order Information. It also alters the header for Login to include links to those 3 pages. I've made some changes to the color so you know when you switch over to the other template.

While it may not achieve what you want to do with your current template, it acts as an example for you to understand what I meant with my earlier post on working with the Zen Cart system instead of against it. It also allows you to see what you can do to modify the code to suit your current template.

There are many other ways you can achieve what you want to do e.g. using EZ-Pages or creating customer Define Pages. You can experiment further after you're familiar with Zen Cart's templating and override system.

22 Dec 2009, 8:17 AM
#10
andrewmax81 avatar

andrewmax81

New Zenner

Join Date:
Nov 2009
Location:
kuching
Posts:
43
Plugin Contributions:
0

Re: How to make the link point to php file?

Hi,

Is this wat u wanted me to do?

kindly revert to me thanks.

24 Dec 2009, 12:16 PM
#11
canopy avatar

canopy

Totally Zenned

Join Date:
Oct 2006
Posts:
625
Plugin Contributions:
0

Re: How to make the link point to php file?

Yes, do take a look and try out the template I created to get an understanding of how you should create an override and an example of how to link to files properly.