Post by (cj) » Sat Apr 30, 2011 5:00 am

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.

(cj)
http://www.adventhouseplans.com
----
Opencart v2.3.0.2 no VQMod yet


New member

Posts

Joined
Fri Dec 17, 2010 6:17 am

Post by ocpro » Sat Apr 30, 2011 11:09 pm

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) { ?>

New member

Posts

Joined
Tue Apr 26, 2011 7:57 am

Post by (cj) » Sun May 01, 2011 12:00 am

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.

(cj)
http://www.adventhouseplans.com
----
Opencart v2.3.0.2 no VQMod yet


New member

Posts

Joined
Fri Dec 17, 2010 6:17 am

Post by ocpro » Sun May 01, 2011 12:39 am

You're welcome 8)

New member

Posts

Joined
Tue Apr 26, 2011 7:57 am

Post by Iven » Mon Jul 04, 2016 11:13 am

: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.

Newbie

Posts

Joined
Mon Jul 04, 2016 11:11 am
Who is online

Users browsing this forum: No registered users and 7 guests