Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Location
    Austin, Texas, US
    Posts
    213
    Plugin Contributions
    0

    Default Product with Pre-requisite, No New Customers?

    My client has a particular special product offering for "repeat customers only". At this time, I just have this setup as a separate product with a description that states it is a deal for returning customers, however there are always a few new customers who order it anyway.

    Is there a better way to prevent new customers who have never ordered any product before from purchasing a particular item? Do I need to create a new product type? Perhaps this is where customer groups come in, but in all my Zen projects I have never yet worked with groups so I am not certain.

    I have searched far and wide and can't seem to find any suggestions on this particular need. Any advice appreciated.

    Site details: www.rockbodyfit.com
    Version: 1.3.9
    Pre-req is only that they have purchased a product before and are not a brand new registrant with no prior orders.
    This message brought to you by Jac.
    Happily developing sites with ZenCart since 2003.
    Thank all Zen contributors out there - Buy the manual!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,718
    Plugin Contributions
    6

    Default Re: Product with Pre-requisite, No New Customers?

    You could write a function to validate the product and the customer to check if they have ordered before and if not then prevent checkout ...

    If you look in the header_php.php of the checkout pages, you will see where the validation of the cart is done ... you can add in your validation there as well ...

    The checkout_shipping for example:
    /includes/modules/pages/checkout_shipping/header_php.php

    shows the validation as:
    Code:
    // Validate Cart for checkout
      $_SESSION['valid_to_checkout'] = true;
      $_SESSION['cart']->get_products(true);
      if ($_SESSION['valid_to_checkout'] == false) {
        $messageStack->add('header', ERROR_CART_UPDATE, 'error');
        zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
      }
    You can add your own validation beneath that to check if the customer has had a previous order and if the product is in the cart ... if not, set a message and return them to the cart to remove it or, you can remove it for them ...

    You might also add a validation to the shopping_cart page on the product for when a customer is not logged in or not allowed to checkout with the product ... this could also be done on the product_info page as well ...

    Easy smeazy, eh?
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Jun 2005
    Location
    Austin, Texas, US
    Posts
    213
    Plugin Contributions
    0

    Default Re: Product with Pre-requisite, No New Customers?

    Thanks, Linda, Much appreciated reply.

    Where in this code do I specify the product this applies for? I just want to make sure I don't apply this pre-req to ALL orders in checkout, since that would mean no one could ever place a first-time order for the other products.

    Thanks.
    This message brought to you by Jac.
    Happily developing sites with ZenCart since 2003.
    Thank all Zen contributors out there - Buy the manual!

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    20,981
    Plugin Contributions
    25

    Default Re: Product with Pre-requisite, No New Customers?

    You would test all orders, and only if they have the product in their cart *and* have not bought before would the filter happen.

    It might be fastest to first test for the presence of the product (I think there is a function for it, something like zen_product_in_cart() ); only if this is true do you need to check on the customer's prior orders.

 

 

Similar Threads

  1. Add free product for customers
    By LovejonesBoutique in forum Setting Up Specials and SaleMaker
    Replies: 4
    Last Post: 27 Nov 2009, 09:53 PM
  2. How to inform customers that product A requires Product B?
    By bobanct in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 5 Feb 2009, 06:08 PM
  3. Let customers add there own product
    By tron2871 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 14 Jun 2008, 08:31 PM
  4. product differences for customers
    By gaukler in forum General Questions
    Replies: 6
    Last Post: 5 Dec 2006, 10:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •