This shows you the differences between two versions of the page.
tutorials:zencartmods:tabs.html [2011/08/11 15:09] daigo created |
tutorials:zencartmods:tabs.html [2016/01/28 18:05] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Theres a few mods out there like [[http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=924|this one]] that let your zen cart products have tabs. We needed something slightly more cutom (we have some weird tabs) we made a simple mod for ourselves. | ||
- | ==== DB changes ==== | ||
- | |||
- | We'll start by making a tab called "tutorials". Just duplicate these directions and replace "tutorials" with anything else to make ome other tabs as well. | ||
- | |||
- | <code sql> | ||
- | ALTER TABLE `products_description` ADD `products_tutorials` TEXT NOT NULL ; | ||
- | </code> | ||
- | |||
- | ==== Admin mods ==== | ||
- | |||
- | Just like in the Tariff mod, add the new sql field to **admin/includes/modules/product/collect_info.php** | ||
- | |||
- | <code php> | ||
- | $parameters = array('products_name' => '', | ||
- | 'products_description' => '', | ||
- | 'products_tutorials' => '', | ||
- | 'products_url' => '', | ||
- | 'products_id' => '', | ||
- | 'products_quantity' => '', | ||
- | 'products_model' => '', | ||
- | 'products_image' => '', | ||
- | 'products_price' => '', | ||
- | 'products_virtual' => DEFAULT_PRODUCT_PRODUCTS_VIRTUAL, | ||
- | 'products_weight' => '', | ||
- | 'products_date_added' => '', | ||
- | 'products_last_modified' => '', | ||
- | 'products_date_available' => '', | ||
- | 'products_status' => '', | ||
- | 'products_tax_class_id' => DEFAULT_PRODUCT_TAX_CLASS_ID, | ||
- | 'manufacturers_id' => '', | ||
- | 'products_quantity_order_min' => '', | ||
- | 'products_quantity_order_units' => '', | ||
- | 'products_priced_by_attribute' => '', | ||
- | 'product_is_free' => '', | ||
- | 'product_is_call' => '', | ||
- | 'products_quantity_mixed' => '', | ||
- | 'product_is_always_free_shipping' => DEFAULT_PRODUCT_PRODUCTS_IS_ALWAYS_FREE_SHIPPING, | ||
- | 'products_qty_box_status' => PRODUCTS_QTY_BOX_STATUS, | ||
- | 'products_quantity_order_max' => '0', | ||
- | 'products_sort_order' => '0', | ||
- | 'products_discount_type' => '0', | ||
- | 'products_discount_type_from' => '0', | ||
- | 'products_price_sorter' => '0', | ||
- | 'master_categories_id' => '', | ||
- | 'products_backorder_allowed' => 1, | ||
- | 'product_customs' => '', | ||
- | 'products_tariff_country' => 0, | ||
- | 'products_tariff' => '', | ||
- | 'products_fragile' => '', | ||
- | 'products_upc' => '', | ||
- | 'products_isbn' => '' | ||
- | ); | ||
- | |||
- | $pInfo = new objectInfo($parameters); | ||
- | |||
- | if (isset($_GET['pID']) && empty($_POST)) { | ||
- | $product = $db->Execute("select pd.products_name, pd.products_description, pd.products_tutorials, pd.products_url, | ||
- | p.products_id, 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, | ||
- | date_format(p.products_date_available, '%Y-%m-%d') as | ||
- | products_date_available, p.products_status, p.products_tax_class_id, | ||
- | 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, | ||
- | p.products_sort_order, | ||
- | p.products_discount_type, p.products_discount_type_from, | ||
- | p.products_price_sorter, p.master_categories_id, | ||
- | p.products_backorder_allowed, p.product_customs, p.products_tariff_country , p.products_tariff , p.products_fragile, p.products_upc, p.products_isbn | ||
- | from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd | ||
- | where p.products_id = '" . (int)$_GET['pID'] . "' | ||
- | and p.products_id = pd.products_id | ||
- | and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"); | ||
- | </code> |