WordPress.org

Ready to get started?Download WordPress

Forums

Simple Facebook Connect
Share button conflicts with Shopp (2 posts)

  1. goto10
    Member
    Posted 3 years ago #

    I've run into a conflict with the SFC Share button and the Shopp plugin. Here's the work-around I've come up with. I was hoping that maybe a better fix could be implemented. Not sure if SFC or Shopp is the real "culprit", so I'm posting in both the SFC and Shopp (commercial plugin) forums.

    <?php
    // Remove sfc_share_meta() action on Shopp pages, because it(?) breaks Shopp's login validation notices when trying to log in.
    // As of SFC - Share Button Version v0.25, the offending code is: sfc-share.php line 211: $content = apply_filters('the_content', $content);
    // WP v3.05, Shopp v1.1.7
    // Add this code to your theme's functions.php
    function remove_sfc_share_meta() {
    	// Normally, I'd set get the special Shopp page ids from a theme options panel, but I hard coded them here for the example
    	$my_account_page_id = 100;
    	$checkout_page_id = 102;
    	if ( is_page( $my_account_page_id ) || is_page( $checkout_page_id ) ) {
    		remove_action( 'wp_head', 'sfc_share_meta' );
    	}
    }
    add_action( 'wp_head', 'remove_sfc_share_meta', 9 ); // make sure to fire it before the default priority of 10

    I'm not exactly sure why this is happening, but wanted to share my workaround anyway. On the Shopp end of things, when a login error occurs, a new ShoppError object is instantiated, formatted with the Shopp template errors.php, and displayed inside the content area (where the [account] or [checkout] shortcodes are present.

    shopp/core/flow/Login.php

    new ShoppError(__("The password is incorrect.","Shopp"),'invalid_password',SHOPP_AUTH_ERR);

    errors.php template

    <div id="errors" class="shopp">
    	<h3>Errors</h3>
    	<ul>
    		<?php shopp('checkout','errors'); ?>
    	</ul>
    </div>

    I'm only using the SFC Share sub-module. It may be possible that other sub modules also conflict with Shopp. The SFC Base module does not cause a problem. It's also worth noting that I'm using the Simple Twitter Connect base plugin and Tweet Button, which do not exhibit this problem.

    Hope this helps someone!

    http://wordpress.org/extend/plugins/simple-facebook-connect/

  2. Zack Katz
    Member
    Posted 2 years ago #

    Wow, thanks. I'm frustrated I didn't find this earlier! Yep, there are some issues there.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic