Questions tagged [magento-1]
General questions about Magento 1 not specific to a minor version. You can use it to distinguish from Magento 2, but if you have issues with a specific installation, use the appropriate magento-1.x tag instead.
2,338
questions
6
votes
2
answers
4k
views
Possible to hide admin menu if custom module is disabled?
I am working on a custom backend module that has an option in System > Configuration to enable or disable the module.
I would like to know if it is possible to hide the navigation item from the admin ...
6
votes
2
answers
7k
views
Restrict system.log logging to particular error level?
By default Magento logs notices, warnings and errors into the system.log file. Is it possible to restrict the log level so that Magento doesn't log PHP notices?
Magento's Mage::log() method offers ...
6
votes
2
answers
4k
views
Order Item get price of selected custom option
I've in my order a simple product with a custom option of type radio for choose
Product price 100
() no installation service
(*) yes install it + 50 €
Now I'm exporting my order to an ERP product ...
6
votes
2
answers
3k
views
Multiple Helpers in module
I know that if I add a helper to my module I need to declare it in config.xml using:
<helpers>
<module>
<class>Namespace_Module_Helper</class>
</module>
&...
6
votes
1
answer
2k
views
Install/Upgrade Scripts - Can they run multiple times when multiple users are hitting the site before they are done?
We have a couple of updates that we'd like to run by way of a module's upgrade script. One of them takes about 5 minutes to complete.
The problem here that we are not sure about is that the site ...
6
votes
2
answers
15k
views
How do I get data from my custom module table?
I have a custom module with its own table which saves the date inside the column named date_to.
I am trying to access the values from only this column but when I load the collection and call getData('...
6
votes
2
answers
17k
views
How to bind an action after customer login success using Magento?
I'm using Magento 1.4.1.1. After logout success, customer is rooted to "logout.phtml" first and "home page" later.
Is there anyway I could make Magento run couple of "php" codes after "login" ...
6
votes
1
answer
20k
views
Magento include phtml file within another phtml file
I am making a custom home page for my magento website in a phtml file named home_banner.phtml, which in turn i have referenced in the CMS->Pages->Home Page content by the following code
{{block type="...
6
votes
1
answer
8k
views
Change the order of CSS files. Load module's CSS before theme's CSS
How can I change the order of CSS files to load module's CSS before theme's CSS? Here are some code examples:
Theme's CSS file (loaded on all pages) added in theme's local.xml:
<default>
<...
6
votes
1
answer
1k
views
Magento 1: using Mage::objects() to cache models
So I found out that in theory, Mage::objects() could be used to cache objects via Varien_Object_Cache.
I noticed that if I run the following:
// Test #1
for ($i = 0; $i < 100000; $i++) {
$...
6
votes
3
answers
5k
views
Get Website ID from Website Name
As the title says. I don't want the ID of the current website, I want the ID of any website by supplying only that websites name.
I have this code:
$siteModel = Mage::getResourceModel( 'core/...
6
votes
3
answers
857
views
Avoid conflicts in setup scripts with multiple developers
We are using Magento setup scripts located in the sql and data directories to propagate data changes to all working copies and environments. This includes configuration settings, creation of new ...
6
votes
1
answer
10k
views
Get Shopping cart rule coupon code
I have made two simple shopping cart rules from backend.
The first has action which is based 'SKU is one of'.
The second has action based on 'Brand contains'.
I have made a custom function to ...
6
votes
3
answers
2k
views
Magento getFirstItem and getLastItem not working on collection
My code is as below but it won't work with loading first or last item.
$shipidarr[0] = 100007536;
$shipModel = Mage::getModel('orderstatus/orderstatus')->getCollection();
$shipModel->...
6
votes
2
answers
2k
views
Setting data in a multi dimensional array
All classes that extend Varien_Object in Magento 1 and Magento\Framework\Object in Magento 2 have a method called getData. All of us used it.
If the $_data member var is a multidimensional array we ...
6
votes
2
answers
880
views
Custom Entity Models - Using EAV vs Flat
I am working on a module that is essentially replacing a number of Magento features with custom logic. This is mainly due to the fact that I require pricing to 5 decimals of precision, but that is ...
6
votes
1
answer
9k
views
vertical menu every page & Header menu navigation
I am trying to customize header menu and vertical menu (left menu) in Magento cms
When i click on the category, i will be redirected to next page but the complete list of categories is no more ...
6
votes
3
answers
7k
views
How do I create a configurable product with associated products?
The following code does create a configurable product, however, when I open the product in the backend, the following message appears:
when I create the configurable product and open it in the ...
6
votes
1
answer
2k
views
How can I add a "Downloadable Product" to a Bundle?
The company I'm working for has asked me to help them with implementing eBooks into their e-commerce website. I have read on the Magento forums that you can add a line to the config for bundles, and ...
6
votes
1
answer
2k
views
SOLVED: new Unserialize_Parser class throws exceptions on NULL values
I had a real problem with SUPEE-8788 related to the decision to replace PHP's unserialize() function with the new Unserialize_Parser. The problem is that the Gene_Braintree payment extension sets NULL ...
6
votes
2
answers
5k
views
Add datepicker on frontend?
We have developed a custom module for appointment. We need to get date of the appointment. We have added the below code in my custom page xml and phtml files
In XML file:
<reference name="head"&...
6
votes
1
answer
113
views
Which license should I use for my own extension to prevent others to use it without my permission/paying?
I developed a few extensions and I try to figure out which license I should use to "prevent" others e.g. our agencies to copy them and spread them to their own customers w/o my permission.
6
votes
1
answer
831
views
Paypal's Address Saved As Default Address
A new customer who makes a virtual product purchase through paypal has their billing address passed to Magento. The address is attached to the order but is not attached to the customer. What would ...
6
votes
0
answers
180
views
Inconsistent package.xml - Magento 1
I tried finding a Slack or Discord server for Magento before coming here.
I am trying to submit a Magento 1 extension for technical review @ marketplace and the package.xml won't pass marketplace ...
6
votes
0
answers
836
views
Magento : Validate Product against shopping cart rule
I have a Shopping cart rule which applies to a particular category with some discount.
I have a situation wherein I want to validate product against this rule whether this rule can be applied to that ...
6
votes
2
answers
2k
views
New website/store view, all pages 404 (including homepage)
As per the title, I've set up a new store on a different domain and all pages including the home page are returning 404.
I've tried pretty much everything, and I'm wondering if any of you can think ...
6
votes
1
answer
691
views
How can I get only the Store View attributes, without the inherited Global data? I only need the diffs
I'm using the internal Magento APIs to get the product data on a store view level. I only want to get the values that are on that store view level, not the global values that in inherits. But it ...
6
votes
1
answer
2k
views
How to get the product id and SKU code of the product selected
I am using a plugin to enable notify me (Out of stock) feature, the plugin is working properly but the problem is it is taking the core product id and storing it in the backend, even after I select a ...
5
votes
2
answers
20k
views
How to use Distinct in magento1?
I want to use distinct in magento.
SELECT DISTINCT level FROM `student`
I am trying this code
$collection = Mage::getModel('school/student')->getCollection()
->distinct(true)
-&...
5
votes
3
answers
14k
views
Magento 1 - category view URL doesn't get routed, product view does
In the process of setting up my site, I have been unable to use category view links of the form:
/catalog/category/view/id/
Similar links to a product view page work just fine. The above leads to ...
5
votes
5
answers
2k
views
Magento Hacked: displays list of user emails and error message
-My client suspects his site was hacked,I'm not sure, but when I open index.php I get a list of emails and usernames, and what appears to be encrypted passwords (please correct me if I'm wrong).
I ...
5
votes
3
answers
4k
views
How to disable report viewed products in magento
Our magento store is writing about 50 rows per second to the report_viewed_product_index table.
How can I disable this event?
I have log cleaning cron enabled but that doesn't prevent the ...
5
votes
3
answers
21k
views
Create and add attribute group with attributes to all attribute sets
I need to create and add an attribute group with 6 attributes to all attributes sets in an existing install.
I have found a script for creating an attribute group, this works great, but this can not ...
5
votes
1
answer
954
views
Does a complete "config.xml" reference exist?
I am in the process of writing some in-house documentation that goes a bit beyond the "hello world" examples that populate the internet and would like to start a complete reference wiki on some of the ...
5
votes
4
answers
6k
views
How can I assign an order to a customer?
Let's say if a customer has an account, but for some reason can't log in, and creates an order by checking out as a guest. How can I assign this "guest order" to her customer account? This is so as ...
5
votes
2
answers
5k
views
Is It Possible To Create My Own Shortcode
I'm building a module. I want to be able to use a shortcode (template directive) in my CMS static blocks, such as the following:
{{store url=""}}
I want to call my own module's frontpage blocks ...
5
votes
3
answers
5k
views
What is the file path to edit the checkout page in root?
How to edit/add one new field in checkout page?
5
votes
1
answer
6k
views
Magento 2: How to set meta tag in controller?
In magento1 we use this code to set meta description and meta keywords.
$this->getLayout()->getBlock('head')->setDescription('test description');
$this->getLayout()->getBlock('head')-&...
5
votes
2
answers
18k
views
How do I modify Magento rendered page before it's displayed?
I am trying to modify the rendered page content before it's displayed to the user. I would like to do this in my custom module.
So far, I have tried hooking into the cms_page_render event but:
it ...
5
votes
2
answers
727
views
SUPEE-11346 - potential problems?
Magento released last patch for M1:
https://magento.com/tech-resources/download#download2374
Haven't looked into the patch yet, it looks like the community is unaware there is a new patch out for M1.
...
5
votes
4
answers
842
views
How can i protect my module
I have a couple of modules that I have created and will be to consider that I may take action of selling those on Magento Connect marketplace.
Aside from only adding a license docblock and terms/...
5
votes
1
answer
1k
views
Can I use a .sql file in my Magento module installer?
I have a large SQL file. Can I use this in my module installer?
5
votes
1
answer
24k
views
Get category image to a page template
I have created a new page template here:
/template/page/category.phtml
and copied inside the content of 1column.phtml.
What I want to accomplish is to get the category data variable in this new ...
5
votes
2
answers
476
views
Set Magento Config Data For Script Duration Only
Is it possible to set a Magento configuration option for the duration of a single script only?
I'm trying to programatically and recursively create orders in Magento. I want to enable the Flat Rate ...
5
votes
2
answers
6k
views
Change page title via local.xml
I have managed to change the title of the Register page with the following code in local.xml
<customer_account_create>
<reference name="head">
<action method="setTitle"><...
5
votes
4
answers
9k
views
How to debug vsprintf() "Too few arguments" error in my log files?
I keep seeing the following report in my system.log file:
2015-10-20T12:34:07+00:00 DEBUG (7): Array
(
[type] => 2
[message] => vsprintf(): Too few arguments
[file] => app\code\...
5
votes
3
answers
7k
views
New module router index 404 error
I'm attempting to build a module but I can't even get the url routing to work as it keeps responding with a 404. I've follow this tutorial in an attempt to get it working but I still get a 404 page ...
5
votes
3
answers
3k
views
Constructor for Magento Controller
I need constructor or init function that can be run for my custom module. I need to call it every time when request made to my module's controller in magento.
5
votes
2
answers
2k
views
Magento Certification - multi-answer multiple choice questions [closed]
For those of you that have taken the test or know about it - I notice there are questions that require you to choose 4 correct answers out of 6. If I get 3 right and 1 wrong, am I given any marks at ...
5
votes
2
answers
588
views
How to get list of overridden controllers?
Is it possible to get list of all overridden controllers ?
How do I get a list of all class rewrites? mainly applies for blocks, helpers and models.