Jan 20, 2012 ·
1 minute read
magento
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 $_product = Mage::getModel('catalog/product')->load($productId); $parentIdArray = $_product->loadParentProductIds() ->getData('parent_product_ids'); if(!empty($parentIdArray)) { // do something } The problem is that the loadParentProductIds method was depreciated in 1.4.2.0 and I’m running 1.6.
Read On →
Jan 19, 2012 ·
1 minute read
job
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.
Jan 19, 2012 ·
1 minute read
netbeans
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.
Read On →
Jan 18, 2012 ·
1 minute read
magento
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 public function getPriceGridCsv(){ $price_csv=parent::getPriceGridCsv(); if(condition) $price_csv=<further processing of $price_csv> return $price_csv; } 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.
Read On →
Jan 17, 2012 ·
2 minute read
magento
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.
Read On →
Jan 17, 2012 ·
2 minute read
magento
Magento is a typical PHP Model View Architecture (MVC) system which routes its URLs in ways not particularly different from other PHP MVC Frameworks like codeigniter, symphony etc. But the difference it has with other MVC architecture is that most of its routing directives or configurations are XML based i.e. found in one XML file or the other. For example, www.yourstore.co.uk/index.php/checkout/cart/index, tells Magento to use the checkout module found in app/code/Mage/, use the cart controller (i.e.
Read On →