Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

shamsehgal

Pioneers
  • Posts

    1
  • Joined

  • Last visited

About shamsehgal

  • Birthday 10/12/1988

Profile Information

  • Real Name
    Shyam Segal
  • Gender
    Male
  • Location
    India
  • Interests
    Listening Music, cricket

shamsehgal's Achievements

  1. Hii FF: I got your post today when I was searching internet for the same issue which you have raised out here, but unfortunately I didn't get anything on web. So, I decided to work on this issue at my own and I got success on it. Here I am posting the whole code for your ready reference and use. You can use this code as it is if you wish to or you can change the field names or values as per your requirements: Here we go...... First thing first, you have to create a field under your PRODUCTS table in your shopping cart's database. add the following field: " products_binding " Then create three RADIO BUTTON FIELDS in your ADMIN's CATEGORIES.PHP file. You can use following code: file path: admin/categories.php <tr> <td class="main"><?php echo TEXT_PRODUCTS_BINDINGS; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_radio_field('products_binding', '1', $hc_status) . ' ' . TEXT_PRODUCT_HARDCOVER . ' ' . tep_draw_radio_field('products_binding', '2', $sc_status) . ' ' . TEXT_PRODUCT_SOFTCOVER . ' ' . tep_draw_radio_field('products_binding', '3', $spr_status) . ' ' . TEXT_PRODUCT_SPIRAL; ?> </td> </tr> You may be surprised with the FIELD LABELS i.e. TEXT_PRODUCTS_BINDINGS under first <TD>, and TEXT_PRODUCT_HARDCOVER, TEXT_PRODUCT_SOFTCOVER, TEXT_PRODUCTS_SPIRAL etc. well, put the following code under your ADMIN's CATEGORIES.PHP file at following path: file path: admin/includes/languages/english/categories.php ... Add these four lines at the end of the file before closing php ( ?> ) tag : define('TEXT_PRODUCTS_BINDINGS', 'Binding: '); define('TEXT_PRODUCT_HARDCOVER', 'Hardcover'); define('TEXT_PRODUCT_SOFTCOVER', 'Softcover'); define('TEXT_PRODUCT_SPIRAL', 'Spiral'); After this, you need to get back the values of these three Radio Buttons from database when you edit the particular product. For this we are going to use a switch case to get the exact selected value. Use following code as it is if you have to use exact same fields/values. Put this code at LINE NO.: 488 OR near around the predefined switch case code used for products_status field in ADMIN's CATEGORIES.PHP file: file path: admin/categories.php // CODE TO GET THE PRODUCTS_BINDING FROM THE DATABASE if(isset($pInfo->products_binding)) { switch($pInfo->products_binding) { case '3': $hc_status = false; $sc_status = false; $spr_status = true; break; case '2': $hc_status = false; $sc_status = true; $spr_status = false; break; case '1'; $hc_status = true; $sc_status = false; $spr_status = false; break; } } // CODE TO GET THE PRODUCTS_BINDING FROM THE DATABASE That's all we have to do. But remember one thing, I have not defined the whole process of creating these three Radio Button Fields. You need to put the variable i.e. PRODUCTS_BINDING (use in small case) at so many places under your ADMIN's CATEGORIES.PHP file to get the desired output. To achieve this, you can follow any of the field name e.g. " products_status " by just copying it and then search for that particular field name from head to toe of the file and paste your new field name under each DATABASE QUERY along with it and you surely will get what you want. Hopefully, I am able to help you. If you face any trouble during implementation of all this, then feel free to ask. Cheers Sham
×
×
  • Create New...