X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Enabling Smarty on non x-cart pages of site (https://forum.x-cart.com/showthread.php?t=1807)

Cameron 03-08-2003 11:14 AM

Enabling Smarty on non x-cart pages of site
 
In asking the question in this thread: http://forum.x-cart.com/viewtopic.php?p=10049
it occurs to me that maybe what I need to do is to enable smarty on all of the non x-cart pages of my site so that I can include smart templates.

Can anybody point me to a resource on how to do this? I have several site pages that I want to have *outisde* of x-cart, but I still want somebody viewing those pages to see their menu_cart.tpl so they know what is in their cart.

I just need all of my pages to show the menu_cart.tpl news.tpl auth.tpl etc, *even* if they're not in the /xcart/ directory.

I *really* don't want to use a page redirect to take somebody straight into /store/customer/home.php when they come to www.mydomain.com/
BUT if that is the only way to make it work, then I will.

If that is my only solution, is there a way to make the page stay as mydomain.com/index.php instead of redirecting? I'm using this code:

<?php
Header("Location: /store/customer/home.php"); exit();
?>

Which changes the URL to /store/customer/home.php -- I'd like for the public (and *especially* the SE spiders) to think that they are seeing mydomain.com/index.php

Thanks,
Cameron

Cameron 03-08-2003 05:40 PM

I decided that I needed to just get this done and not worry about what directory the files are in. They're not over two directories deep, so the SE spiders shouldn't pooh on the site. BUT I also knew I didn't want to have a help.php?section= type of link since spiders hate question marks, and the HTML catalog appears to only be for products.

So here was my solution. Hopefully it will help other people, too.

I opened /store/customer/home.php and saved it as:

/store/customer/choose.php

Then I Modified:
Quote:

#
# Assign Smarty variables and show template
#

$smarty->assign("main","choose");
$smarty->assign("location",$location);
$smarty->display("customer/home.tpl");

(only the first $smarty variable is changed from the original)

Next I went into store/skin1/customer/home_main.tpl and added:

Quote:

{elseif $main eq "choose"}
{include file="customer/main/choose.tpl"}


Then finally, created customer/main/choose.tpl based on welcome.tpl

Now I have /store/customer/choose.php with all of my x-cart .tpl files in it. It's not the ideal solution of having choose.php be in my root foler, but it works.

Cameron


All times are GMT -8. The time now is 03:37 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.