Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Oct 2006
    Posts
    170
    Plugin Contributions
    0

    Default Adding Options to the admin 'Add/Edit Product' Page

    Hi All,

    Now I am trying to modify the 'Add/Edit Product' page in the admin area. I realize that the front-end <form> elements will need to be added in 'admin/product.php' but I'm not sure where to modify the query to update the database properly. Basically I would like to add this option:

    Code:
    Require 18+ Notice? <select name="reqnotice"><option value="1">Yes</option><option value="0">No</option></select>
    And then modify the INSERT/UPDATE query accordingly:

    PHP Code:
    $sql "UPDATE... legalnotice='$reqnotice'"
    Can anyone direct me as to where to make the query modifications?

  2. #2
    Join Date
    Oct 2006
    Posts
    170
    Plugin Contributions
    0

    Default Re: Adding Options to the admin 'Add/Edit Product' Page

    Well I wasn't able to figure out how to add new product fields to the 'Add/Edit Product' pages, so I went ahead and created a custom admin page that contains the functionality I need. In case there is anyone else out there who wants to do this, I thought I would post some info about how I went about this -

    Here is the shell of an admin page, think of this as the 'blank slate' you can build new admin pages from. Just copy/paste this file, save it as 'whatever.php' and then add your custom code appropriately:

    PHP Code:
    <?php require('includes/application_top.php'); ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET?>">
    <title>Page Title Here</title>
    <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
    <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
    <script language="javascript" src="includes/menu.js"></script>
    <script language="javascript" src="includes/general.js"></script>
    </head>
    <body onLoad="init()">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES 'header.php'); ?>
    <!-- header_eof //-->

    <!-- body //-->
    <!-- body_eof //-->

    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES 'footer.php'); ?>
    <!-- footer_eof //-->
    <br>
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES 'application_bottom.php'); ?>
    After you've created the admin page content, you'll need to add it to the admin links menu. This can be done by editing any of the following files which are located in 'admin/includes/boxes/':

    PHP Code:
    <?php

      
    require(DIR_WS_BOXES 'configuration_dhtml.php');
      require(
    DIR_WS_BOXES 'catalog_dhtml.php');
      require(
    DIR_WS_BOXES 'modules_dhtml.php');
      require(
    DIR_WS_BOXES 'customers_dhtml.php');
      require(
    DIR_WS_BOXES 'taxes_dhtml.php');
      require(
    DIR_WS_BOXES 'localization_dhtml.php');
      require(
    DIR_WS_BOXES 'reports_dhtml.php');
      require(
    DIR_WS_BOXES 'tools_dhtml.php');
      require(
    DIR_WS_BOXES 'gv_admin_dhtml.php');
      require(
    DIR_WS_BOXES 'extras_dhtml.php');

    ?>
    Each one of the boxes represents a top-level admin category. For my purposes, I needed to add the link under the 'Catalog' drop-down, so I edited the 'admin/includes/boxes/catalog_dhtml.php' file and added the following line:

    PHP Code:
      $za_contents[] = array('text' => 'Link Text Goes Here''link' => zen_href_link('yourfile.php''''NONSSL')); 
    You can copy/paste that line anywhere in the array definitions, and just replace the 'Link Text Goes Here' with the link name you want, and the 'yourfile.php' with the admin page you created.

    This might be 101 stuff that most of you already know, but thought I would share my findings anyway.

 

 

Similar Threads

  1. Adding Aditional Images via Admin Add Product Page
    By rbarbour in forum Addon Admin Tools
    Replies: 14
    Last Post: 8 Sep 2019, 05:25 AM
  2. Adding a link to product page into the admin's product listing.
    By thebigkick in forum Customization from the Admin
    Replies: 1
    Last Post: 16 May 2012, 07:02 PM
  3. Trouble adding Product description in the admin orders page
    By neit in forum Managing Customers and Orders
    Replies: 2
    Last Post: 19 Mar 2010, 12:50 PM
  4. Adding button by the side of attribute options in product page
    By himal in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 24 Feb 2010, 12:54 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