Okay ... so let's see if I wrote this right ...
1 To add your new field to the table:
products
Run this in the Tools ... Install SQL Patches ...
ALTER TABLE products ADD COLUMN product_is_meat tinyint(1) NOT NULL default '0';
2 Customize the file:
/your_admin/includes/modules/product/collect_info.php
around line 40:
'products_price_sorter' => '0',
'master_categories_id' => ''[B],
'product_is_meat'[/B]
);
around line 59 add:
p.products_discount_type, p.products_discount_type_from,
p.products_price_sorter, p.master_categories_id[B],
p.product_is_meat[/B]
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
[/CODE
around line 158 add:
[CODE]
[B]// Product is Meat
if (!isset($pInfo->product_is_meat)) $pInfo->product_is_meat = '0';
switch ($pInfo->product_is_meat) {
case '0': $in_product_is_meat = false; $out_product_is_meat = true; break;
case '1': $in_product_is_meat = true; $out_product_is_meat = false; break;
default: $in_product_is_meat = false; $out_product_is_meat = true;
}
[/B]// set image overwrite
around 350 add:
[B] <tr>
<td class="main"><?php echo TEXT_PRODUCT_IS_MEAT; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_radio_field('product_is_meat', '1', $in_product_is_meat) . ' ' . TEXT_YES . ' ' . zen_draw_radio_field('product_is_meat', '0', $in_product_is_meat) . ' ' . TEXT_NO . ' ' . ($pInfo->product_is_meat == 1 ? '<span class="errorText">' . TEXT_PRODUCT_IS_MEAT_EDIT . '</span>' : ''); ?></td>
</tr>
[/B] <tr>
<td colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
</tr>
3 Customize the file:
/your_admin/includes/modules/product/preview_info.php
and add the code around line 40:
$product = $db->Execute("select p.products_id, pd.language_id, pd.products_name,
pd.products_description, pd.products_url, p.products_quantity,
p.products_model, p.products_image, p.products_price, p.products_virtual,
p.products_weight, p.products_date_added, p.products_last_modified,
p.products_date_available, p.products_status, p.manufacturers_id,
p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
p.product_is_free, p.product_is_call, p.products_quantity_mixed,
p.product_is_always_free_shipping, p.products_qty_box_status, p.products_quantity_order_max,
[B]p.product_is_meat,[/B]
p.products_sort_order
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_id = pd.products_id
and p.products_id = '" . (int)$_GET['pID'] . "'");
4 Customize the file:
/your_admin/includes/modules/update_product.php
and add the code around line 50:
'products_discount_type_from' => zen_db_prepare_input($_POST['products_discount_type_from']),
'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter'])[B],
'product_is_meat' => zen_db_prepare_input((int)$_POST['product_is_meat'])[/B]
);
5 Customize the code in:
/includes/classes/shipping.php
$zc_large_weight= $za_large_array[1];
[B]// bof: add 6lbs per 4 items
global $cart;
$item_count = $_SESSION['cart']->in_cart_check('product_is_meat','1');
//$item_count = floor(($item_count/4));
$item_count = ceil(round( ($item_count/4), 1) );
$zc_tare_weight = $item_count * 6;
$zc_large_weight = $item_count * 6;
// eof: add 6lbs per 4 items
[/B]
// SHIPPING_BOX_WEIGHT = tare
6 Create the new file:
/your_admin/includes/languages/english/extra_definitions/extra_meat_product.php
[B]<?php
define('TEXT_PRODUCT_IS_MEAT', 'Product is Meat');
define('TEXT_PRODUCT_IS_MEAT_EDIT', 'PRODUCT IS MEAT, EXTRA SHIPPING');[/B]
Be sure to backup everything before you make any of these changes ...