Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to make product.tpl as the real first page ?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-25-2006, 12:28 AM
 
Chuchen Chuchen is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 37
 

Default How to make product.tpl as the real first page ?

I would like to sell only one product on a website (one product for one month, one another product for the next month, etc.).

So please, how to make product.tpl as the real first page to show the last and only one product I sell ? This way, my customer could see directly product.tpl page at www.mynextsite.com (I don't like to use a redirection).

I can't find this information on the forum, so thank you very much if it is possible [/b]
__________________
xcart v4.1.1 [MacOS] / x-aom-4.1.1 / x-offers-4.1.1 / x-rma-4.1.1 / X-Magnifier-4.1.1 (and... happy with x-Cart !)
Reply With Quote
  #2  
Old 01-25-2006, 12:37 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default

One way to do this would be, having removed index.html index.php is now your new start page.
Now edit index.php and change home.php to the path of your product.
e.g.

Code:
header("Location: product.php? productid=76&cat=103&page=1&featured");
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #3  
Old 01-25-2006, 09:19 AM
 
Chuchen Chuchen is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 37
 

Default

Thank you for your answer

Unfortunately, I don't want to do redirection. Do you think I can call the product.php page : index.php or home.php ?
__________________
xcart v4.1.1 [MacOS] / x-aom-4.1.1 / x-offers-4.1.1 / x-rma-4.1.1 / X-Magnifier-4.1.1 (and... happy with x-Cart !)
Reply With Quote
  #4  
Old 01-25-2006, 09:38 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

Make a copy of product.php and rename it home.php

In home.php after the include of auth.php put:

$productid = "X";

Where X is the productid of the product you want to display.
Reply With Quote
  #5  
Old 01-25-2006, 11:58 AM
 
Chuchen Chuchen is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 37
 

Default

Thank you very very much Jon, I will try tomorrow
__________________
xcart v4.1.1 [MacOS] / x-aom-4.1.1 / x-offers-4.1.1 / x-rma-4.1.1 / X-Magnifier-4.1.1 (and... happy with x-Cart !)
Reply With Quote
  #6  
Old 01-29-2006, 09:04 AM
 
Chuchen Chuchen is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 37
 

Default

After few tests, it works great ! Thank you again. Now, I'm trying to write a little bit of PHP to get always the last product ID instead of write it each time on the new home.php file.

Do you think it's a good idea ?
__________________
xcart v4.1.1 [MacOS] / x-aom-4.1.1 / x-offers-4.1.1 / x-rma-4.1.1 / X-Magnifier-4.1.1 (and... happy with x-Cart !)
Reply With Quote
  #7  
Old 01-29-2006, 08:07 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

[Removed]
Reply With Quote
  #8  
Old 01-29-2006, 09:35 PM
 
Chuchen Chuchen is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 37
 

Default

Thank you Jon !

I must write your code under "define('OFFERS_DONT_SHOW_NEW',1);
require "./auth.php";" isn't it ?
__________________
xcart v4.1.1 [MacOS] / x-aom-4.1.1 / x-offers-4.1.1 / x-rma-4.1.1 / X-Magnifier-4.1.1 (and... happy with x-Cart !)
Reply With Quote
  #9  
Old 01-29-2006, 09:51 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

[Removed]
Reply With Quote
  #10  
Old 01-29-2006, 09:57 PM
 
Chuchen Chuchen is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 37
 

Default

I've got this message :

"INVALID SQL: 1064 : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE 1 ORDER BY DESC LIMIT 1' at line 1
SQL QUERY FAILURE: SELECT productid from WHERE 1 ORDER BY DESC LIMIT 1

If the page is not updated in a 5 seconds, please follow this link: continue >>"

and after I can read this message on the home.php page :

Access denied !
You are not allowed to access that resource!
Error ID: 33


Maybe the mistake come from the "where 1" ?
__________________
xcart v4.1.1 [MacOS] / x-aom-4.1.1 / x-offers-4.1.1 / x-rma-4.1.1 / X-Magnifier-4.1.1 (and... happy with x-Cart !)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:49 AM.

   

 
X-Cart forums © 2001-2020