Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Print "Vacation Message" on Home index page ?
Author « Topic »  

ITZAP
Ecommerce Template Guru

Australia
1016 Posts

Posted - 09/05/2017 :  16:23:44  
With regard to the On Vacation Message feature introduced in major release v6.7.0, which is a good idea, I was wondering if there might be a some simple PHP/ASP code snippet we can use to print the Vacation Message on the website Home index page, same as it currently appears on the cart page ?

Maybe something like ...
<?php if(!empty($vacationmessage)) print $vacationmessage ?>
which does not work, but you get the idea ?

Gary

Andy
ECT Moderator

95440 Posts

Posted - 09/05/2017 :  23:39:04  
Hi Gary

There isn't a feature for that - at least I don't believe there is but I'll double check for you.

Andy

Please feel free to review / rate our software

Vince
Administrator

42692 Posts

Posted - 09/06/2017 :  01:19:10  
Hi Gary
You'd have to do something like this...

<?php
include "vsadmin/db_conn_open.php";
include "vsadmin/inc/languagefile.php";
include "vsadmin/includes.php";
include "vsadmin/inc/incfunctions.php";
$result=ect_query('SELECT onvacation,vacationmessage FROM admin WHERE adminID=1') or ect_error();
if($rs=ect_fetch_assoc($result)){
if($rs['onvacation']!=0){
print '<div class="ectwarning" style="text-align:center;font-size:1.3em;padding:16px">' . $rs['vacationmessage'] . '</div>';
}
}
?>

Of course if the include files are already in the page you don't have to include them again.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

ITZAP
Ecommerce Template Guru

Australia
1016 Posts

Posted - 09/06/2017 :  19:29:02  
Oh wow, that works a treat, thanks so much Andy and Vince

------------------------------------------------
For other ECT Users who may want to add the Vacation Message to other store pages, here is the method I used.

(1) Create a file named vacation-message.php containing this code:

<?php $result=ect_query('SELECT onvacation,vacationmessage FROM admin WHERE adminID=1') or ect_error();
if($rs=ect_fetch_assoc($result)){
if($rs['onvacation']!=0){
print '<div class="ectwarning">' . $rs['vacationmessage'] . '</div>';
}} ?>


(2) On index.php, or any other store pages whatsoever, inside <body> (and whatever div) at the exact position where you want the Vacation Message to appear (when activated), add this code:
<?php include_once("vacation-message.php") ?>
(3) Upload those 2 files to server and test.
------------------------------------------------

Vince, can I respectfully suggest that in the inccart.php file at Line 5809, we don't want the red inline styling code at all:
print '<div class="ectwarning" style="text-align:center;font-size:1.3em;padding:16px">';
Because we can apply all the CSS styles we like to div.ectwarning

And under Main Settings where we enter the Vacation Message, we can use whatever inline CSS styling desired there as well, like:

<p style="font-size: 110%"><strong>Our store is closed for the Christmas and New Year Break</strong>.</p>
<p>We will be open for business again on Monday 4th January.</p>


Thanks once again for your wonderful support !

Gary

WaltG
Ecommerce Template Expert

USA
845 Posts

Pre-sales questions only
(More Details...)

Posted - 03/29/2018 :  16:04:55  
Is the code for ASP pages or is it needed. I need to set this up today on my website.


Walt

www.rustystumps.com
Manufacturer of fine scale model railroad kits and detail parts

Vince
Administrator

42692 Posts

Posted - 03/30/2018 :  01:25:22  
Hi Walt
Sure, this will do the same for ASP

<%
Set cnnv=Server.CreateObject("ADODB.Connection")
Set rsv=Server.CreateObject("ADODB.RecordSet")
cnnv.open sDSN
rsv.open "SELECT onvacation,vacationmessage FROM admin WHERE adminID=1",cnnv,0,1
if NOT rsv.EOF then
if rsv("onvacation")<>0 then print "<div class=""ectwarning"">" & rsv("vacationmessage") & "</div>"
end if %>

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

WaltG
Ecommerce Template Expert

USA
845 Posts

Pre-sales questions only
(More Details...)

Posted - 03/31/2018 :  09:18:02  
Thanks Vince, That worked, once I figured out where to put it.

Placed it at the head of both the Products and Product Detail page so that is shows up all the way down the line.

Now I just need to remember where it is to delete it when need be. [laugh]


Walt

www.rustystumps.com
Manufacturer of fine scale model railroad kits and detail parts

dbdave
ECT Moderator

USA
10385 Posts

Posted - 03/31/2018 :  09:50:06  
Hi Walt, I don't think you will need to delete it, but rather turn off the feature in your admin.
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000