Title: PHP Fatal Error When Using Shortcodes
Last modified: August 21, 2016

---

# PHP Fatal Error When Using Shortcodes

 *  Resolved [J. Isaac Friend](https://wordpress.org/support/users/neoloki/)
 * (@neoloki)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/)
 * I am using both the MWI integration as well as the shortcodes/widgets extension.
 * I have had ZERO problems with the integration itself, and am able to pull in 
   the Magento header/footer perfectly. However, when I try to use a shortcode to
   display a product in a custom template page I run into an issue.
 * If the SKU# I enter is invalid, I simply get an error message that the product
   doesn’t exist. But if the SKU # I enter IS valid, I get the following PHP Fatal
   Error:
 * PHP Fatal error: Call to a member function getStoreLabel() on a non-object in/
   www/sites/www.pfiwestern.com/files/releases/20130904162356/app/design/frontend/
   enterprise/pfi/template/catalog/product/price.phtml on line 50
 * Any thoughts on how to resolve this or what could be causing it?
 * [http://wordpress.org/plugins/magento-wordpress-integration/](http://wordpress.org/plugins/magento-wordpress-integration/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Thread Starter [J. Isaac Friend](https://wordpress.org/support/users/neoloki/)
 * (@neoloki)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4098962)
 * FYI Here is Line 50 from the price.phtml file:
 * $_specialPriceStoreLabel = $this->getProductAttribute(‘special_price’)->getStoreLabel();
 * I wasn’t sure if that was a standard or a custom file, so I wanted to provide
   the relevant line of code.
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4098976)
 * Hi neoloki,
 * This is a default Magento file, so probably best not to edit! Could you show 
   me a screenshot of your mwi settings?
 * Also, could you test the shortcode with the price hidden?
 * Thanks,
    James
 *  Thread Starter [J. Isaac Friend](https://wordpress.org/support/users/neoloki/)
 * (@neoloki)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4098980)
 * Screenshot of settings:
 * > [View post on imgur.com](https://imgur.com/d6JNAxb)
 * Using the shortcode with the price hidden (as follows) seems to work just fine!
 * [mwi_product sku=”style-9144″ title=”true” title_tag=”h2″ desc=”true” img=”true”
   img_width=”200″ price=”false” type=”add” btn_color=”blue” btn_link=”button” cols
   =”3″/]
 * Originally I was using the shortcode like this:
 * [mwi_product sku=”style-9144″/]
 * And was getting the error I described above. Using the shortcode in this manner
   still does not work.
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4098988)
 * What happens if you change the website code setting to base? Just for testing
   purposes, you can change it back afterwards.
 *  Thread Starter [J. Isaac Friend](https://wordpress.org/support/users/neoloki/)
 * (@neoloki)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4098994)
 * If I change the code setting to “base” and leave the price disabled then everything
   works fine. However, if I enable the price, I get the same PHP Fatal error PLUS
   another error that may be unrelated. Here they are:
 * [06-Sep-2013 03:59:35 UTC] PHP Fatal error: Call to a member function getStoreLabel()
   on a non-object in /www/sites/www.pfiwestern.com/files/releases/20130904162356/
   app/design/frontend/enterprise/pfi/template/catalog/product/price.phtml on line
   50
 * [06-Sep-2013 03:59:35 UTC] PHP Fatal error: Access to undeclared static property:
   Ai1ec_Loader::$_instance in /www/sites/www.pfiwestern.com/files/releases/20130904162356/
   buzz/wp-content/plugins/all-in-one-event-calendar/lib/class-ai1ec-loader.php 
   on line 43
 * [06-Sep-2013 03:59:35 UTC] PHP Fatal error: Class ‘Mage’ not found in /www/sites/
   www.pfiwestern.com/files/releases/20130904162356/app/code/core/Mage/Core/Model/
   Resource/Session.php on line 108
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4098999)
 * Very strange. Could you send WP, Mage and FTP logins to [support@jckemp.com](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/support@jckemp.com?output_format=md)
   and I’ll take a look.
 * Thanks.
 *  Thread Starter [J. Isaac Friend](https://wordpress.org/support/users/neoloki/)
 * (@neoloki)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099085)
 * I sent the credentials on 9/6 and have not had any contact since. Can you please
   provide me with an update here?
 * Another question has also come up:
 * This is a multi-store install of Magento, and when I place a product on a WordPress
   page it automatically links to the primary store version of the product. Is there
   any way to have it link to the other store?
 * _[Moderator Note: [No bumping](http://codex.wordpress.org/Forum_Welcome#No_Bumping),
   thank you.]_
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099094)
 * Hi Neoloki,
 * As I’m sure you’ll understand, I have a large number of support requests, and
   only I handle them whilst working full time.
 * Did you make sure to mention your username/link to the page in your email, as
   I can’t find any emails mentioning it.
 *  Thread Starter [J. Isaac Friend](https://wordpress.org/support/users/neoloki/)
 * (@neoloki)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099097)
 * I will re-send them.
 *  Thread Starter [J. Isaac Friend](https://wordpress.org/support/users/neoloki/)
 * (@neoloki)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099140)
 * I re-sent the credentials a week ago. Has there been any progress on this issue?
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099141)
 * Hi Neoloki,
 * I have replied already to any emails in my support account. Have you checked 
   junk?
 *  [Malachy](https://wordpress.org/support/users/mmcconnell/)
 * (@mmcconnell)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099159)
 * Are you using Magento 1.8? In 1.8 the default price.html file got that extra 
   code added at line 50.
 * Anyway, you can make your own `price.html` file and edit the code in it. The 
   solution used is to create this file in your theme path to override the base 
   file, so you would create a new file:
 * `/app/design/frontend/yourTheme/default/template/catalog/product/price.phtml`
 * and copy all the code from
 * `/app/design/frontend/base/default/template/catalog/product/price.phtml`
    into
   it.
 * Then change line 50 from
 * `$_specialPriceStoreLabel = $this->getProductAttribute('special_price')->getStoreLabel();`
   
   to
 *     ```
       if ($myTheme_dummy = $this->getProductAttribute('special_price')){
        $_specialPriceStoreLabel = $myTheme_dummy->getStoreLabel();
        }
       ```
   
 * Then upload this file to your server. (if you are using the default Magento theme
   because you bring everything into WordPress then use `design/frontend/default/
   default/template/catalog/product/price.html` to override the file – or even just
   change the `base/default/...` file; it’s discouraged but for your set up and 
   this fairly benign edit it you should be fine).
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099166)
 * Hi Malachy,
 * Thanks for the fix – frustrating that the error is occurring! Here is the file
   under version control for future reference, with instructions:
 * [https://bitbucket.org/jamesckemp/magento-getstorelabel-error-v1.8/overview](https://bitbucket.org/jamesckemp/magento-getstorelabel-error-v1.8/overview)

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘PHP Fatal Error When Using Shortcodes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/magento-wordpress-integration_1f262e.
   svg)
 * [Magento Wordpress Integration](https://wordpress.org/plugins/magento-wordpress-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/magento-wordpress-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/magento-wordpress-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/magento-wordpress-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/magento-wordpress-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/magento-wordpress-integration/reviews/)

## Tags

 * [MWI](https://wordpress.org/support/topic-tag/mwi/)
 * [PHP Fatal error](https://wordpress.org/support/topic-tag/php-fatal-error/)

 * 13 replies
 * 3 participants
 * Last reply from: [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes/#post-4099166)
 * Status: resolved