magento

Create a new table from magento module

社会主义新天地 提交于 2020-01-11 06:43:07
问题 I am trying to have an admin module I am working on create a new table in the database. What I have setup in app/code/local/Foo/BAR/sql/mysql4-install-0.1.0.php <?php $installer = $this; $installer->startSetup(); $installer->run(" DROP TABLE IF EXISTS {$this->getTable('notes')}; CREATE TABLE {$this->getTable('notes')} ( `ppr_id` int(11) NOT NULL AUTO_INCREMENT, `notesku` bigint(20) NOT NULL, `notestatus` smallint(16), PRIMARY KEY (`notes`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 "); $installer-

is there a reason why Magento shouldn't support uninstall/downgrade for modules

吃可爱长大的小学妹 提交于 2020-01-10 20:16:22
问题 Automated instant rollback is an important feature of enterprise-grade deployment mechanisms. Currently, it's not possible to achieve this using Magento's built-in installation tools. Given that Magento's core_resource mechanism allows for the sequential execution of setup scripts for installation or upgrade of modules (via execution of SQL and also PHP), it seems logical IMHO that it should support the same process in reverse. Now, some obvious reasons not to support it: It would be

Magento - How enable SMTP server authentication and secure transport?

一个人想着一个人 提交于 2020-01-10 19:51:09
问题 I'd like to make the SMTP server working on Magento app(version 1.7). so I added the following code on file app/code/core/Mage/Core/Model/Email/Template.php public function getMail() { if (is_null($this->_mail)) { /*Start of added code to specify config*/ $my_smtp_host = Mage::getStoreConfig('system/smtp/host'); $my_smtp_port = Mage::getStoreConfig('system/smtp/port'); $config = array( 'ssl' => 'tls', 'port' => $my_smtp_port, 'auth' => 'login', 'username' => 'account@gmail.com', 'password' =>

Execute PHP after new Order in Magento

不打扰是莪最后的温柔 提交于 2020-01-10 14:17:42
问题 I'm trying to figure out where I could drop in some PHP code to notify a CRM we are using (Solve360) that a new order has been placed, and that an event should be created (API) to fulfill the order. Order Product Checkout Complete Checkout & Capture CC Side notify CRM Done Not sure where to start, but I have had to make some small tweaks to fix the Quantum Gateway payment processor to work. In that module it appears that the objects for the order (email, amt, details) were available. However

Link to a specific step in onepage checkout

五迷三道 提交于 2020-01-10 09:06:25
问题 Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I'm working on a payment module and have a sort of "cancel" action that i would like to return the user to the step in checkout where you choose the payment method. I currently return the user to the first step of the checkout like so: $this->_redirect('checkout/onepage', array('_secure'=>true)); Another issue with this is that i does not work all the time, in certain browsers i

Link to a specific step in onepage checkout

[亡魂溺海] 提交于 2020-01-10 09:06:07
问题 Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I'm working on a payment module and have a sort of "cancel" action that i would like to return the user to the step in checkout where you choose the payment method. I currently return the user to the first step of the checkout like so: $this->_redirect('checkout/onepage', array('_secure'=>true)); Another issue with this is that i does not work all the time, in certain browsers i

Remove .html from URLs with a redirect

走远了吗. 提交于 2020-01-10 09:04:13
问题 We have a website, unfortunately all the URLs have the .html suffix, its a Magento installation, Magento allows you to change this on the CMS, but again, unfortunately all this URLs with .html suffix have a good ranking in Google. We need to redirect to non .html . So, consider the following scenario, we are rebuilding this site from scratch, so we have the same urls on the new site but without the .html suffix. Now is: www.example.de/cool-shoes.html Will be: www.example.de/cool-shoes So www

Programatically added bundle product isn't showing up in frontend

谁说胖子不能爱 提交于 2020-01-10 08:38:31
问题 I am trying to insert bundled products to the Magento database from a PHP script. The version in question is Community 1.5.1.0. I tried the method described in the question "Programmatically add Bundle Products in Magento, using the SKU / ID of Simple Items". The inserted products show up nicely in the administration section -- I can edit them, add new options and selections etc. However, they are not showing up at all in the Magento frontend no matter what I try - e.g. rebuilding indexes or

Default attribute value for all product in magento

孤街醉人 提交于 2020-01-10 03:16:31
问题 I want to set a default value of an attribute for all product. 回答1: I had same problem before,when i added 11096 product(downloadable products) in my store then client told me to add new attributes in product so i create 1 attribute (Type is Yes/No) and set to attribute set. Now my problem is how can i edit all product and set that attribute yes or not.if i not set then value is null so i wrote few line code. Please check this code may be it'll helpful to you. $ProductId = Mage:

Approach on changing row color on orders grid in admin

社会主义新天地 提交于 2020-01-10 03:14:34
问题 I need to change row color in magento orders grid based on order status. For start I don't want a complex solution with configurable interface. I just want to know where to start. What is the best approach ? 回答1: Full, working solution: Copy js/mage/adminhtml/grid.js to js/colors/adminhtml/grid.js Make the file 666 and the folders (js/colors & js/colors/adminhtml) 777. Edit it and after line 208 (before the line containing }.bind(this) ) add: colorize(); At the end of the file add: function