Zen Cart Logo
Forums / General Questions / Bypass Template Decoration

Bypass Template Decoration

Locked

Views: 1,086

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
12 Aug 2009, 12:50 PM
#1
maxmanders avatar

maxmanders

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Bypass Template Decoration

Let's say I want to provide a cut down version of the shop for e.g. a call center. I want to create some basic pages to create a customer, add an order, checkout etc. I would like to do this outwith the standard templating structure. How would I go about creating pages etc without using the standard templates, and effectively writing my own raw HTML, controllers, CSS etc?

12 Aug 2009, 12:55 PM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Bypass Template Decoration

Why are you using Zen Cart for the project if you don't want the structure provided?

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

12 Aug 2009, 1:01 PM
#3
maxmanders avatar

maxmanders

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Re: Bypass Template Decoration

We currently use Zen Cart and that all works fine. However, we will soon be introducing a call center operation where customers can phone up to place orders. I will need to be able to create new customers/orders as well as creating new orders for existing customers of our Zen Cart install. Therefore, I thought it made sense to make use of the infrastructure and data already provided by our Zen Cart install. However, this application/module will not be used by customers, nor will it be used by 'admins'; rather it will be used by a third party. Therefore, I want to provide a different interface to the normal shop, while providing some of the same functionality, as well as some new functionality.

12 Aug 2009, 1:16 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Bypass Template Decoration

So what you want is a new, simple and clean, template for your call center. "Template" doesn't mean fancy, it means the interface you use to present the workings to the user.

12 Aug 2009, 1:23 PM
#5
maxmanders avatar

maxmanders

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Re: Bypass Template Decoration

So should I just do a fresh Zen Cart install, pointing to the same database, and create a different template?

12 Aug 2009, 1:36 PM
#6
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Bypass Template Decoration

Ah, now the idea is clearer to me.

Why don't use just use some of the free software add ons available in your existing Zen Cart? Sounds like you need Admin Profiles and a couple of others. Give me a minute and I'll make up a tentative list.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

12 Aug 2009, 1:40 PM
#7
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Bypass Template Decoration

Look into these. They may help you do what you want.

Admin Profiles
Admin Profiles is a user access control system for the Admin part of your site, allowing you to turn menus on and off and grant or disable access to specific Admin functions for each user.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_41&products_id=86

Add Customers from Admin
Allows admin to manually add a customer to the database and optionally send them a welcome e-mail which includes their password.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_41&products_id=454

Admin login as customer
This module is for logging in and placing an order as a customer. It is extremly handy if you process phone orders as well as internet orders. It allows you to login to your admin interface look up a customer and click an buttom "Place Order" button and it automatically opens a new browser window to the front side of your side with the customer logged in so you may take their order.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_41&products_id=829

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

12 Aug 2009, 1:40 PM
#8
maxmanders avatar

maxmanders

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Re: Bypass Template Decoration

I think what I'll do is create all the new pages via overrides. These will essentially be the same as the existing pages, but with some tweaks. I can then add some checks to header.php for each page for my custom authentication scheme. I don't think I can run multiple templates, so I'll add this to the existing override directories we have, and just use PHP to switch out the CSS etc depending on the page name.

12 Aug 2009, 1:42 PM
#9
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Bypass Template Decoration

I think you can achieve what you want with the add ons I listed earlier and not have to reinvent the wheel.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

12 Aug 2009, 1:46 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: Bypass Template Decoration

Actually, people have developed template switcher mods, and you should be able to have the call center operators set up to use their own template if you want. Search the forum for discussions of this.

But yes, as long as the mods Afo posted will cover your needs, you probably don't need to mess around more.

12 Aug 2009, 1:48 PM
#11
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Bypass Template Decoration

Am I missing something here? What does this have to do with the template? Isn't the goal to enable users to receive calls from customers and add the customer and order information to the Zen Cart database?

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

12 Aug 2009, 1:53 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: Bypass Template Decoration

A custom template with added functions/pages built in could be used. The mods you posted (accessible only to those authorized) would be the easiest way to do it.

12 Aug 2009, 1:56 PM
#13
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Bypass Template Decoration

gjh42:

A custom template with added functions/pages built in could be used. The mods you posted (accessible only to those authorized) would be the easiest way to do it.

Thanks. I thought I was losing it.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

12 Aug 2009, 2:25 PM
#14
maxmanders avatar

maxmanders

New Zenner

Join Date:
Jul 2009
Posts:
12
Plugin Contributions:
0

Re: Bypass Template Decoration

Sounds good - I think after reading through the forums and the source code I've got a better idea of how the overrides system works etc. However, I'll want to selectively toggle the other page decoration in the template based on the page name, i.e. if $_GET['main_page']=foo, then in tpl_header.php I'll set $flag_disable_header = true. Is there a more correct way to check the page name, or do I just check the query string?

12 Aug 2009, 3:34 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Bypass Template Decoration

$current_page_base will also give you the page name.
tpl_main_page.php has plenty of examples in the comments at the top.

I haven't used those admin mods afo suggested, but if they work in admin, you won't have the store template anyway, and ones that work in the store will probably be using the same pages as regular customers.