magento-1.5

Magento categories listing using getCollection & addLevelFilter but exclude Default Root Category

旧时模样 提交于 2019-12-09 20:20:03
问题 I'm using the following code to grab a collection and to filter on a level using addLevelFilter(2). This outputs all my categories at level 2 perfectly except it also pulls through the Default Root Category in my list. I want to exclude this from view but having looked through all the available methods, I see nothing that will help me remove/exclude certain levels or categories. I really want a full proof solution so if I were to choose say level 3 it would only show level three and not level

magento join table collection

◇◆丶佛笑我妖孽 提交于 2019-12-09 06:47:44
问题 I'm customizing Magento FAQ extension for sort faq items by category.below collection is used to get all items active faq items. $collection = Mage :: getModel('flagbit_faq/faq')->getCollection() ->addStoreFilter(Mage :: app()->getStore()) ->addIsActiveFilter(); there is relation table " faq_category_item " Table structure:- category_id faq_id 1 1 2 2 1 3 So I decide to join two tables.I unsuccess in that. What i tried is below. $tbl_faq_item = Mage::getSingleton('core/resource')-

Magento - How do you return results of unlimited CMS Static blocks (with certain “Identifier”) to a CMS Page

泄露秘密 提交于 2019-12-09 02:49:43
问题 Quick Overview: I am trying to return results from a specific set of static blocks to a phtml file (which is then called on from a cms page ) in Magento . Note: I've been searching all over google and some answers get me closer than others but nothing I've tried seems to work 100%? Details: I already have a set of specific static blocks that all start with an identifier of testimonial- . For example, each static block is like this: testimonial-1 , testimonial-2 , testimonial-3 and so on. I

Add custom fields in review form

那年仲夏 提交于 2019-12-09 01:45:39
问题 I am looking forward to create a custom fields 'Email Id' & One drop-down in Review form . I have tried this one but not saving the data, its hows the fields only app\code\core\Mage\Review\Model\Mysql4\Review.php protected function _afterSave(Mage_Core_Model_Abstract $object) { $detail = array( 'title' => $object->getTitle(), 'detail' => $object->getDetail(), 'nickname' => $object->getNickname(), 'email' => $object->getEmail(), // New field 1 'fname' => $object->getFname(), // New field 2 );

Magento - registry and current category

一世执手 提交于 2019-12-08 09:25:35
问题 I have a question about Mage::registry and categories: I'm a on a category page, I retrieve current category by Mage::registry('current_category') . I've noticed that it works only for root categories, in fact if I visit a subcategory page I retrieve always the root category with Mage::registry('current_category') . So the question is: is something about backend configuration, cache or something else? 回答1: OOB, current_category is set in Mage_Catalog CategoryController::_initCategory() (ref

Using boolean fields with Magento ORM

落花浮王杯 提交于 2019-12-07 13:09:04
问题 I am working on a backend edit page for my custom entity. I have almost everything working, including saving a bunch of different text fields. I have a problem, though, when trying to set the value of a boolean field. I have tried: $landingPage->setEnabled(1); $landingPage->setEnabled(TRUE); $landingPage->setEnabled(0); $landingPage->setEnabled(FALSE); None seem to persist a change to my database. How are you supposed to set a boolean field using magento ORM? edit Looking at my database,

Directly go to Product Detail page on click of a category in the nav bar

≯℡__Kan透↙ 提交于 2019-12-07 10:04:03
问题 In my store, one of the category has only one product. Is it possible to take the user directly to the product detail page of this one product whenever they click this category in the nav bar? 回答1: Yes this can be done by using the URL Rewrite Management option in Magento Admin . In Magento Admin: Select from menu bar Catalog > URL Rewrite Management . Click on the Add URLRewrite button. Select the category you want to redirect from. Make a note of the ID Path (e.g.: category/10 ) and the

Why doesn't magento autoload parent class

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 09:24:50
问题 I have a module which will use my controller over magento's by doing <routers> <checkout> <args> <modules> <Some_Thing before="Mage_Checkout">Some_Thing</Some_Thing> </modules> </args> </checkout> </routers> In my class that extends the core class I have to explicitly require the class. Does anyone know why this is? 回答1: The Magento autoloader is a simple "replace underscores with slashes" algorithm. Because Zend Framework names its controllers differently, and because Magento uses parts of

Adding custom registration fields in magento 1.5

孤街醉人 提交于 2019-12-07 08:16:25
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"?> <config> <modules> <Foostor_Extcustomerfields> <version>0.1.0</version> </Foostor_Extcustomerfields>

I am getting a block twice in Magento?

丶灬走出姿态 提交于 2019-12-07 01:38:37
问题 I am trying to create product block on home page where in I copied page.xml to my theme's layout folder and modified it like <page_two_columns_left translate="label"> <label>All Two-Column Layout Pages (Left Column)</label> <reference name="root"> <action method="setTemplate"><template>page/2columns-left.phtml</template></action> <!-- Mark root page block that template is applied --> <action method="setIsHandle"><applied>1</applied></action> </reference> <reference name="content"> <block type