Author Topic: Frontend link from admin product list view  (Read 957 times)

sandomatyas

  • Jr. Member
  • **
  • Posts: 376
Frontend link from admin product list view
« on: January 29, 2022, 07:06:17 am »
It would be nice having a frontend link from the admin product list view. Even more nice if it could be SEF url. Now we only have this from the product edit page.
A small .vm2-modallink icon or just link on the sku
Thanks a lot

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1542
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Frontend link from admin product list view
« Reply #1 on: January 29, 2022, 08:09:01 am »
I don't need it, but if:
You can find link to product in file - administrator/components/com_virtuemart/views/product/view.html.php
then you can use it and add to table in file administrator/components/com_virtuemart/views/product/tmpl/default.php

Something as:

Code: [Select]
$menuItemID = shopFunctionsF::getMenuItemId(vmLanguage::getLanguage()->getTag());
$canonLink='';
if($product->canonCatId) $canonLink = '&virtuemart_category_id='.$product->canonCatId;
$product->product_sku_link = '<a href="'.juri::root().'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$product->virtuemart_product_id.$canonLink.'&Itemid='. $menuItemID .'" target="_blank" >'. $product->product_sku .'<span class="vm2-modallink"></span></a>';

and the next

Code: [Select]
<?php 
//echo $product->product_sku;
echo $product->product_sku_link;
?>


and next time, have you ever tried to hire a developer or learn it yourself?

Edit:

You can tune and show link only for published product:

Code: [Select]
<td>
<?php 
if ($product->published != 0) {
echo $product->product_sku;
echo '<span class="pull-right">' $product->product_sku_link '</span>';
} else {
echo $product->product_sku;
}
?>

</td>
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

sandomatyas

  • Jr. Member
  • **
  • Posts: 376
Re: Frontend link from admin product list view
« Reply #2 on: January 30, 2022, 09:27:04 am »
I can do it myself without any problem, I've already written several extensions for VirtueMart, also sent few patches before.
The problem is it's not update-proof. If I modify the view.html.php and update VM it will override the file. If I create a template-override for the layout I won't gain the benefits of the new updates. So I've created a system plugin which adds it via JavaScript and ajax.
But I don't understand the tone. I think feature suggestions should be helpful for the community because the core component would be better and better, don't you think? :) Or is there better place to suggest new features?

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1542
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Frontend link from admin product list view
« Reply #3 on: January 30, 2022, 11:24:20 am »
Quote
Or is there better place to suggest new features?

Yes, I think special section for contact DEV team
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

sandomatyas

  • Jr. Member
  • **
  • Posts: 376
Re: Frontend link from admin product list view
« Reply #4 on: January 31, 2022, 14:09:17 pm »
Thanks, I'll check next time :)