Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Help Needed for Design Requirement Rate Topic   - - - - -

 
  • widget
  • Junior Member
  • Members
  • Join Date: 22-Nov 07
  • 21 posts

Posted 06 January 2008 - 03:13 AM #1

Prior to purchasing cs-cart, I had advertising flyers created telling customers to go to a specific folder in my domain name (e.g. is says go to www.nhallmark.com/coupon). In my existing site, I have a 'coupon' folder with an 'index.asp' member, so when the customer types in the above address, it brings up the index.asp page in the coupon folder.

Since this advertising is out in the public, I will need to handle this situation once I convert over to cs-cart. My question is, how do I do this?

I have at least two major problems:

1) I can create a new row in table cscart_language_values and put in my needed HTML (similar to the text_welcome row containing the home page HTML put in while in the Site Layout page). However, the skins\basic\customer\welcome.tpl needs to be modified to include some type of conditional to retrieve my new row instead of $lang.text_welcome. I am not sure how I would do this.

2) I think that I will need an index.php located in the coupon folder, but I do not know what I need to put in this php file. I copied the existing index.php from my root directory into my coupon folder and changed line 27 from require './prepare.php'; to require '../prepare.php'; and line 41 from require './init.php'; to require '../init.php'; so that it picks up these files from the root directory. However, I think that I will have to set some type of variable here, so that the conditional in the welcome.tpl above can work properly.

Once everything is working properly, the page displayed to the customer should look identical to my home page, except that is will show my new HTML instead of the HTML found in text_welcome.

I have several situations like this, so I will be creating multiple folders under my root once I get the first case working.
Gary
Cs-Cart v1.3.5 SP2

 
  • widget
  • Junior Member
  • Members
  • Join Date: 22-Nov 07
  • 21 posts

Posted 06 January 2008 - 03:14 PM #2

OK, for those who are interested, here is the solution:

1) In welcome.tpl, I added a new smarty variable called special_folder to use in a conditional to see if a new message needs to be displayed. It now looks like this:

{* $Id: welcome.tpl 3587 2007-08-07 15:00:15Z angel $ *}

{if $mode ne "catalog"}
<div class="mainbox-title">{$lang.welcome}</div>
{if $special_folder > ' '}
<div class="mainbox-body" align="justify">{$lang.$special_folder}</div>
{else}

<div class="mainbox-body" align="justify">{$lang.text_welcome}</div>
{/if}
{else}

{include file="categories_pages/categories_multicolumns.tpl" categories=$root_categories}

{/if}
<br />


2) I copied index.php to my new folder and modified it by adding an additional '.' in front of ./prepare.php and ./init.php. I also added a new line to define the new smarty variable as follows:

require '../prepare.php';
if (!empty($html_catalog)) {
define ('NO_SESSION', true);
}
require '../init.php';
$smarty->assign('special_folder', 'Coupon_Text');


3) I inserted a new row into cscart_language_values with name=Coupon_Text and value= the HTML that I want to display.

I can now define as many new folders as I need. I just copy the index.php to the new folder, change the value in the smarty variable and insert a new row with the proper HTML!
Gary
Cs-Cart v1.3.5 SP2

 
  • storm
  • Senior Member
  • Members
  • Join Date: 26-Sep 07
  • 126 posts

Posted 06 January 2008 - 04:56 PM #3

Thanks for posting that. Can I ask are you then posting the coupon code on that page or are you able to automatically add it to their order once they hit that page.
Version 1.3.5 sp1

 
  • widget
  • Junior Member
  • Members
  • Join Date: 22-Nov 07
  • 21 posts

Posted 07 January 2008 - 01:14 PM #4

The coupon was meant for local customers only. They are the only ones who know to go to the coupon page. The HTML on the coupon page allows the recipient of the advertising to enter a code printed on the ad, then Javascript takes that code and pops up a coupon that can be printed and taken to our brick and morter store.

The Javascript was already written for my old site so it was a simple matter to make a few very minor changes to make it work in my cs-cart site.
Gary
Cs-Cart v1.3.5 SP2

 
  • storm
  • Senior Member
  • Members
  • Join Date: 26-Sep 07
  • 126 posts

Posted 07 January 2008 - 04:59 PM #5

I see, thanks.
Version 1.3.5 sp1