magento

HTML SELECT OPTION convert/changed to <UL> <LI>

余生长醉 提交于 2020-01-14 04:25:07
问题 I want my code below to be converted or changed to list style or div. <div class="input-box"> <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" class="required-entry validate-cc-type-select"> <option value=""><?php echo $this->__('--Please Select--')?></option> <?php $_ccType = $this->getInfoData('cc_type') ?> <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?> <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected=

Whats correct way to use multicall method of magento SOAP API?

老子叫甜甜 提交于 2020-01-14 04:00:31
问题 I have implemented two ways to call magento methods, first with http://sudzc.com/ classes and second with http://www.wsdl2code.com/Pages/Home.aspx classes. but not getting product info by either way. Please check two pairs of request and response for multi call method :- SUDZC Request:- <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

Is there a comprehensive list of observer events?

雨燕双飞 提交于 2020-01-14 03:58:30
问题 Is there a comprehensive list of all events that can be listened for? If this list doesn't exist, what's the best method to debug to obtain all events? 回答1: You'll never find a complete list. But if you go to app/Mage.php you can put in some debug code inside of the function "dispatchEvent()" and log all of the events as you go. $params = array(); foreach (array_keys($data) as $key) { if (is_object($data[$key])) { $params[] = $key.' ('.get_class($data[$key]).')'; } else { $params[] = $key.' (

Filtering a text-type column with MySQL-computed values in Magento Admin Grid

南笙酒味 提交于 2020-01-13 19:11:40
问题 Say one column in grid has computed values: setCollection() : 'refunded' => new Zend_Db_Expr("IF(qty_refunded > 0, 'Yes', 'No')"), _prepareColumns() : $this->addColumnAfter('refunded', array( 'header' => Mage::helper('helper')->__('Refunded'), 'index' => 'refunded', 'type' => 'text', ), 'qty'); What and how must one change in order to have columns with "yes" values, in case admin types "yes" then filters? 回答1: Adminhtml grid columns have a filter property which specifies a block class. For

Filtering a text-type column with MySQL-computed values in Magento Admin Grid

一世执手 提交于 2020-01-13 19:07:55
问题 Say one column in grid has computed values: setCollection() : 'refunded' => new Zend_Db_Expr("IF(qty_refunded > 0, 'Yes', 'No')"), _prepareColumns() : $this->addColumnAfter('refunded', array( 'header' => Mage::helper('helper')->__('Refunded'), 'index' => 'refunded', 'type' => 'text', ), 'qty'); What and how must one change in order to have columns with "yes" values, in case admin types "yes" then filters? 回答1: Adminhtml grid columns have a filter property which specifies a block class. For

How to remove item from quote in Magento?

时光怂恿深爱的人放手 提交于 2020-01-13 18:01:29
问题 During the checkout process I sometimes want to programmatically remove items from the session's quote. So I tried this code: $quote = Mage::getSingleton('checkout/session')->getQuote(); $all_quote_items = $quote->getAllItems(); foreach ($all_quote_items as $item) { $quote->removeItem($item->getId())->save(); } However, after this loop the list of items in the $quote object is still the same, i.e. no items have been removed. Any ideas what I am missing here? Using Magento 1.4.1.1 回答1: Try

Magento tab change/redirect

纵饮孤独 提交于 2020-01-13 11:06:55
问题 I have a page with two tabs, a search-tab and a tab with a grid of the database. After the user edits one of the items in the grid, I'd like to keep them on the grid tab, rather than the form tab which is first in order. Is there a way to change the active tab on a page via code? This is the code for the tabs: protected function _beforeToHtml() { $this->addTab('search_string', array( 'label' => Mage::helper('advancedtranslate')->__('Find a string'), 'title' => Mage::helper('advancedtranslate'

Add BCC in Magento Transactional Email

泄露秘密 提交于 2020-01-13 09:44:50
问题 I created a new email template, and that works fine in Magento, but I don't know how to add BCC addresses to the email. 回答1: You can add a bcc in the code where you send the email: Mage::getModel('core/email_template') ->addBcc('em@ail.com') ->sendTransactional(... 回答2: This is the answer I've found: $mailTemplate->setTemplateSubject($mailSubject)->addBcc('youremail@mail.com') ->s‌​endTransactional($templateId, $sender, $email, $cus_name, $data, $storeId); 回答3: You can do it in the config. Go

In Magento 1.6, changes to login.phtml don’t reflect

蹲街弑〆低调 提交于 2020-01-13 08:31:06
问题 I customized the file app\design\frontend\base\default\template\checkout\onepage\login.phtml to hide the login fields in onepage checkout. It works well in 1.5 version. When I do the same modifications in 1.6 version, nothing changes in the frontend. I observed that in 1.6 version, onepage.phtml is not using onepage\login.phtml unlike in 1.5. I did the basic checks of file location mistake(base\default and default\default) and cache refresh. I am having trouble figuring out which login.phtml

Adding tags to products in Magento

落爺英雄遲暮 提交于 2020-01-13 07:13:26
问题 what is the code needed to insert tags to a product in Magento? thanks 回答1: $tagName = 'php'; $customerID = NULL; $storeId = Mage::app()->getStore()->getId(); $productID = 1; $tagModel = Mage::getModel('tag/tag'); $tagModel->loadByName($tagName); //$tagModel->unsetData()->loadByName($tagName); //if using a loop if (!$tagModel->getId()) { $tagModel->setName($tagName) ->setFirstCustomerId($customerId) ->setFirstStoreId($storeId) ->setStatus($tagModel->getPendingStatus()) ->save(); }