Page 1 of 1

Product link from Admin to Store Front

Posted: Sat Apr 30, 2011 5:00 am
by (cj)
I'd like to add a link from the admin product list to the front end product page as a new page pop-up. I'm posting this in VQMods because I want to do it with a VQMod. I've got the VQMod in place, I've got the 'replace' working, but... Problem is, I don't know how to create the links. I need the dynamic link for each product as it builds the product list in the admin side.

I looked through the front end category controller in hopes of finding the variable. I looked through the front end template and tried using the link variable there but I got errors there.

So the simple question is, in my VQMod, after finding the right place, I replace with this:

<td><a href="XXXXX">[O]</a><?php foreach ($product['action'] as $action) { ?>

(oh - and I'm using the 'Make Product and Category Names Links' VQMod as well)

But the 'XXXXX' needs to be the link to the front end product page, using a new window popup. I'd appreciate any help. Of course I looked through the forums but failed to find what I'm looking for.

And.... to finish this off, I hope to replace the [O] with a small image.

Re: Product link from Admin to Store Front

Posted: Sat Apr 30, 2011 11:09 pm
by ocpro
Change

Code: Select all

<td class="right"><?php foreach ($product['action'] as $action) { ?>
to

Code: Select all

<td class="right">[ <a href="<?php echo $this->config->get('config_url') . 'index.php?route=product/product&product_id=' . $product['product_id']; ?>" target="_blank">O</a> ]<?php foreach ($product['action'] as $action) { ?>

Re: Product link from Admin to Store Front

Posted: Sun May 01, 2011 12:00 am
by (cj)
Awesome ocpro! That did the trick. Thank you so much for the link generation. I actually put the link in a bit different place, but this is great.

I just don't yet understand the linking via php just yet so thank you for your help.

Re: Product link from Admin to Store Front

Posted: Sun May 01, 2011 12:39 am
by ocpro
You're welcome 8)

Re: Product link from Admin to Store Front

Posted: Mon Jul 04, 2016 11:13 am
by Iven
:laugh:
This is final solution:
<?php echo HTTP_CATALOG . 'index.php?route=product/product&product_id=' . $product['product_id']; ?>

HTTP_CATALOG is defined at config.php file.