Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Location
    Austin, Texas, US
    Posts
    216
    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.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    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!]
    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!

  3. #3
    Join Date
    Jun 2005
    Location
    Austin, Texas, US
    Posts
    216
    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.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    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. How can I do Pre 0rders for customers?
    By Alexiss in forum General Questions
    Replies: 0
    Last Post: 14 Jul 2011, 07:01 AM
  2. Missing tax on product price at new customers
    By djenojado in forum General Questions
    Replies: 1
    Last Post: 20 Sep 2010, 01:10 PM
  3. Is it possible to password site so it can only be accesses by pre-approved customers?
    By gypsygrrl in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Dec 2009, 06:29 PM

Posting Permissions

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