Tech-Today
How to add a customize product admin fields in zencart by editing/adding extra codes
Problem: How to add a product custom field named length.
This to consider (modifications in):
1.) database
2.) scripts
-----------------------------------
1.) Database - a custom column should be add to the products table.
Execute this line (for column name products_length):
ALTER TABLE `products` ADD `products_length` INT NOT NULL AFTER `products_status`
2.) Scripts - we have to modify at least 4 files
a.) admin/includes/modules/products/collect_info.php - we need to query the field's value:
Find this line:
if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
//And add the following line:
p.products_length, //(just look at the pattern)
*we need to show the fields in the product page, so add this line (maybe under Product Qty Min/Unit Mix: or where ever you want):
<tr>
<td class="main"><?php echo TEXT_PRODUCTS_LENGTH; ?></td>
<td class="main"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_input_field('products_length', ($pInfo->products_length == 0 ? 0 : $pInfo->products_length)); ?></td>
</tr>
b.) admin/includes/languages/english/product.php - this is where we will define the label for the field, just add this line:
define('TEXT_PRODUCTS_LENGTH','Length:');
c.) admin/includes/modules/update_product.php - we need to update the update statement.
Find this line:
$sql_data_array = array('products_quantity' => $products_quantity,
And insert this line:
'products_length' => zen_db_prepare_input($_POST['products_length']),
If you are not familiar with how a query works, just look at the pattern. Easy right?
Well, I guess that's it we have a custom length field. This field can be shown in the frontend but we have to modify the respective file.
-
Web Development
WordpressConfigure Custom Wordpress PermalinkZencartHow to add a customize product admin fields in zencart by editing/adding extra codesJoomlaHow to install/setup/configure joomla to run in a xampp setup. This avoids the technical detail of manually installing...
-
How To Solve Multiple Active Datareader Session In Mvc3 C#
This problem commonly happens when you try to execute a query with a return type of IEnumerable then execute a second query with the result. Example, we have a table Animes: public IEnumerable GetAnimes() { return context.Animes; } //on the second part...
-
Magento Email To A Friend Not Working, Even After Updating Product_share.html
After we have successfuly setup our magento store, we've been testing its functionality and found out that email to a friend is not working properly. The product link and image are missing. What we did: 1.) After checking the controller for sendfriend,...
-
Remove Compare Products And Recently Viewed Boxes On Magento
To do this first I enable the block outlining so I will be able to determine which layout and block a box is located. To remove these boxes using the xml layout config files, you have to open and change 2 files 1.) For Compare Products Box open: app/design/frontend/default/youttheme/layout/catalog.xml...
-
Steps In Setting Up Your Products In Magento Powered Store
Before you can set up your products, the following should be set first. 1.) Attributes/Attribute Sets a.) In case you will define a custom attribute set, which is not available under: Catalog->Attributes->Manage Attributes (such as price breakdown)....
Tech-Today