Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default Disable a category and choose the products status the same as enabling the category

    Enabling a category offers a choice of disabling, enabling or not changing the status of the products therein.
    Disabling a category offers no choice..all products therein are disabled globally.

    Looking at the case 'setflag_categories' code in admin/categories.php and simply copying the code from the 0/disable else clause to the 1/enable clause offers these options with seemingly no ill effects.

    Can anyone confirm that there is no reason why the options should not be available for a category disable operation?

    thanks
    Steve
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  2. #2
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default Re: Disable a category and choose the products status the same as enabling the catego

    So for completeness. this is the "mod" I did.

    In admin/categories.php, there is a test if the category is active or not.
    An inactive category has the radio button options displayed to choose the product status when its activated, but the active does not.

    So,
    change
    PHP Code:
    if ($cInfo->categories_status == '1') {
          
    $contents[] = array('text' => '<br />' TEXT_PRODUCTS_STATUS_INFO ' ' TEXT_PRODUCTS_STATUS_OFF zen_draw_hidden_field('set_products_status_off'true));
        } else {
          
    $contents[] = array('text' => '<br />' TEXT_PRODUCTS_STATUS_INFO '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_on'true) . ' ' TEXT_PRODUCTS_STATUS_ON '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_off') . ' ' TEXT_PRODUCTS_STATUS_OFF '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_nochange') . ' ' TEXT_PRODUCTS_STATUS_NOCHANGE);
        } 
    to
    PHP Code:
    if ($cInfo->categories_status == '1') {
          
    $contents[] = array('text' => '<br />' TEXT_PRODUCTS_STATUS_INFO '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_on') . ' ' TEXT_PRODUCTS_STATUS_ON '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_off') . ' ' TEXT_PRODUCTS_STATUS_OFF '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_nochange'true) . ' ' TEXT_PRODUCTS_STATUS_NOCHANGE);
        } else {
          
    $contents[] = array('text' => '<br />' TEXT_PRODUCTS_STATUS_INFO '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_on'true) . ' ' TEXT_PRODUCTS_STATUS_ON '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_off') . ' ' TEXT_PRODUCTS_STATUS_OFF '<br />' .
          
    zen_draw_radio_field('set_products_status''set_products_status_nochange') . ' ' TEXT_PRODUCTS_STATUS_NOCHANGE);
        } 
    You can move the ", true" wherever you want to make that the default option.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

 

 

Similar Threads

  1. Disable/Hide Category and not the products
    By ivogue in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 20 Dec 2018, 07:41 PM
  2. Replies: 1
    Last Post: 24 Mar 2013, 06:55 PM
  3. v150 how to call the product arranged by the id in the same category?
    By llsilver in forum Addon Templates
    Replies: 0
    Last Post: 10 Feb 2012, 02:16 PM
  4. multiple products in the same category with the same weight.
    By highlander in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 30 May 2007, 06:46 PM
  5. Sub-Categories and Products in the same Category
    By SandyCedars in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 23 Apr 2007, 04:39 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