Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2013
    Posts
    615
    Plugin Contributions
    0

    Default categories.php changes

    PHP 7.2.6 zen v 1.56c, alot of plugins
    i am trying to merge my admin categories.php changes from v 1.51 into 1.56c and need help, i dont know where this part goes
    Code:
    // attributes copy to category
            case 'update_attributes_copy_to_category':
                $copy_attributes_delete_first = ($_POST['copy_attributes'] == 'copy_attributes_delete' ? '1' : '0');
                $copy_attributes_duplicates_skipped = ($_POST['copy_attributes'] == 'copy_attributes_ignore' ? '1' : '0');
                $copy_attributes_duplicates_overwrite = ($_POST['copy_attributes'] == 'copy_attributes_update' ? '1' : '0');
                $copy_to_category = $db->Execute("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id='" . (int) $_POST['categories_update_id'] . "'");
                while (!$copy_to_category->EOF) {
                    zen_copy_products_attributes($_POST['products_id'], $copy_to_category->fields['products_id']);
                    $copy_to_category->MoveNext();
                }
                //      die('CATEGORIES - I would copy Product ID#' . $_POST['products_id'] . ' to a Category ID#' . $_POST['categories_update_id']  . ' - Existing attributes ' . $_POST['copy_attributes'] . ' Total Products ' . $copy_to_category->RecordCount());
    
                $_GET['action'] = '';
                zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['products_id'] . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')));
                break;
            case 'new_product':
                if (isset($_GET['product_type'])) {
                    // see if this category is restricted
                    $pieces = explode('_', $_GET['cPath']);
                    $cat_id = $pieces[sizeof($pieces) - 1];
                    //	echo $cat_id;
                    $sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . (int) $cat_id . "'";
                    $product_type_list = $db->Execute($sql);
                    $sql = "select product_type_id from " . TABLE_PRODUCT_TYPES_TO_CATEGORY . " where category_id = '" . (int) $cat_id . "' and product_type_id = '" . (int) $_GET['product_type'] . "'";
                    $product_type_good = $db->Execute($sql);
                    if ($product_type_list->RecordCount() < 1 || $product_type_good->RecordCount() > 0) {
                        $url = zen_get_all_get_params();
                        $sql = "select type_handler from " . TABLE_PRODUCT_TYPES . " where type_id = '" . (int) $_GET['product_type'] . "'";
                        $handler = $db->Execute($sql);
                        zen_redirect(zen_href_link($handler->fields['type_handler'] . '.php', zen_get_all_get_params()));
                    } else {
                        $messageStack->add(ERROR_CANNOT_ADD_PRODUCT_TYPE, 'error');
                    }
                }
                break;
        }
        if ($action != 'new_category') {
            $categery_id = $_GET['cID'];
            $cal_sql = "select calculator_mode from " .TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" .$categery_id. "'";
            $categ_ar = $db->Execute($cal_sql);
            $cal_modes = $categ_ar->fields['calculator_mode'];
            $cal_array[] = array('id' => 0, 'text' => 'None');
            $cal_array[] = array('id' => 1, 'text' => 'Calculator 1');
            $cal_array[] = array('id' => 2, 'text' => 'Calculator 2');
        } else {
            $cal_array[] = array('id' => 0, 'text' => 'None');
            $cal_array[] = array('id' => 1, 'text' => 'Calculator 1');
            $cal_array[] = array('id' => 2, 'text' => 'Calculator 2');
        }
    }
    
    // check
    
    // check if the catalog image directory exists
    if (is_dir(DIR_FS_CATALOG_IMAGES)) {
        if (!is_writeable(DIR_FS_CATALOG_IMAGES))
            $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error');
    } else {
        $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error');
    }
    ?>

  2. #2
    Join Date
    Jan 2013
    Posts
    615
    Plugin Contributions
    0

    Default Re: categories.php changes

    only the part in red

  3. #3
    Join Date
    Jul 2012
    Posts
    14,362
    Plugin Contributions
    17

    Default Re: categories.php changes

    From the looks of it, this may be something to add in admin/category_product_listing.php?

    Perhaps could explain more about where this intended to be seen/used?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  4. #4
    Join Date
    Jan 2013
    Posts
    615
    Plugin Contributions
    0

    Default Re: categories.php changes

    this allows me to edit a category and place a flag of do you want to use a flooring calculator on this product? none or calculator 1 or calculator 2. and than on product page it looks at the flag and show proper calculator

  5. #5
    Join Date
    Jan 2013
    Posts
    615
    Plugin Contributions
    0

    Default Re: categories.php changes

    from my live site v1.51
    Name:  Screenshot_2019-10-10 Flooring Tools Installation Supplies jnsflooringandsupplies com.jpg
Views: 15
Size:  4.8 KB
    ther was other code changes that i found a spot for, just this 1 is different
    Last edited by jimmie; 10 Oct 2019 at 01:08 PM.

 

 

Similar Threads

  1. v155 Changes to index.php
    By abreslin in forum General Questions
    Replies: 5
    Last Post: 3 Oct 2018, 02:12 PM
  2. changes to index.php
    By charliepingpong in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 29 Oct 2011, 06:47 AM

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