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!)

Related posts:

  1. Add ‘Customers Also Purchased’ to the Cart Page on Interspire Shopping Cart
  2. Interspire Shopping Cart — Add a Brands Drop-Down Menu
  3. Preview Hidden Products in Interspire Shopping Cart
  4. Improve Interspire Shopping Cart Search with Smart Redirections
  5. Generate CSS Body Classes in Interspire Shopping Cart

This entry was posted in Interspire, Tutorial and tagged , , , . Bookmark the permalink.
  • http://www.shoppingcartstrategies.com/ Dave Beck

    Nice tip Zack.
    I think many of us have a love/hate relationship with Interspire.
    Dave

  • http://www.VaseemAnsari.blogspot.com Vaseem Ansari

    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

  • Eric kaelen

    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

  • http://osmungifts.com Gail Osmun

    Thank you. This saves me a lot of time, effort and frustration.

  • Vinay

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

  • http://www.facebook.com/people/Roderick-Andriessen/1346105684 Roderick Andriessen

    WoW thank you! works like a charm :)