Forums / Setting Up Specials and SaleMaker / sale for new-customers only?

sale for new-customers only?

Locked

Views: 3,049

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
22 Sep 2009, 8:45 PM
#1
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

sale for new-customers only?

Hi,
I would like to create a sale for all new customers. Something simple like 10% off everything for being a new customer. Is there a way that I can do this? Thanks in advance for your help.
-Matt

22 Sep 2009, 9:10 PM
#2
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: sale for new-customers only?

Or, can I apply the the discount at the end to total purchase. Again only for first time customers though. I was thinking a coupon code that I send out in the welcome e-mail, but I don't think that will work.

24 Sep 2009, 4:36 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: sale for new-customers only?

Another thought ...

I come to your site and create an account ... I am a first time customer ...

I come to your site and create an account ... but I go away and come back tomorrow ... am I still a First Time Customer?

I come back in a month, am I still a First Time Customer ... until I make my "First Order"?

You could make a sidebox, image or something ... with the Discount Coupon for First Time Customers that only shows for customers that are:

1 Logged in

2 Have never made an order

Seeing this might encourage the "First Order" ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Sep 2009, 4:20 AM
#5
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: sale for new-customers only?

Thank you Stevesh. That is definitely one way of accomplishing what I want.

Ajeh, how would I go about creating a custom side box that only appears for customers that have not ordered yet? That seems like a real good idea too.

Thanks to both you for your help, I really appreciate it.

25 Sep 2009, 8:22 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: sale for new-customers only?

Sideboxes have two peices:
/includes/modules/sideboxes/something.php
/includes/templates/template_default/sideboxes/something.php

For your templates and overrides you would use:
/includes/modules/your_template_dir/sideboxes/something.php
/includes/templates/your_template_dir/sideboxes/something.php

A quick method is using an image that has your coupon code on it for first time customers, meaning they are logged in and have no orders ...

Example would be:
/includes/modules/your_template_dir/sideboxes/coupon_sidebox.php

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: coupon_sidebox.php 2007-05-26 kuroi $
 */

  // test if box should display
  $show_coupon_sidebox = false;

// not logged in hide box
  if ($_SESSION['customer_id'] > 0) {
 // check if first order exists
    global $db;
    $sql = "SELECT orders_id
            FROM " . TABLE_ORDERS . "
            WHERE customers_id = '" . $_SESSION['customer_id'] . "'
            LIMIT 1";
    $chk_first_time = $db->Execute($sql);

    if ($chk_first_time->EOF) {
      // no orders show box
      $show_coupon_sidebox = true;
    } else {
      // found an order hide box
      $show_coupon_sidebox = false;
    }
  } else {
    $show_coupon_sidebox = false;
  }


  if ($show_coupon_sidebox == true) {
      require($template->get_template_dir('tpl_coupon_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_coupon_sidebox.php');
      $title =  BOX_HEADING_COUPON_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
?>

/includes/templates/your_template_dir/sideboxes/tpl_coupon_sidebox.php

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: coupon_sidebox.php 2007-05-26 kuroi $
 */

  $content = '';
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'my_coupon.gif');
  $content .= '</div>';

The image my_coupon.gif would then go into:
/includes/templates/classic/images/my_coupon.gif

For the language file use:
/includes/languages/english/extra_definitions/your_template_dir/coupon_sidebox.php

<?php
/**
 * blank sidebox - allows a blank sidebox to be added to your site
 *
 * @package templateSystem
 * @copyright 2007 Kuroi Web Design
  * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: coupon_sidebox.php 2007-05-26 kuroi $
 */

  define('BOX_HEADING_COUPON_SIDEBOX', 'First Time Customers!');
?>

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Sep 2009, 5:25 AM
#7
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: sale for new-customers only?

I think I messed something up. I thought I followed your directions, but my sidebox is showing the coding. I tried just turning on coupon_sidebox, but then nothing shows up. When I turn on tpl_coupon_sidebox the coding shows up. I have temporarily left it on, so if you want to check it out, it is steelpanstore.com.

While typing this, I just thought about would guests see this sidebox? I am currently looking at my page as a guest, is that maybe why it is not showing up? If that is the problem, I think guests should be able to see the sidebox, don't you?

Thanks again for all your help, you are awesome!!
-Matt

28 Sep 2009, 1:52 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: sale for new-customers only?

To see the sidebox you have to be logged in and not have any orders ...

Check to ensure that you have the files in the right directories ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Sep 2009, 5:30 PM
#9
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: sale for new-customers only?

So I went through I checked everything out, and didn't see any problems in what I copied or the directories that the files are in. When I create a test account to log in with no orders, my page basically disappears. The only thing that shows on the page is the sideboxes that are usually on the left.
These boxes are now centered and there is nothing else besides my header banner. Also, the coupon box I am trying to add in still doesn't show up. Is there any information I could give you that would help out more?
Thanks again for all your help, I am starting to feel like a nuisance.
-Matt

28 Sep 2009, 5:49 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: sale for new-customers only?

If you get the Debug Tool from the Free Software Add Ons that might help identify the problem ...

Sounds like space(s) or blank line(s) in one of your php files before or after the starting and/or closing php brackets ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Sep 2009, 4:03 AM
#11
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: sale for new-customers only?

Thanks, I think I finally got it all figured out. When I copied your code over I missed an initial < on one of the files. Little mistake, big problem! Oh well, got it all fixed now. Thank you so much for all your help!
-Matt

29 Sep 2009, 12:50 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: sale for new-customers only?

Thanks for the update that this worked for you ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Sep 2009, 9:40 PM
#13
kevinp avatar

kevinp

New Zenner

Join Date:
Jul 2008
Posts:
23
Plugin Contributions:
0

Re: sale for new-customers only?

How about a small twist to the requirement?

I'd like to create a unique coupon code for each new customer, and include that code in their shipment. Creating a new code one at a time for each would be too time-consuming.

Is there a way to bulk upload a large batch of coupon codes in advance? Or auto-generate them for each new account registration?

Thanks!

Kevin

30 Sep 2009, 4:28 AM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: sale for new-customers only?

This would take a lot of time to break down the code for customizing it in this manner ...

You may wish to post in the Commercial Help Wanted if you are unable to work out the methods for yourself ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!