Categories
Shopp WordPress

Edit Product Link for Shopp Plugin

Shopp PluginIf you use the Shopp plugin for WordPress, you’ve likely found something frustrating: you click on the “Edit Post” link, and you get to edit the Store page, not the product in Shopp.

Here’s a quick fix: add the following to your theme’s functions.php file:

function edit_product_link($link = 'Edit Product', $before = '', $after = '') {
	global $post, $Shopp;

	if ( $post->post_type == 'page' ) {
		if ( !current_user_can( 'edit_page', $post->ID ) )
			return;
	} else {
		if ( !current_user_can( 'edit_post', $post->ID ) )
			return;
	}

	if (shopp('product','found')) {
		$page = 'shopp-products-edit';
		$id = shopp('product','id','return=true');
	}

	$url = admin_url("/admin.php?page=$page&id=$id");

	$link = '<a title="' . attribute_escape( __( 'Edit product' ) ) . '" href="'.$url.'">' . $link . '</a>';
	echo $before . $link . $after;
}

Then add edit_product_link() into your template, and you can edit products directly from your website. Woot!.

By Zack Katz

Zack Katz is the founder of GravityKit and TrustedLogin. He lives in Leverett, Massachusetts with his wife Juniper.

6 replies on “Edit Product Link for Shopp Plugin”

Has anyone else had problems ordering the Shopp Plugin?

I recently placed an order for the Shopp Plugin based on reviews I’ve seen but ran into a problem during the order. Though my payment went through on PayPal, the Shopp site wouldn’t let me download the plugin. It says “awaiting payment.”

I tried to go through the company’s support process with no success. Jonathan Davis responding to my support request initially, but now will not respond. I would have liked to use the plugin, but since I can’t even place a successful order for it and download it, I wonder if it doesn’t work very well for virtual/downloadable products. Now I have to go through the hassle of PayPal dispute resolution to try to get Ingenesis Limited to give me my money back.

It would seem that shopp('product','found') didn’t find a product for you….

I would try this:

if (shopp('product','found')) {
	$page = 'shopp-products-edit';
	$id = shopp('product','id','return=true');
}
// Add the following code:
elseif($Shopp->Product) {
	$page = 'shopp-products-edit';
	$id = $Shopp->Product->id;
}

I’ve had no problems with the original code, but that should help your issue…Let me know!

Hey experts, I have a question maybe you can help with. Shop seems to be putting the products in a Alpha or Numeric list order by title. This is kinda/very cheesy, does anyone know how to edit the order in which the products show?

Hey experts, I have a question maybe you can help with. Shop seems to be putting the products in a Alpha or Numeric list order by title. This is kinda/very cheesy, does anyone know how to edit the order in which the products show?

Comments are closed.