Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    2
    Plugin Contributions
    0

    Default Can I add a product for a specific customer?

    I am trying to set ZC up for the following scenario

    I sell digital goods on auction sites.

    When an auction is won I want to then send the winner an email directing him to the product on my ZenCart

    I only enter the product price - or even the whole product - when i know if and how much they won the product for in the auction.

    After following the link i sent them in the email, they arrive at the new products page, click on paypal button and then after payment get the download link.

    I want to do it this way so that it is entered on to the ZC system as an order as i like to keep thing simple and in one place.

    Points to note:
    Obviously the product must only be available to the auction winner, I don't want a site visitor to be able to buy it. I know i could just set the product up as soon as i know it has been sold and then just send them the URL but it will show up in new/featured products and it is possible that some one else could try and buy it

    It's basically an invoice for them to pay but set up as a product on ZC

    Is there any way to achieve this? Hidden product / url, code or coupon that only allows them to buy, way to send an invoice that still puts them in the system?

    Thanks Paul
    Last edited by lesaurus; 13 Apr 2010 at 02:14 PM.

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Can I add a product for a specific customer?

    You are basically on the right track... ie: creating a specific product and putting it in a hidden category. (The CATEGORY is "disabled", but the products inside it are not.)

    As you are discovering, this does not necessarily HIDE the product from SEARCHES, NEW PRODUCT lists or ALL PRODUCT lists...

    So you are going to have to add a "conditional" to the various bits of PHP that govern this.

    I have the solution (as I use this myself on some sites) so bear with me while I look for it.
    20 years a Zencart User

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Can I add a product for a specific customer?

    The FIRST thing to do is set up your "hidden" category.

    Set it up as you would any other category, then "disable" it, by making sure its STATUS icon is red, not green.

    Make a note of its ID number of the category (on the left hand side of the categories manager screen, it shows these ID numbers).

    NOW... you need to add the following CONDITIONAL to a few php files, and in certain places.

    They are all MODULE files

    includes/modules/new_products.php
    includes/modules/upcoming_products.php

    You will see (around lines 22 to 30):

    Code:
    if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
      $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                    p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                               where p.products_id = pd.products_id
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                               and   p.products_status = 1 " . $display_limit;
    Now, add the line I show in RED

    Code:
    if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
      $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                    p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                               from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                               where p.products_id = pd.products_id
                               and p.master_categories_id != '3'
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                               and   p.products_status = 1 " . $display_limit;
    and p.master_categories_id != '3' means: Only list a product if its master category ID number is NOT equal to 3.

    In my example, the category ID = 3, so just insert YOUR category ID number.


    You will be able to create an OVER-RIDE for these files (ie: put the edited files into your CUSTOM folder).

    If you are not familiar with the CUSTOM template system, (over-rides) then it is a good idea to understand this first.
    ----------------------------------------------------------------------

    NEXT... other files that need tweaking are in the PAGES folders, and it should be fairly obvious where other listings will occur where you want the category to be excluded.

    includes/pages/advanced_search_result
    includes/pages/products_all
    includes/pages/products_new


    Inside these folders are the header_php.php files

    For advanced_search_result/header_php.php. around lines 243 to 250, you will see:
    Code:
    $where_str = " WHERE (p.products_status = 1
                   AND p.products_id = pd.products_id
                   AND pd.language_id = :languagesID
                   AND p.products_id = p2c.products_id
                   AND p2c.categories_id = c.categories_id' ";
    Again... add the CONDITIONAL

    Code:
    $where_str = " WHERE (p.products_status = 1
                   AND p.products_id = pd.products_id
                   AND pd.language_id = :languagesID
                   AND p.products_id = p2c.products_id
                   AND p2c.categories_id = c.categories_id
                   AND p.master_categories_id != '3' ";
    ----------------------------------------------------------------------------

    In the following:

    includes/pages/products_all
    includes/pages/products_new


    You need to do the same sort of thing in their header_php.php files:

    Around line 28 or 29, you will see:

    Code:
    WHERE p.products_status = 1
     AND p.products_id = pd.products_id
     AND pd.language_id = :languageID" . $order_by;
    Again, add your conditional

    Code:
    WHERE p.products_status = 1
     AND p.products_id = pd.products_id
     AND pd.language_id = :languageID
     AND p.master_categories_id != '3' " . $order_by;
    -----------------------------------------------------------------

    And that should be it...

    Make BACKUPS of all core files before yoiu edit them.

    ----------------------------------------------------------------

    Now... all you need do is when you have "created your product" send the winning bidder the unique URL to that product... it will be something like:

    http://www.yourwebsite.com/index.php...roducts_id=255

    (as you will see, in my example cPath=3... In yours it will obviously be your own hidden category ID.
    20 years a Zencart User

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Can I add a product for a specific customer?

    Oh ... and remember...

    While the "hidden" category is DISABLED (its status icon is RED)... the products inside it MUST be ENABLED (their status icons must be GREEN).
    20 years a Zencart User

  5. #5
    Join Date
    Apr 2009
    Posts
    2
    Plugin Contributions
    0

    Default Re: Can I add a product for a specific customer?

    Dear Schoolboy,

    What can I say! Thats what I call a comprehensive answer. THANKYOU for your time and effort in answering my query.

    Normally I would probably look for an easier alternative but seeing as you went to so much trouble i would feel guilty if i at least didn't give it ago!

    I'll try tomorrow and let you know how i get on.

    Once again Thankyou

    Best regards Paul

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Can I add a product for a specific customer?

    My system will give you the result you want ... so there is not an "easier" way to do this. In fact, I think my method is probably the "easiest" way to render the contents of a category "invisible" to browser users.

    It is not difficult to implement, as long as you follow my samples and method.
    20 years a Zencart User

 

 

Similar Threads

  1. v154 Free shipping for a specific zone and for ONE specific product?
    By seattleannie in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 7 Jan 2016, 02:15 AM
  2. v151 How can I add a custom category-specific size-chart image to my product pages?
    By rbecq in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 1 Jul 2013, 08:07 AM
  3. v139h How Can I Accommodate Continuously Unique Customer-Specific Product Downloads?
    By Yourvirtualworld in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 23 Mar 2012, 07:15 AM
  4. How to set a specific shipping price for a specific product?
    By mmambou in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 2 Feb 2009, 04:34 PM
  5. Specific Product for one Customer
    By glennnz in forum Setting Up Specials and SaleMaker
    Replies: 9
    Last Post: 4 Aug 2008, 06:37 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