WordPress.org

Ready to get started?Download WordPress

Forums

Mage Enabler
[resolved] Workaround for inability to edit Magento Products and Attribute Sets (3 posts)

  1. John LeBlanc
    Member
    Posted 2 years ago #

    Aloha Richard and friends!

    I initially ran into issues while updating Products and Attribute Sets within Magento 1.5.1.0 and 1.6.0.0. When saving products, I'd receive "Decoding failed: Syntax error." When saving attribute sets, I'd get "An error occurred while saving the attribute set."

    I traced it back to a JSON decoding issue within app/code/core/Mage/Core/Helper/Data.php

    Meanwhile, it seemed as though the POST data looked totally cool.

    I beat myself up for a long while debugging themes, modules, database & server configs before realizing that it may be WordPress to blame and that WP functions need not be available within Magento admin.

    My solution: I modified Magento's index.php to conditionally load WordPress:

    if ( strpos($_SERVER['REQUEST_URI'], 'index.php/admin') === FALSE )
    {
        @ini_set('session.auto_start','0');
        define('WP_USE_THEMES', false);
        require_once('/path/to/wp-load.php');
    }

    You'll want to modify the 'index.php/admin' portion to match a slice of your Magento Admin URL.

    I hope this is useful.

    Richard - Perhaps this might deserve a spot in your Install instructions?

    Aloha!
    John

    http://wordpress.org/extend/plugins/mage-enabler/

  2. Stefan Boonstra
    Member
    Posted 2 years ago #

    The MageEnabler sounds like a lot of difficult in-code fixing which I think shouldn't be necessary. This plugin: http://wordpress.org/extend/plugins/magento/ will enable you to show/advertise Magento products on your WordPress website without having to go into it's source code and you are able to place it nearly anywhere on your website as a widget or a line of shortcode. It's fully and easily customizable, of course.

  3. gallivan
    Member
    Posted 2 years ago #

    John, this worked like a charm. I agree, Richard should add this code to the install instructions.

    Stefan... I disagree. MageEnabler only requires a minimal amount of adjustment that doesn't affect the core code. I'm building an entire store which uses the WordPress header, footer and styles throughout... even the checkout/customer pages!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic