Categories
Interspire Tutorial

How to Add an `Edit Product` Link for Interspire Shopping Cart

Why can’t I just click a link to edit the product I’m viewing?

Interspire, I love ya, but the Interspire Shopping Cart has some silly omissions. Like a simple “Edit Product” link if you’re logged in as an administrator. Instead, you have to go to the backend, search for the product, then edit it…which takes a solid 20 seconds.

Well, I got tired of that, so here’s a way to generate a proper Edit Product link.

Part 1: Generate the link

In includes/display/ProductDetails.php:

Find $this->SetProductVariations();. Add this in a line below it:

$this->SetEditProductLink();

Add this following code just before the last, closing curly bracket in the file }

/**
 * Create a link to allow users with permission to edit products from the products page
 */
public function SetEditProductLink()
{
	$GLOBALS['EditProductLink'] = '';
	if(!isset($GLOBALS['ISC_CLASS_ADMIN_AUTH'])) { $GLOBALS['ISC_CLASS_ADMIN_AUTH'] = GetClass('ISC_ADMIN_AUTH'); }
	if($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Edit_Products)) {
		$GLOBALS['EditProductLink'] = sprintf('<a title="%3$s" class="Action" href="'.$GLOBALS['ShopPath'].'/admin/index.php?ToDo=editProduct&productId=%2$d">%1$s</a>', 'Edit Product', $GLOBALS['ProductId'], "Edit product ‘{$GLOBALS['ProductName']}’");
	}
}

Part 2: Place the link

Now the link will be generated in the global variable EditProductLink in your template’s ProductDetails panel.

  • Go to your template
  • Find Panels/ProductDetails.html
  • Add %%GLOBAL_EditProductLink%% to your template where you want the link. I like it after the add to cart button (%%SNIPPET_ProductAddToCart%%).
  • You’re all set!

Lots of time saved by all…

Hopefully this helps save you some frustration while polishing your Interspire store.

If this tip was helpful, please consider a donation!
Donate with PayPal (Much appreciated!)

By Zack Katz

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

6 replies on “How to Add an `Edit Product` Link for Interspire Shopping Cart”

How can i find the templates files in admin
i want to do this
i am looking for the layout files in interspire shopping cart admin.
here is my local url
http://localhost/admin/index.php?ToDo=viewOrders&searchId=0

Now can you help me to let me know where i can find the file which is responsible for creating the layout of View Orders.
Actually i need to add a new menu under ACTIONS->Add Invoice.
Thanks
http://www.vaseemansari.blogspot.com
Vaseem Ansari

Hello Zack,

Do you have any idea how I can get a tabbed panel on the products page?
I want to show the products information in 3 or 4 tabs but have no clue on how to do so.

Kind regards
Eric

How can I give this permission to a user who is not an administrator but manages product uploads.

Comments are closed.