![]() |
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] |
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"); |
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 ? |
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. |
Thank you very very much Jon, I will try tomorrow :)
|
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 ? |
[Removed]
|
Thank you Jon ! :D
I must write your code under "define('OFFERS_DONT_SHOW_NEW',1); require "./auth.php";" isn't it ? |
[Removed]
|
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" ? |
I'm sorry, it's late at night. This one will work, I promise :D
Code:
$productid = func_query_first("SELECT productid from $sql_tbl[products] WHERE 1 ORDER BY productid DESC LIMIT 1"); |
:D This time I've got this message :
"If the page is not updated in a 5 seconds, please follow this link: continue >> 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 productid DESC LIMIT 1' at line 1 SQL QUERY FAILURE: SELECT productid from WHERE 1 ORDER BY productid DESC LIMIT 1 If the page is not updated in a 5 seconds, please follow this link: continue >>" (sorry to bother you Jon :oops: ) This is the code : Code:
define('OFFERS_DONT_SHOW_NEW',1); |
Don't change this code:
Code:
$sql_tbl[products] |
Everything works great now ! Thank you Jon ! :D
Ah damned, there is a mistake on the top of the home.php page. I can read "If the page is not updated in a 5 seconds, please follow this link: continue >>" 8O |
I've tested my exact code on 4.0.x and it should not cause the problem, there must be something else going on, sorry you're on your own from here.
|
No problem Jon, I will try to see if I can do something about that. Thank you again for help :D
|
All times are GMT -8. The time now is 11:53 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.