Skip to content

Instantly share code, notes, and snippets.

@hiranthi
Last active December 14, 2015 01:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hiranthi/5003950 to your computer and use it in GitHub Desktop.
Customizing the placement of the "add-to-wishlist" button/link for the Wishlist Pro plugin for Shopp.
<?php
/**
* Disable auto-placement of "add to wishlist buttons/links"
*/
function custom_sw_shopp_init()
{
$sw = new ShoppWishlist()
remove_filter('shopp_product_description',array(&$sw, 'button_product'), 99); // disable the auto-placement in product description
remove_filter('shopp_product_summary',array(&$sw, 'button_category'), 99); // disable the auto-placement in product summary (used mostly on category pages
} // end custom_sw_init
add_action('shopp_init','custom_sw_shopp_init');
// Use this to place the add-button manually:
shopp('wishlist-pro','add-button','options');
// Options:
# type - link | checkbox
# before - add something before the link/checkbox
# after - add something after the link/checkbox
# add - text to use for the add-to-wishlist link/checkbox-label
# listed - text to use for when the product is already listed
# linklisted - whether to link the listed text or not (the link will be to remove the product from the wishlist)
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment