magento-1.7

How to call a cms page in a phtml file in magento?

自作多情 提交于 2019-12-04 15:19:10
I need to display a CMS page inside my custom module's phtml file. Is there any way I can include it either through xml layout or via coding directly in phtml file? I know we can add a cms block but how can we add a cms page? Try the below code in your phtml file $page = Mage::getModel('cms/page')->load('home_page','identifier'); echo $page->getContent(); vivek kumar tripathi This code check if cms page is active then it will display page content $page = Mage::getModel('cms/page')->load('top_offer','identifier'); echo $page->getIsActive()?$page->getContent():''; 来源: https://stackoverflow.com

Magento Custom Module: multiple Image Uploader in adminhtml form

℡╲_俬逩灬. 提交于 2019-12-04 12:24:51
问题 i have created adminhtml module it is working fine. in create new item form there are 4 field name , images, url and email id; i have used file uploader to upload images . it is working fine but i am not able to upload multiple images. is it possible to have multiple image uploader? here is my simple image uploader code. if(isset($data['image']) && $data['image'] != ''){ $finderLink = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) .'finder/store_locator/'.$data['image']; $finderName

Got an error in magento connect for installing any extension

你。 提交于 2019-12-04 12:15:18
In my store have magento community edition - 7.1. I try to install extension using magento store, but I got an error like this for all type of extensions community/Dropifi_Dropificontactwidget: Could not resolve host: connect20.magentocommerce.com; Host not found I placed this key for install magento http://connect20.magentocommerce.com/community/Dropifi_Dropificontactwidget http://connect20.magento-commerce.com/community/Dropifi_Dropificontactwidget Help me to get a result for this issue. Thanks This was not an issue specific to you. Today, the Magento Connect server experienced an outage

Preselect configurable product options by simple product URL

ⅰ亾dé卋堺 提交于 2019-12-04 10:03:34
How to show configurable product with preselected options if requested url is for simple product? For example: Simple product #1 has: Color: Red URL: /simple-red.html Simple product #2 has: Color: Green URL: /simple-green.html Configurable product has: URL: /config.html If user visits /simple-red.html it should be loaded configurable product with pre-selected option Color: Red If user visits /simple-green.html it should be loaded configurable product with pre-selected option Color: Green Elaman Successfully solved the problem: Extended ProductController , to replace product id of simple

Magento: Detect if admin is logged in in frontend pages

感情迁移 提交于 2019-12-04 08:55:08
问题 I have created a magento extension. I want to implement access to the extension. The extension creates a page in frontend and i want only admin to access that page. So basically i need something that would detect that if admin is logged in in frontend pages. I have tried several solution but noting seem to work . if(Mage::getSingleton('admin/session', array('name' => 'adminhtml'))->isLoggedIn()) echo 'logged in'; else echo 'not logged in'; Check on frontend if admin is logged in Mage:

Magento - Customer Address Country Dropdown Issue

寵の児 提交于 2019-12-04 08:43:43
问题 I'm using Magento CE 1.7.0.2, having recently upgraded from 1.4.2.0. And when editing/creating a customer address in the backend, the country dropdown field is blank - with no possible options to select. Neither does it work on the frontend address dropdown. Any ideas what's caused this, the only code hint I could find is: "this.defaultCountries = [false,false];" in the JS on the page, whereas on a new Magento install (same version, same default country) it shows: this.defaultCountries = ['GB

$this->getRequest()->getPost() return empty array in magento back end form submission

邮差的信 提交于 2019-12-04 03:15:45
I am creating a magento custom admin module and a form. I want update this form but not updating. In Controller, under SaveAction() I print $this->getRequest()->getPost() and get empty array. please help me. Below code for form declination.. protected function _prepareForm() { $form = new Varien_Data_Form(array( 'id' => 'edit_form1', 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))), 'method' => 'post', 'enctype' => 'multipart/form-data' ) ); $form->setUseContainer(true); $this->setForm($form); return parent::_prepareForm(); } And Create a from filed set

How to add Javascript files in body part (not header) through layout xml files in magento

余生颓废 提交于 2019-12-04 02:21:34
问题 I am beginner in Magento and I want to add javascript file in body section through layout xml file. <reference name='?????'> <action method="addJs"><script>js/my_javascript_file.js</script></action> </reference> What should be reference name ? I tried in another references other than "head" but it's generates error.. I googled a lot but didn't get any solution about it. Is it possible to add javascript files into body section through layout xml files ? I don't want to add Javascript file into

How to validate radio button in magento?

早过忘川 提交于 2019-12-03 23:17:01
In my custom module I have a form which has radio buttons. When I click the submit button it does not validate the radio button. How to validate that using the Magento default validate class. Thanks MeenakshiSundaram R i got the answer, use validate-one-required-by-name in the class name of the radio button. Cheers Edit: or use validate-one-required on the last radio/checkbox in the group Thanks to Rahul Tripathi Validation works, but to show error message you can't use any wrappers. Just <label> and <input> 来源: https://stackoverflow.com/questions/19333539/how-to-validate-radio-button-in

Magento 1.7.0.2 change product image on hover in catalog page

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 23:06:06
I want to change images of products on mouse hover in the catalog page as you can see in this magento theme : http://www.ethemeuk.com/dresscode/index.php/women-10/club-dresses.html Thank you and i wait your reply. If you want to show thumbnail image on mouse over & after mouse out show small image then go through : app->design->frontend->default->your theme->template->catalog->product->list.pthml in this Search this code: <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">