What is the role of applyDesign in magento - magento

I am using magento 1.7. I am working on extension for quick view of product. I am unable to understand the following code.
Mage::getModel('catalog/design')->applyDesign($product, Mage_Catalog_Model_Design::APPLY_FOR_PRODUCT);
can anybody tell me what is the purpose of this function applyDesign because i have tried comment this line but no change happened so i am wondering why this code used for ????

Ref. Mage_Catalog_Model_Design::applyDesign() (link).
It's a deprecated method for applying the package+theme design settings which can be set at the product level. If you are not seeing a change, it is because there is no entity-level data set for that entity (which is normal).

Related

Magento PhpStorm "method not found in class"

I just started to use PhpStorm and I am also not very familiar with Magento but just starting out.
Anyhow after getting all setup with git, my dev server and local database I am getting a lot of the errors: "Referenced method is not found in subject class".
This is not for all methods.. but it does seem to be a large portion of them.
What is causing this?
Some example methods: getProductUrl, getName, productAttribute, getRatingSummary, and on and on.
You should look to http://magicento.com/
This plugin will enable more autocompletion for Magento.
But there's some magic methods that not exists in the code, and of course, will no be clickable.
This plugins enables autocompletion in more than only just methods, it will enable it for templates names (in setTemplate), layout.xml block types, controller actions and more....
A must have when coding for Magento with phpStorm.
Basically, i will take a simple exemple, your IDE is not able to follow a model instansiation like this one:
$product = Mage::getModel('catalog/product')->load($productId);
When you do this, your IDE don't know that $product is an instance of Mage_Catalog_Model_Product. It should look into config.xml to resolve the classname. And so, you can't follow product methods.
Magicento enables this behavior.

Entity Relationship not seen under Look For in Advanced Find for CRM 4.0

I have the following issue.
I have a custom entity which i have imported in 2 environments. In environment 1, the entity got imported without much difficulty and worked as I had created it.
In the 2nd environment, the entity got imported but i can not see Created By relationship for user under Related label in Advanced find view. However, in the 1st environment and the environment that I had developed in, I can see this relationship.
I do not know why this is happening and the only way to correct it is through unsupported update to CRM Metadata Table.
Can someone please tell me what am I doing wrong?
If you go into the customizations and open the attribute there is a property there that determines if a field shows in advanced find or not. Can you check to make sure that Searchable is set as Yes?

Payment modules not stored in VirtueMart

I have a huge problem with my VirtueMart. I try to develop a new payment module for it. The main problem is that no matter how I do it VirtueMart seems to refuse to let me store the plug-in in the database and also it refuses to let me choose it as a payment method.
I have disabled all other "countries" except the one that the module is written for. I have followed all guides on joomla mastery. I am convinced that my constructor is correct according to the scarce documentation I have found. I have even copy/pasted an existing payment module and changed all names for the database to something different so I can see if it's created and it's a no-go.
I am starting to get desperate. Does anyone have a good virtuemart developer guide? Do I need to turn some flags on (the flag to update/write to database is on in joomla and virtuemart) or off? How can I programatically FORCE VirtueMart to actually listen to what it say should work in all documentations I've found?

Magento programmatically created attributes showing up in backend but not frontend

I have a script that bulk creates attributes and sets in Magento. The attributes and their sets look fine, and the settings are correct. When these attributes are created, I use AMartinez's customimpertexport script to bulk import products. These products do have the attributes correctly filled in.
If I look at a product in the back-end, they are there, with the correct values. When I take a look at the front-end however, the values are not displayed. Also, the layered navigation does not work (probably because of forementioned bug).
This makes me think there is something going wrong with linking attributes to products.
Since I'm pretty new at Magento, I don't know very much of it yet, so any explanations on how or why would be apreciated.
Check out your attributes' settings. "Use In Layered Navigation" and "Used in Product Listing" options should be enabled.
Also you should use default Magento import/export functionality. Just keep in mind that the script has a really strange and sillent way to handle exceptions in code formating and missing fields, only hard exceptions like missing SKU fields are displayed.
Here is a tutorial fromt he magento knowledge base
http://www.magentocommerce.com/knowledge-base/entry/tutorial-using-magentos-import-export-profiles
Also, you should check of the attribute is visible on the frontend.

Magento custom attributes failing to install

I followed the tutorial at http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/installing_custom_attributes_with_your_module step by step to make my module install a couple of custom attributes, using Magento CE 1.4. I get to see the custom attributes on the product edit page, but whenever I try to save them I get an SQL error complaining that column "myattrid" does not exist. I know that:
this column is part of the flat product tables and indeed, it is not there
a lot of people give the advice to create by hand, but this bypasses the point of automatic installation
Is the tutorial I followed outdated? If so, what extra steps do I need to take?
An alternative approach is outlined in this blog post. You could try that.
I agree that you should avoid creating the attributes manually, there are many keys, indexes and relationships that Magento needs to be aware of which might be bypassed if you go straight to the database.
HTH,
JD

Resources