News:

Looking for documentation? Take a look on our wiki

Main Menu

Frontend link from admin product list view

Started by sandomatyas, January 29, 2022, 07:06:17 AM

Previous topic - Next topic

sandomatyas

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

#1
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:


$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


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


<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

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

QuoteOr 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