magento-1.7

How to convert standalone PHP files to Magento's MVC

早过忘川 提交于 2019-11-29 18:13:00
I have a task to convert the standalone PHP files to Magento's MVC. These PHP files were created by another developer. The code in the PHP file accesses the database, converts the result into JSONP format and forward it to the frontend developer. I don't have any knowledge of Magento's MVC. Is this task of conversion similar to the modules in the app/code/core/Mage in the Magento folder?? How can I do this? Is the magento MVC the same as the PHP MVC? I am including the php file that I need to convert to Magento MVC. So it will be easier for you to understand.. <?php header('content-type:

magento showing wrong product count in category

限于喜欢 提交于 2019-11-29 18:07:20
问题 I have a strange issue and seems many are having the same on internet. Below picture will define my issue and also my magento version is 1.7 As I have highlighted, LEFT says the category has 16 products, but in actual the Category Products Tab shows 15 products. All my categories are messed up. Please let me know what's going wrong. I've tried disabling the cache, but it didn't worked. [Edit] I tried removing one-product from the category, then the number on the left went to 15 and total

How to add product specific attribute column to sales_flat_order_item table?

删除回忆录丶 提交于 2019-11-29 16:58:04
In admin panel I have created a product attribute as ' merchant '. I want to add a new column for merchant in sales_flat_order_item table. The new column should be filled with the attribute name. How can I do this without using an event observer method? Any help will be appreciated. (I'm using magento CE 1.7 ) First of all, you need to add the new column to sales_flat_quote item, and sales_flat_order_item. the best explanation is here: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-6-magento-setup-resources Your setup resource have to looks something like this:

Magento: Add content block at the end of the structual block “content”

孤者浪人 提交于 2019-11-29 14:50:28
问题 I'm trying to add a content block to Magento, which should be visible on every side below the main content. I want to archive this with a custom extension, so I can copy this extension and it workes without touching core design files. My extension includes the following layout update: <default> <reference name="content"> <block type="mymod/blockname" name="myblockname" after="-" template="mymod/block.phtml"/> </reference> </default> My problem is, that the attribute after="-" is not working.

Set default product values when adding new product in Magento 1.7

有些话、适合烂在心里 提交于 2019-11-29 11:00:24
I have created an Observer.php for the event catalog_product_new_action <?php class Starmall_Productobserver_Model_Observer { public function initProduct(Varien_Event_Observer $observer) { $product = $observer->getEvent()->getProduct(); $product->setWeight(1); $product->setStatus(1); $product->setTaxClassId(1); $product->setPrice(1); $product->setStockData(array( 'is_in_stock' => 1, 'qty' => 99999 )); } } When I add a new product the weight, status, tax class and price are correctly set to my defaults. The stock qty and stock availability are not set. How can I set these stock values in the

How to enable wysiwyg by default on textarea in admin?

▼魔方 西西 提交于 2019-11-29 05:20:24
How can I enable wysiwyg by default on textarea? I mean, I do not want to click on the wysiwyg button to display the area with tinyMCE : I want this directly : After a little research i found it. 1) Put this code in the .phtml file you want the editor to appear directly. 2) In the 6th line of the code you can see elements: "short_description" . You can change "short_description" with the element id you want. You can add more than one element id separated with comma and without spaces. Example: I put this code in app/design/adminhtml/default/default/template/catalog/product/edit.phtml because i

How to update custom options programatically in magento?

前提是你 提交于 2019-11-29 02:44:16
I have lot of products with custom options, now I have requirement to update only custom options through csv file. so how we can do this programatically? Kunal I think this is also useful... If you are customize the products . <?php $magePath = 'app/Mage.php'; require_once $magePath; Varien_Profiler::enable(); Mage::setIsDeveloperMode(true); ini_set('display_errors', 1); umask(0); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $product_ids = array(1,2,167); $productmodel = Mage::getModel('catalog/product'); foreach ($product_ids as $product_id) { /**i use this two arrays

Magento - Add custom attribute to order

蓝咒 提交于 2019-11-29 00:24:58
问题 I'm trying to add a custom field to my orders. At this moment, I found the post bellow that helped me to create such attribute in my database: http://fabrizioballiano.net/2011/11/15/create-a-custom-order-attribute-in-magento/ require_once('app/Mage.php'); Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID)); $installer = new Mage_Sales_Model_Mysql4_Setup; $attribute = array( 'type' => 'int', 'backend_type' => 'text', 'frontend_input' => 'text',

Magento - Override adminhtml template file

烂漫一生 提交于 2019-11-28 19:42:20
I have read several posts on stack overflow Overriding a Magento Adminhtml template file Magento - overriding Adminhtml block and a couple threads on the magento forum http://www.magentocommerce.com/boards/viewthread/21978/ However, None of these posts attempt to do what I am trying to do I would like to override the app/design/adminhtml/default/default/template/widget/grid.phtml file, as this file contains a portion of html that allows anyone to export from the sales->order view. Note: We have disabled all of the export options for this user role in the permissions->role view The code that

How to convert standalone PHP files to Magento's MVC

大城市里の小女人 提交于 2019-11-28 11:58:20
问题 I have a task to convert the standalone PHP files to Magento's MVC. These PHP files were created by another developer. The code in the PHP file accesses the database, converts the result into JSONP format and forward it to the frontend developer. I don't have any knowledge of Magento's MVC. Is this task of conversion similar to the modules in the app/code/core/Mage in the Magento folder?? How can I do this? Is the magento MVC the same as the PHP MVC? I am including the php file that I need to