Add an Edit Product Link in Product Page of ISC

Add an Edit Product Link in product page directly if you are logged in as an administrator.

Implementation

In /includes/display/ProductDetails.php

Find

$this->SetProductVariations();

Replace

$this->SetProductVariations();
$this->SetEditProductLink();

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

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'] = "<a href='".$GLOBALS['ShopPath']."/admin/index.php?ToDo=editProduct&productId=".$GLOBALS['ProductId']."'>✎</a>";
	}
}

Finally, add %%GLOBAL_EditProductLink%% to your template where you want to display the Edit Product link. (I added the Edit Link next to SKU)

Result

Leave a Reply

Your email address will not be published. Required fields are marked *