Issues with implementing a custom controller in magento - magento

Basically I have to generate PDF of wishlist items(products) using the chunk of codes as specified in http://gorrc.blogspot.in/2012/05/magento-print-whishlist-to-pdf.html.
Now the problem is, I am not able to trace out where and how to call all the methods as specified in above link. Can anyone help me in this or provide any alternate solution, I mean some other ways for generating PDF of wishlist items. Any Help will be highly appreciated!

How you want to do it?
Say more about where you want do this action and i'll point the right direction.

This is controller, its end point of url request.
Method is called when you navigate to specified URL.

Related

How to apply condition for specific page in magento?

I want to apply condition for specific page coming from url. It is neither a category page nor a custom cms page. Url is like localhost/project/index.php/news/blog.html. I want to apply condition for this 'news/blog.html' . News or blog is not a category and not any cms page. Can anybody help me?
It depends on the type of condition, you want to user over there. You can try with the following.
1. Try to put a observer in the relevant controller using the cheat sheet https://www.nicksays.co.uk/magento-events-cheat-sheet-1-5/
2. Directly try to edit model in the module of that page.
3. Try to put some code directly into the file.
Thanks,
Use the following code.
Mage::app()->getRequest()->getControllerName();
It will give controller name to your module. Put consition for this name and write your code. It will work for sure.

Backend Product Info Grid Modificaiton

I want to create a new text field right under the SKU text field in the Product Information > General tab and populate it with the product's attribute set value. What I want can be seen in the picture below.
Unfortunately, for the past 4 hours I have been trying to locate the file that includes the code which produces the specific layout but so far I had no luck. I 'd be really grateful if anyone could give me a heads up.
Thank you for your time!
Enable backend path hints to find out which file it is. You can do it this way.
http://www.classyllama.com/development/magento-development/enable-templateblock-hints-in-admin-panel
Please note this is basically hacking. A better way to do it would be to follow something like this
http://www.marketingadept.com/blog/2014/01/magento-developers-add-a-custom-field-to-the-category-admin-page/
It's up to you, speed or do it the right way. Goodluck

Magento Specifications (Additional Data = Attributes) not showing ONLY on two product pages??

I’m scratching my head over this one as I can’t quite figure out what’s going on.
The Specifications tab is supposed to show all the attributes for these two products, but there’s nothing shown here:
http://www.centurioncctv.com/index.php/outlet/recordersoutlet/hd16p.html
http://www.centurioncctv.com/index.php/outlet/recordersoutlet/hd08p.html
These two products are in the Digital Recorders Attribute set, just like the rest of these DVRs on other pages...
All of these DVRs show Specifications (Additional Data) correctly.... but why only on the two pages above nothing would show...?
Please share some ideas with me…
I’ve tried recreating the product (not duplicating), but the result is the same.
Does anyone know where to start? I know that it has something to do with view.phtml… or something. Or is it that perhaps the folder in which the attributes are stored have wrong permission?
Does anyone know where to look for permission status for certain products’ attributes??
I also added “Downloads” and they are also not shown…
Anyone? Please help?
Thank you!!
The additional attributes are actually rendered if you look at the generated page source. There seems to be a <div> nesting error in the description content, so the javascript selector to show the attributes doesn't work correctly.
I suggest cleaning up the HTML for the description, and the other tab should start working again.

injecting magento block to head via observed event

what magento frontend events can should I observe if I want the chance to inject blocks to the ("head" block) ?
and while in the observer's code, how do I check if the current layout has some handle (e.g. not_logged_in) set.
Give the
controller_action_layout_generate_blocks_after
event a try. The Layout object and its child blocks should be instantiated by the point that event fires.
There's only ever one Layout object, and you can grab the handles in play with
// get the layout->get the updates manager->get the handles
$handles = Mage::getSingleton('core/layout')->getUpdate()->getHandles();
var_dump($handles);
If you're working on front-end code and trying to stick to magento conventions, it's probably better to add a layout.xml file to your module, and use the layout file to add your blocks. It's less fun than figuring out something new though!
I appreciate the plug on the blog, but clockworkgeek is correct. The best way to accomplish this is to use a layout file to add the blocks you need. It is also possible for those blocks to change their own rendering behavior based on arbitrary code.
If there is a reason why you cannot use layouts, please elaborate a bit in your question and we'll be happy to help.

Is it possible to use HTML invoice?

I found it very hard to customize PDF invoice that Magento use. Not only hard to customize, but my client does not like it as well.
Is it possible to disable PDF invoice and use HTML invoice?
I googled it, but found nothing.
There are three real options here to get better invoices:
Write a better invoice system that
still uses PDFs. I've done this for
a client, it takes a long time. Unfortunately, there is no really good way to change the PDFs that Magento generates by default.
Replace the controller/action that
generate the PDFs with ones that
will simply output HTML.
Same as above, but override the
mass-action dropdown to contain your
new entries. This is probably the
easiest, and you can add more
reports while you're at it. Take a
look at
Mage_Adminhtml_Block_Sales_Order_Grid,
specifically _prepareMassaction
Hope that helps.
Thanks,
Joe
http://ext4mage.com/html2pdf-magento-extension.html#
grateful, grateful
But I find it a shame that magento does not have thi in core

Resources