• 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/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter J. Isaac Friend

    (@neoloki)

    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 jamesckemp

    (@jamesckemp)

    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

    (@neoloki)

    Screenshot of settings:

    View post on imgur.com

    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 jamesckemp

    (@jamesckemp)

    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

    (@neoloki)

    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 jamesckemp

    (@jamesckemp)

    Very strange. Could you send WP, Mage and FTP logins to support@jckemp.com and I’ll take a look.

    Thanks.

    Thread Starter J. Isaac Friend

    (@neoloki)

    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, thank you.]

    Plugin Author jamesckemp

    (@jamesckemp)

    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

    (@neoloki)

    I will re-send them.

    Thread Starter J. Isaac Friend

    (@neoloki)

    I re-sent the credentials a week ago. Has there been any progress on this issue?

    Plugin Author jamesckemp

    (@jamesckemp)

    Hi Neoloki,

    I have replied already to any emails in my support account. Have you checked junk?

    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 jamesckemp

    (@jamesckemp)

    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

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘PHP Fatal Error When Using Shortcodes’ is closed to new replies.