If you want to serve up text files for download (perhaps product feeds etc) then you might like this little snippet.
Not only will it force the file to be downloaded but it allows you to specify a custom filename that it should be saved as.
If you want to serve up text files for download (perhaps product feeds etc) then you might like this little snippet.
Not only will it force the file to be downloaded but it allows you to specify a custom filename that it should be saved as.
The first development release of Magento 2 has a few areas worthy of note for developers of the coming changes to Magento.
Magento 2 now requires PHP 5.3
Zend is still version 1.11.1.
Magento 2 now implements templates on a per modules basis. So now all the different bits of the theme are separated into the modules it belongs to. This means that any existing version 1 theme cannot be dropped into version 2.
Themes in Magento 2 have the concept of variations of the same theme. So a theme can have different CSS and images but use the same templates, this can be configured per store per user agent in the admin. This is useful if you have different seasonable themes that are the same as each other but with a few different images and colours. To achieve the same in Magento 1 you would have to use packages and Magento's ability to cascade up, this is not longer necessary.
This development release of Magento has a major focus on updating the theme and template system to be more ridged unlike Magento version 1 where the template files could be basically any where within a theme.
Magento version two is coming. For those of us who are eagerly awaiting the next major version of the most popular and powerful open source e-commerce platform, you can now see, track and download the code on GitHub.
Not had chance to have an in depth look as yet but we expect great things!
https://github.com/magento/magento2
If you are thinking of adding a confirmation of e-mail address to the front-end registration pages of your store e.g the Checkout billing page or the customer account registration, the little snippets below could be of use to you
For the Checkout billing page
1. Locate the magento checkout billing page (billing.phtml) which can be found in app/design/frontend/default/
2. Add code 1 below where situable;
Code 1
For the validation of this email confirmation field with the actual email field
3. Locate the Javascript file which Magento uses for validation (validation.js) in /js/prototype
4. Add code 3 where suitable e.g immediately after this line(code 2) in validation.js
Code 2
Code 3
Then that should just do exactly what you want.
For the Customer Account Registration page
1. Locate the magento account register page ,register.phtml in
app/design/frontend/
2. Include code 4 where suitable
Code 4
After this, you should have another field on your registration page which can be subjected to any styling you need to do, most importantly when styling do not change the tag id's and class names, in a situation where you need to change them, you must also change the javascript selectors accordingly.
I hope this works for you.
If you have created a new product type and need to enable it to be included with configurable products you need to let Magento know that it should allow your product type to work with configurable products. To do this open your config xml and add the following xml.
This tells Magento to include your product type for use with configurable products.
I recently needed magento to be able to load a product, and if that product was part of a configurable product detect this and return the parent product if that existed. Looking around google I came across this code snippet and thought it should work
The problem is that the loadParentProductIds method was depreciated in 1.4.2.0 and I'm running 1.6. The new way of doing detecting if a product has a parent is to do this
Using this method I overrode the Mage_Catalog_Model_Product class and added this method, which will always return a configurable product if the product is associated with one. Be aware, that if you products belong to more than one configurable product you will have to modify the logic
If you are a PHP developer looking for a job in the Bradford area then please do get in touch with Edmonds Commerce.
We are a team of PHP developers who focus on e-commerce based on open source packages such as Magento, osCommerce, Prestashop, OpenCart and others. We also do a fair bit of WordPress, Drupal, Zend Framework etc as well. We even do bespoke PHP development.
If you are a skilled PHP developer and would like to join a team of enthusiastic developers in a friendly flexible environment with a focus on productivity, personal skills development and fun then get in touch with us today.
If you use Netbeans then you have no doubt seen the red wavy underline that pops under lines that have errors.
Unfortunatley if your errors relate to punctuation, eg concatenation full stops, then the red wavy line can actually obscure these making finding and fixing the error tricky.
An nice alternative is to set Netbeans to use a red strikethrough instead of the wavy line. This is just as visilble but does not obscure punctuation in any way making finding and fixing the error a lot easier.
To change this simply go to Tools->Options->Fonts & Colors
Then Set Language to All Languages
Then select Error in the category drop down
Simply change the Effects: drop down from Wave Underlined line to Strike Through
Just found out this bug that occurs when you try to call an overridden Magento magic methods within the override method. I created a custom attribute for a product with code "price_grid_csv" and I needed to still call the actual Magento magic method; see the below code
By default parent::getPriceGridCsv() should return the value of the current object with attribute code price_grid_csv, but it does not because it breaks the camel case structure of the method name by changing getPriceGridCsv to getpricegridcsv which breaks magento from returning the current object attribute with this code.
The way I got around this was by simply calling $this->getData('price_grid_csv') or by running Magento on PHP versions higher than 5.2.9, but I would recommend the first solution in order to make your code PHP version independent.
Also note that LAMP 1.7.1 is packaged with PHP 5.2.9
I have been making a mwnu system for magento that would allow a client to add extra links to CMS page to top menu through a static block. One of the requirements was when you clicked the link the menu should display as active.
To do this I extended the Category_Navigation Block so it would get the content of the static block and then check each href against the current url. If they matched then it would add the active class to the menu structure. This worked perfectly when running locally, so I pushed it to our staging site where it broke.
Assuming that there was a difference with the url structure on the stagin site that I hadn't anticipated, I echoed out the link variables and compared them, but they looked identical. Thinking there may be spacing that had snuck past trim, I var_dumped them and again they looked identical, apart for the fact that the character count was different.
After much messing around I came to two conclusions. Firstly Magento will append a session id to urls if you're using multi-store, and far more importantly, this extra information is not displayed if you var_dump the variable. I finally found this by turning the string into an array and echoing each character onto a new line, like so
To solve this replace your link with the following
and it will work the way that you expect.