magento-1.5

Magento changes layout dynamically via system variable

假装没事ソ 提交于 2020-01-13 02:23:51
问题 Is there a way we could changes the layout of a Magento page (let's say a product category page) dynamically by using system variable which have been set on our own module? I want to be able to set my category page's default layout via my own module admin config panel. So that I don't have to deal with those confusing XML layout file each time I want to change my default layout for a certain magento page. I know, on a phtml file, we could simply call our own module's system variable by

Adding custom registration fields in magento 1.5

怎甘沉沦 提交于 2020-01-03 02:53:14
问题 i am trying to add a couple of custom fields to the registration page. After going though various posts about this topic i tried to create a module for this. I see that my 2 custom fields are added to the eav_attribute and eav_entity_attribute tables. I also see that the entity_type_id is set to 1 which is customer for my entries. But if i add any data during registration for these fields its not saved to the table customer_entity_varchar . Here is my code: /etc/config.xml <?xml version="1.0"

how to get value from array in array in array?

≡放荡痞女 提交于 2019-12-25 09:38:06
问题 I get this array when I print_r($_POST) , from the below result I want to get the value of skin . [skin] => 1.jpg how will i do that ??? Array ( [form_key] => WceDMPJOQD17ZeSW [config_state] => Array ( [themeoptions_general] => 1 ) [groups] => Array ( [general] => Array ( [fields] => Array ( [themeoptions_images] => Array ( [skin] => 1.jpg ) [themeoptions_customcss] => Array ( [value] => color:#333; ) ) ) ) ) 回答1: $_POST['groups']['general']['fields']['themeoptions_images']['skin'] This will

Always count return 0 (zero) from a product collection in Magento

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 09:29:00
问题 Actually, I am trying to find if this product is in a wishlist or not. So I tried Daniel Sloof's answer in Stack Overflow question Check whether a product is in the wishlist or not , but the product collection always returns 0. What I tried is here: $_productCollection1 = Mage::helper('wishlist') ->getProductCollection() ->addFieldToFilter('sku','00114477oo0077'); $_productCollection1->count(); This one returns "0". To debug, I print the query in directly applied in my database in returning

Magento html-head dropdown missing

元气小坏坏 提交于 2019-12-24 01:07:12
问题 I wanted to modify my title prefix and suffix but this option seems to have gone missing. I searched for Configuration => Design => HTML Head the HTML Head dropdown however seems to be missing. Anyone knows how to fix this? 回答1: if you use a local code folder - simply copy app/code/core/Mage/Page/etc/system.xml to app/code/local/Mage/Page/etc/system.xml afterwards the HTML Head Section should re-appear. 来源: https://stackoverflow.com/questions/6909156/magento-html-head-dropdown-missing

Magento Wishlist - Remove item

瘦欲@ 提交于 2019-12-24 00:56:33
问题 I've built a custom script to add and remove items to the wishlist using AJAX. Adding products is not a problem but I can't figure out how to remove an item. The Magento version is 1.5.1.0 . The script is in /scripts/ and looks like this: include_once '../app/Mage.php'; Mage::app(); try{ $type = (!isset($_GET['type']))? 'add': $_GET['type']; $id = (!isset($_GET['id']))? '': $_GET['id']; $session = Mage::getSingleton('core/session', array('name'=>'frontend')); $_customer = Mage::getSingleton(

Get information about customer by email id in magento

﹥>﹥吖頭↗ 提交于 2019-12-23 14:57:01
问题 I want to get information of customer by email id, so i create a method in controller with content: public function showAction(){ $customer_email = "abc@mail.com"; $customer = Mage::getModel("customer/customer"); $customer->setWebsiteId(Mage::app()->getWebsite()->getId()); $customer->loadByEmail($customer_email); echo $customer->getId(); echo $customer->getFirstName(); echo $customer->getEmail(); } but when run it return null value, i don't know why?. please help me 回答1: In your system

Magento - Add Custom Mass Action PDF

為{幸葍}努か 提交于 2019-12-23 13:26:13
问题 Quick Question (Keep this in mind when reading): Why is this error being produced ( in explanation ) and how can I edit the pdfRmaAction() to work correctly (Mass Action Printing)??? **Working in Magento v.1.10.1.0 which is the same as v.1.5.1.0 Long-winded explanation: I've downloaded this extension (http://www.magentocommerce.com/magento-connect/admin-order-printing-extension.html) to add a button to each order so that when you go into the order, you have an extra button to print an RMA

Magento - Load Product Collection with Pagination

為{幸葍}努か 提交于 2019-12-22 17:17:32
问题 I've been trying to load a product collection and then filter it by calling in the review ids into array and then applying that filter to it. I've enclosed the code below which is in the top of the List.phtml that I'm running it through a custom copy of the list.phtml like so <block type="catalog/product_list" name="sale" template="reviewsList/index.phtml"> Good news is that the collection will load, but it breaks the pagination. If anyone has any ideas that would be great. Full code below.

magento - retrieve all children categories given a category id

狂风中的少年 提交于 2019-12-22 13:11:06
问题 As said in the title, i'm trying to do this stuff through my custom function: public function retrieveAllChilds($id = null, $childs = null){ $childIdsArray = is_null($childs) ? array() : $childs; $category = is_null($id) ? $this->getCurrentCategory() : $this->getCategoryFromId($id); if (count($this->getChildrenCategories($id)) > 0) { $c = count($this->getChildrenCategories($id)); $tmp_array = array(); foreach ($this->getChildrenCategories($id) as $category) { array_push($tmp_array, $category-