Link to product manager from front end

I often find myself browsing the front end of my cart and and finding errors which require me to click through the control panel and find the product in the manager to edit it.



It would be sweet if when you are logged in as an administrator and browsing the front end… that there was a link to “Manage Product” that took you right to the products manager page…



Lance

Add the language variable:



manage_product = Manage product



In ‘/core/fn_users.php’



AFTER



'last_login' => empty($user_data['last_login']) ? 0 : $user_data['last_login'],




ADD



'user_type' => empty($user_data['user_type']) ? 'C' : $user_data['user_type'],




In ‘/skins/CLIENT_SKIN/customer/content.tpl’



AFTER



{elseif $content == "product_details"}




ADD


```php


{if $auth.user_type == "A"}
{$lang.manage_product}
{/if}

```

Great Matt, just GREAT!!!

Wow! Thanks Matt… That was totally unexpected. This might be a little Mod, but it is a HUGE time saver when it comes to browsing your front end and editing products. You definitely should add this to your portfolio of Mods even if it is a simple one.



Cheers! Lance

I am using 135 SP3 did as instructed but link doesn’t:confused: show up.



missed part

[QUOTE]manage_product = Manage product[/QUOTE]



works great thanks :slight_smile:

Can someone tell me how to use this in 2.04?

I would also LOVE to know how to do this is 2.04. I tried experimenting, but I know nothing. :stuck_out_tongue:

Add this somewhere in

[cs_cart_skin] → customer → views → products → view.tpl

(where ever you want the link to show up)



{if $user_info.user_type == "A"}
Edit Product
{/if}




you shouldn’t need any other code. And you need to be logged in as admin.

That’s awesome work! I wish CS-Cart would come with this modification. :cool:

Huge thanks for this

I can’t seem to get this to work with a modified default orange theme (2.05). Can you give me an example of a line that would work for placing this code?

I have added


{if $user_info.user_type == "A"}
Edit Product
{/if}




Below this



{hook name=“products:view_main_info”}



in


[QUOTE][cs_cart_skin] → customer → views → products → view.tpl[/QUOTE]



Also you must be logged in in front end to be able to see this link.




Works like a charm. Thanks, Darius.

How can i do this for the 2.14 version?

yea I got it running under 2.1.4





Add


{if $user_info.user_type == "A"}
Edit Product
{/if}




below



{hook name="products:view_main_info"}




in default_template.tpl or any other you use in



/skins/YOURSKIN/customer/blocks/product_templates



this may also be done by overriding hooks I think

Actually, you would use a prepend hook to do this without modifying standard files. Just add your anchor tag to the file:

skins//customer/addons/my_changes/hooks/products/view_main_info.pre.php



This will add the code just before the {hook} tag assuming there are no overrides of higher priority in place.

This

{if $user_info.user_type == “A”} … {/if}

don’t work for me…



Why? I am a administrator, and i can link direct from the code:



Edit Product



and for pages:



Edit Page



Any Help?

$user_info is not available on all pages and in all blocks… So relying on it is unwise.

This

{if $user_info.user_type == “A”} … {/if}

don’t work for me…



any ideia?

The solution:

You must also logged in frontend to work!