Page 9 of 10 FirstFirst ... 78910 LastLast
Results 81 to 90 of 96
  1. #81
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Twitch Restrict Categories by Customer or Group

    Is this something you can add to the base code or are you doing this as a custom job?

  2. #82
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Twitch Restrict Categories by Customer or Group

    Quote Originally Posted by DigitalShadow View Post
    Is this something you can add to the base code or are you doing this as a custom job?
    This would be a custom job. Ideally in the future I'd love to have 'insertion switches' in admin where you could control where various access points become available!
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #83
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Twitch Restrict Categories by Customer or Group

    Has anyone gotten this to work with drop down menus? If you did can you please post the before and after code you used to filter out the restricted categories?

  4. #84
    Join Date
    May 2008
    Posts
    442
    Plugin Contributions
    1

    Default Re: Twitch Restrict Categories by Customer or Group

    Ok I was able to figure it out myself but if there are any coders that verify my code that would be appreciated.

    I modified the following file to get it to work with module "CSS Flyout Menu" /includes/classes/categories_ul_generator.php

    Before:

    PHP Code:
            $categories_query "select c.categories_id, cd.categories_name, c.parent_id
                                            from " 
    TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd
                                            where c.categories_id = cd.categories_id
                                            and c.categories_status=1 " 
    .
                                            
    " and cd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
                                            
    " order by c.parent_id, c.sort_order, cd.categories_name";
            
    $categories $db->Execute($categories_query); 
    After:
    PHP Code:
            $categories_query "select c.categories_id, cd.categories_name, c.parent_id
                                            from " 
    TABLE_CATEGORIES " c, " TABLE_CATEGORIES_CUSTOMERS " ccu, " TABLE_CATEGORIES_DESCRIPTION " cd
                                            where c.categories_id = cd.categories_id
                                            and c.categories_status=1 " 
    .
                                            
    " and cd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                            AND c.categories_id = ccu.categories_id
                                            AND (ccu.customers_cat_group = '" 
    . (int)$_SESSION['customers_cat_group'] . "' OR ccu.customers_cat_group = '0' )
                                              order by c.parent_id, c.sort_order, cd.categories_name"
    ;

            
    $categories $db->Execute($categories_query); 

  5. #85
    Join Date
    Sep 2006
    Location
    North Devon, England, UK
    Posts
    289
    Plugin Contributions
    0

    Default Re: Twitch Restrict Categories by Customer or Group

    Any thoughts on getting this working on zencart 1.5.5?

  6. #86
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Twitch Restrict Categories by Customer or Group

    This module is working great but I'm having an issue on all the product pages (products_all, products_new, specials, featured_products). After doing the following adjustment to the header_php.php file (as instructions):

    PHP Code:
    *****
    includes/modules/pages/products_all/header_php.php
    *****
    change lines 23 34 from this:
      
    $products_all_query_raw "SELECT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id,
                                        p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
                                        p.product_is_always_free_shipping, p.products_qty_box_status,
                                        p.master_categories_id
                                 FROM " 
    TABLE_PRODUCTS " p
                                 LEFT JOIN " 
    TABLE_MANUFACTURERS " m ON (p.manufacturers_id = m.manufacturers_id), " TABLE_PRODUCTS_DESCRIPTION " pd
                                 WHERE p.products_status = 1
                                 AND p.products_id = pd.products_id
                                 AND pd.language_id = :languageID " 
    $order_by;

      
    $products_all_query_raw $db->bindVars($products_all_query_raw':languageID'$_SESSION['languages_id'], 'integer');
      
    $products_all_split = new splitPageResults($products_all_query_rawMAX_DISPLAY_PRODUCTS_ALL);
      
    // bof dynamic filter 1 of 1
      
    include(DIR_WS_MODULES zen_get_module_directory(FILENAME_DYNAMIC_FILTER));

      
    $listing_sql "SELECT DISTINCT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price,
       p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight,
       p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id, m.manufacturers_id"
    ;

      
    $listing_sql .= " FROM " TABLE_PRODUCTS " p LEFT JOIN " TABLE_MANUFACTURERS " m ON (p.manufacturers_id = m.manufacturers_id)" .
       
    " left join " TABLE_PRODUCTS_TO_CATEGORIES " p2c on p.products_id = p2c.products_id" .
       
    " left join " TABLE_PRODUCTS_DESCRIPTION " pd on p.products_id = pd.products_id" .
       (
    $filter_attr == true " join " TABLE_PRODUCTS_ATTRIBUTES " p2a on p.products_id = p2a.products_id" .
       
    " join " TABLE_PRODUCTS_OPTIONS " po on p2a.options_id = po.products_options_id" .
       
    " join " TABLE_PRODUCTS_OPTIONS_VALUES " pov on p2a.options_values_id = pov.products_options_values_id" .
       (
    defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " join " TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " p2as on p.products_id = p2as.products_id " "") : '');

      
    $listing_sql .= " WHERE p.products_status = 1 AND (p.products_date_available IS NULL OR p.products_date_available <= current_date) AND pd.language_id = :languageID " .
       
    $filter " GROUP BY p.products_id " $having $order_by;

      
    $listing_sql $db->bindVars($listing_sql':languageID'$_SESSION['languages_id'], 'integer');
      
    $products_all_split = new splitPageResults($listing_sqlMAX_DISPLAY_PRODUCTS_ALL);
    // eof dynamic filter 1 of 1  


    to this:
      
    $products_all_query_raw "SELECT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id,
                                        p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
                                        p.product_is_always_free_shipping, p.products_qty_box_status,
                                        p.master_categories_id
                                 FROM " 
    TABLE_PRODUCTS " p
                                 LEFT JOIN " 
    TABLE_MANUFACTURERS " m ON (p.manufacturers_id = m.manufacturers_id), 
                                 "
                                    
    TABLE_PRODUCTS_TO_CATEGORIES " p2c
                                    LEFT JOIN " 
    TABLE_CATEGORIES_CUSTOMERS " ccu 
                                    on p2c.categories_id = ccu.categories_id, 
                                    
                                 " 
    TABLE_PRODUCTS_DESCRIPTION " pd
                                 WHERE p.products_status = 1
                                 AND p.products_id = pd.products_id
                                 AND pd.language_id = :languageID 
                   AND p.products_id = p2c.products_id
                   AND p2c.categories_id = ccu.categories_id
                   AND (ccu.customers_cat_group = '" 
    . (int)$_SESSION['customers_cat_group'] . "' OR ccu.customers_cat_group = '0' )
                                 " 
    $order_by;

      
    $products_all_query_raw $db->bindVars($products_all_query_raw':languageID'$_SESSION['languages_id'], 'integer');
      
    $products_all_split = new splitPageResults($products_all_query_rawMAX_DISPLAY_PRODUCTS_ALL); 
    The pages start to do few things incorrect:
    -displays incorrect number of items listed (instead of decreasing the number this one goes up from 635 to 666);
    -repeats items (I think this is why it increases the number of items);
    -messes up the styling of the pages (very bad), this is probably the easiest issue of all to fix since it could be related to the template's grid and css.

    That file section (and the other product pages headers) was already altered to this:

    PHP Code:
    // bof dynamic filter 1 of 1
      
    include(DIR_WS_MODULES zen_get_module_directory(FILENAME_DYNAMIC_FILTER));

      
    $listing_sql "SELECT DISTINCT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price,
       p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight,
       p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id, m.manufacturers_id"
    ;

      
    $listing_sql .= " FROM " TABLE_PRODUCTS " p LEFT JOIN " TABLE_MANUFACTURERS " m ON (p.manufacturers_id = m.manufacturers_id)" .
       
    " left join " TABLE_PRODUCTS_TO_CATEGORIES " p2c on p.products_id = p2c.products_id" .
       
    " left join " TABLE_PRODUCTS_DESCRIPTION " pd on p.products_id = pd.products_id" .
       (
    $filter_attr == true " join " TABLE_PRODUCTS_ATTRIBUTES " p2a on p.products_id = p2a.products_id" .
       
    " join " TABLE_PRODUCTS_OPTIONS " po on p2a.options_id = po.products_options_id" .
       
    " join " TABLE_PRODUCTS_OPTIONS_VALUES " pov on p2a.options_values_id = pov.products_options_values_id" .
       (
    defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " join " TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK " p2as on p.products_id = p2as.products_id " "") : '');

      
    $listing_sql .= " WHERE p.products_status = 1 AND (p.products_date_available IS NULL OR p.products_date_available <= current_date) AND pd.language_id = :languageID " .
       
    $filter " GROUP BY p.products_id " $having $order_by;

      
    $listing_sql $db->bindVars($listing_sql':languageID'$_SESSION['languages_id'], 'integer');
      
    $products_all_split = new splitPageResults($listing_sqlMAX_DISPLAY_PRODUCTS_ALL);
    // eof dynamic filter 1 of 1 
    Please, let me know how I am supposed to change this portion for it to work properly.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

  7. #87
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Twitch Restrict Categories by Customer or Group

    ideasgirl what version of ZC and template are you working with?
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  8. #88
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Twitch Restrict Categories by Customer or Group

    Quote Originally Posted by mattys View Post
    Any thoughts on getting this working on zencart 1.5.5?
    1.55f - Yes.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  9. #89
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Twitch Restrict Categories by Customer or Group

    Quote Originally Posted by marcopolo View Post
    Has anyone gotten this to work with drop down menus? If you did can you please post the before and after code you used to filter out the restricted categories?
    First, I would need to see the code for the drop down you speak of.

    Second, most of the existing filters will work but may need to be customized to work with your particular menu code.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  10. #90
    Join Date
    Aug 2005
    Location
    San Juan, Puerto Rico
    Posts
    1,525
    Plugin Contributions
    9

    Default Re: Twitch Restrict Categories by Customer or Group

    Quote Originally Posted by twitchtoo View Post
    ideasgirl what version of ZC and template are you working with?
    1.5.5f

    The issues were solved.
    IDEAS Girl
    IDEAS Creative Group
    = Your image... our business!
    My contributions: SophyBlue / Sophy Blue-Grey / Mistik / The Bookshelf / Dynamic Sideboxes

 

 
Page 9 of 10 FirstFirst ... 78910 LastLast

Similar Threads

  1. Group Pricing - how can I restrict against certain categories?
    By DodgeGirl in forum Setting Up Categories, Products, Attributes
    Replies: 26
    Last Post: 2 Jun 2011, 09:20 PM
  2. How to restrict access for specific categories to registered customer?
    By tutebarra in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Apr 2011, 03:20 PM
  3. Restrict Customer access to certain products or product categories.
    By henryk in forum Managing Customers and Orders
    Replies: 1
    Last Post: 27 Nov 2008, 08:45 AM
  4. Restrict Ordering Process for One Customer / Group
    By blackpig in forum Managing Customers and Orders
    Replies: 3
    Last Post: 17 Jun 2008, 05:15 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR