News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

SH404SEF

Started by RyanK, September 17, 2012, 21:42:50 PM

Previous topic - Next topic

RyanK

Hello,

I was disappointed to learn VM2 was not compatible with SH404SEF. I contacted the extension author earlier this month and inquired as to why they have not updated their extension since they have always supported VM in the past.  It seems they have been waiting a month for the VM team to approve the changes. Can anyone offer an update as to the approval status?

The exact response to my inquiry with Anything-Digital, the makers of SH404SEF, is below.

Thanks for your time.
-Ryan

-------

Sep 5, 2012. For Virtuemart 2, we have created a new plugin that will ensure long-term compatibility as VM2+ grows. Simply put, we have future-proofed the sh404SEF plugin (though in doing so we have removed all the parameters that users of VM1.x might expect). It has been sent to the VM team for review 2 weeks back. We followed up a few days ago but still no word.

In short, we don't have a solution currently but we expect to have one very soon once we hear back from the VM2 team.

alatak

Hello

QuoteSep 5, 2012. For Virtuemart 2, we have created a new plugin that will ensure long-term compatibility as VM2+ grows. Simply put, we have future-proofed the sh404SEF plugin (though in doing so we have removed all the parameters that users of VM1.x might expect). It has been sent to the VM team for review 2 weeks back. We followed up a few days ago but still no word.
Strange reply from the sh404Sef team...since i received an email from the Yannick, the author of sh404Sef, and did the changes he suggested.
I just send him an email, and we are going to solve the problem.

mrtrung

#2
good to reply.. Thanks a lot

amlil71

Hello,

it's a very goog news.  I have the same difficults with sef urls since i uppgrade to virtuemart 2..





PS : Merci Alatak :) , je suis coincé depuis un mois sur ce problème ( hamid71 du forum joomla. fr).
     

Ffragrances

SO now that I have went ahead and bought the latest SH404SEF over the joomsef component, because I thought that they have been so solid, and always on top of things. Now I find out that my sight relaunch will be delayed because of this???? WTF.. I guess I wil have to go pay out money to the folks at Joomsef now, because I cannot stand for any further delays.. This is just crazy. I wonder if SH404SEF folks will refund my money. I already tested Joomsef and it works fine, but I decided based off of past experience that I would stay with sh404SEF.. Now I wonder if I should have just went with the folks that are now on top of things.... Geez

sandstorm

I'm in the same boat as last reply.

I have upgraded a VM1.19 site to vm2.0.12b  and upgraded it to J2.5.7
I have today installed SH404 3.6.2 and switched it on.

There is very little configuration for VM2 and it doesn't like pagination or ordering products.

When you order a product, say view 5 items on a page at once, it stores this URL and then whenever a user is in another category and orders to product to display 5 only , then they are refreshed to the stored URL.

VM1 & SH404 2.5, didn't work that well together and created a lot of duplicated links, but VM2 & SH404 3.6.2 seems even worse.


Has the work that Alatak has done and appears to have sent over to Yannick, been tested/implemented?  Or any ideas on when we can expect this?
I'm looking to upgrade a few VM 1 sites to VM2&J2.5 in the next few weeks/months and didn't really want to jump ship to JoomSEF
J3.6.4 / PHP7.0.12
VM3.0.16

sandstorm

If we cant get this working, does anybody know of a VM2 / SH404 plugin that will work? or is tried/tested?
J3.6.4 / PHP7.0.12
VM3.0.16

jjk

#7
I don't know why the new sh404sef plugin supplied by the sh404sef folks doesn't work, because I never had a look at it. Why don't you just enable Joomla 2.5.7 SEF AND VM2 SEF (VM2 SEF requires J2.5.x SEF enabled to work properly) and get rid of all the SEF trouble. It works perfectly without any third party SEF plugin, which means a lot less trouble and extra work.
If it's just because you want to redirect your old urls, note that J2.5.x has it's own redirection manager.

...just my opinion  :)
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

anthony

Bugger! I just renewed my SH404SEF subscription, only to then discover that VM2 won't play nice with it. I should have come here first.

J2.5 SEF does a nice job of the URLs, so I probably can survive just by skipping VM in the SH404SEF component configuration.
The greater our mastery over language, the sharper the tools with which to dissect reality.

franzpeter

What kind of adavantage has that SH404SEF? Using the standard Joomla SEF with Virtuemart does work without any problem. Did take a look in the page, where SH404SEF is offered. It rewrites url (Joomla does that too), it produces 404 pages and allows url rewrite (Joomla does that too), it uses Google Analytics and displays the results in Joomla (I use Google analytics too and display the results on my google account page), so maybe a little advantage for SH404SEF.
So my opinion is: I prefer to use the Joomla default router. If Joomla receives an update, the Joomla developers take care about the router functions, while an external component can only get adapted some time after the Joomla update. That time between can be very bad for search engine results, if the external SEF component produces problems until receiving an update from the developer.
Just my opinion about external SEF components!

StormIT

Is there any update on this do you know? Since the quote below was from September 5th 2012 and it's now 16th January 2013...

QuoteSep 5, 2012. For Virtuemart 2, we have created a new plugin that will ensure long-term compatibility as VM2+ grows. Simply put, we have future-proofed the sh404SEF plugin (though in doing so we have removed all the parameters that users of VM1.x might expect). It has been sent to the VM team for review 2 weeks back. We followed up a few days ago but still no word.

anisimow

#11
I've tried sh404SEF v4.1.0 with virtuemart v 2.0.22c . It's like compatible with virtuemart, but not completely. Manufacturer doesn't work at all, and product url is without category path.
Yannick Gaultier, I'm so sorry for ussing illegal it.  But I hope I can help a little. I've changed  virtuemart plugin in  components/com_sh404sef/sef_ext/com_virtuemart.php .
It  can show manufacturer and full path(with categories) to product page
I hope it helps somebody. Here my code

<?php
/**
 * sh404SEF - SEO extension for Joomla!
 *
 * @author      Yannick Gaultier
 * @copyright   (c) Yannick Gaultier 2012
 * @package     sh404sef
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @version     4.1.0.1559
 * @date 2013-04-25
 */

defined('_JEXEC') or die('Direct Access to this location is not allowed.');

if(!
class_exists(my_virtuemart_router)){
    class 
my_virtuemart_router{
        var 
$counter 0;
        public function 
getParentProductcategory($id){

                
$virtuemart_category_id 0;
                
$db JFactory::getDBO();
                
$query 'SELECT `product_parent_id` FROM `#__virtuemart_products`  ' .
                        
' WHERE `virtuemart_product_id` = ' . (int) $id;
                
$db->setQuery($query);
                
/* If product is child then get parent category ID*/
                
if (!$parent_id $db->loadResult()) {
                    
$parent_id $id;
                }
                        
$query 'SELECT `virtuemart_category_id` FROM `#__virtuemart_product_categories`  ' .
                                
' WHERE `virtuemart_product_id` = ' $parent_id;
                        
$db->setQuery($query);

                        
//When the child and parent id is the same, this creates a deadlock
                        //add $counter, dont allow more then 10 levels
                        
if (!$virtuemart_category_id $db->loadResult()){
                                
$this->counter++;
                                if(
$this->counter<10){
                                    
self::getParentProductcategory($parent_id) ;
                                }
                        }

                
$this->counter 0;
                return 
$virtuemart_category_id ;
        }
    }
}

// ------------------  standard plugin initialize function - don't change ---------------------------
$sefConfig = &Sh404sefFactory::getConfig();
$shLangName '';
$shLangIso '';
$title = array();
$shItemidString '';
$dosef shInitializePlugin($lang$shLangName$shLangIso$option);
if (
$dosef == false)
return;
// ------------------  standard plugin initialize function - don't change ---------------------------

$originalVars = empty($originalUri) ? $vars $originalUri->getQuery($asArray true);

if (
count($originalVars) == && !empty($originalVars['Itemid']) && !empty($originalVars['option']))
{
// use directly menu item
$item JFactory::getApplication()->getMenu()->getItem($originalVars['Itemid']);
if (!empty($item))
{
$query $item->query;
// // when limitstart is not set, VM2 fetches start from the session, instead
// of just assuming 0
if (!empty($query['view']) && $query['view'] == 'category')
{
if (!isset($query['limitstart']))
{
$limitstart 0;
shAddToGETVarsList('limitstart'$limitstart);
shRemoveFromGETVarsList('limitstart');
}
}
ShlSystem_Log::debug('sh404sef''Inside com_virtuemart.php, building url from menu item route');
$title = array($item->route);
}
}

if (empty(
$title))
{
ShlSystem_Log::debug('sh404sef''Loading component own router.php file from inside com_virtuemart.php');
$functionName ucfirst(str_replace('com_'''$option)) . 'BuildRoute';
if (!function_exists($functionName))
{
include(JPATH_ROOT '/components/' $option '/router.php');
}
$helper vmrouterHelper::getInstance($originalVars);        
$menuItem $helper->menuVmitems;
$shopName = empty($menuItem) ? 'vm' $menuItem[0]->alias;

// check for shop root url, else normal routing
if (!empty($originalVars['view']) && $originalVars['view'] == 'virtuemart')
{

// if VM is homepage, then that's fine
if (!shIsAnyHomepage($string))
{
// else use menu item alias as slug
$title[] = $shopName;
unset($originalVars['view']);
}

}
else
{
// various checks as VM2 seem to produce funky non-sef urls
if (!empty($originalVars['view']) && $originalVars['view'] == 'productdetails')
{
if (empty($originalVars['virtuemart_product_id']))
{
// request for product details, but product id is 0
return;
}
}

// when limitstart is not set, VM2 fetches start from the session, instead
// of just assuming 0
if (!empty($originalVars['view']) && ($originalVars['view'] == 'category' || $originalVars['view'] == 'manufacturer'))
{
if (!isset($originalVars['limitstart']))
{
$limitstart 0;
shAddToGETVarsList('limitstart'$limitstart);
shRemoveFromGETVarsList('limitstart');
// router.php expects this to be start, not limitstart
$originalVars['start'] = $limitstart;
}
else
{
$originalVars['start'] = $originalVars['limitstart'];
unset($originalVars['limitstart']);
}
}

$hasCategoryId = !empty($originalVars['view']) && $originalVars['view'] == 'category' && (!empty($originalVars['virtuemart_category_id']) || $originalVars['virtuemart_category_id'] == 0);
                
$hasManufacturerId = !empty($originalVars['view']) && $originalVars['view'] == 'manufacturer' && (!empty($originalVars['virtuemart_manufacturer_id']) || $originalVars['virtuemart_manufacturer_id'] == 0);
$hasProductPage = !empty($originalVars['view']) && $originalVars['view'] == 'productdetails' && (!empty($originalVars['virtuemart_product_id']) || $originalVars['virtuemart_product_id'] == 0);
                
$originalUrl $originalUri->get('_uri');
$nonSefItemid shGetURLVar($originalUrl'Itemid');

// have router.php build url
$title $functionName($originalVars);

// VM router set the Itemid for category links!!!!
// instead of doing the routing
if ($hasCategoryId)
{
// if no Itemid in the original non-sef url, but we have one now
if (empty($nonSefItemid) && empty($vars['Itemid']))
{
$validItemid = empty($helper->menu['virtuemart_category_id'][$vars['virtuemart_category_id']]) ? 0
$helper->menu['virtuemart_category_id'][$vars['virtuemart_category_id']];
}
else
{
$validItemid = empty($vars['Itemid']) ? $vars['Itemid'];
}

if (!empty($validItemid))
{
// we now use the calculated Itemid, either the original one
// or the one that was swapped in by Virtuemart router.php
$Itemid $validItemid;
$vars['Itemid'] = $validItemid;
$originalUri->setVar('Itemid'$validItemid);
shAddToGETVarsList('Itemid'$validItemid);

$item JFactory::getApplication()->getMenu()->getItem($validItemid);
if (!empty($item))
{
$menuRoute $item->route;
// now we have to either insert the menuRoute at the beginning of
// what was returned by Virtuemart router.php, or replace it entirely.
if (empty($title))
// router.php returned nothing, use menu item alias
$title = array($menuRoute);
}
else
// router.php returned a title[] for that non-sef
if (empty($nonSefItemid) && !empty($vars['Itemid']))
{
// there was no itemid in non-sef, but router.php or ourselves found one
// drop the title[] returned by router
$title = array($menuRoute);
}
else if (!empty($nonSefItemid) && !empty($vars['Itemid']) && $vars['Itemid'] != $nonSefItemid)
{
// there was an Itemid in non-sef, but router.php or ourselves changed it: use the new one
// and drop the title[] returned by router
$title = array($menuRoute);
}
else
{
// general use case: Itemid was not modified
array_unshift($title$menuRoute);
}
}
}
}

}
                
// VM router set the Itemid for category links!!!!
// instead of doing the routing
                
elseif ($hasManufacturerId) {
                    
                    
                        
// if no Itemid in the original non-sef url, but we have one now
if (empty($nonSefItemid) && empty($vars['Itemid']) )
{
$validItemid = empty($helper->menu['virtuemart_manufacturer_id'][$vars['virtuemart_manufacturer_id']]) ? 0
$helper->menu['virtuemart_manufacturer_id'][$vars['virtuemart_manufacturer_id']];
}
else
{
$validItemid = empty($vars['Itemid']) ? $vars['Itemid'];
}

if (!empty($validItemid))
{
// we now use the calculated Itemid, either the original one
// or the one that was swapped in by Virtuemart router.php
$Itemid $validItemid;
$vars['Itemid'] = $validItemid;
$originalUri->setVar('Itemid'$validItemid);
shAddToGETVarsList('Itemid'$validItemid);

$item JFactory::getApplication()->getMenu()->getItem($validItemid);
if (!empty($item))
{
$menuRoute $item->route;
// now we have to either insert the menuRoute at the beginning of
// what was returned by Virtuemart router.php, or replace it entirely.
if (empty($title))
// router.php returned nothing, use menu item alias
$title = array($menuRoute);
}
else
// router.php returned a title[] for that non-sef
if (empty($nonSefItemid) && !empty($vars['Itemid']))
{
// there was no itemid in non-sef, but router.php or ourselves found one
// drop the title[] returned by router
$title = array($menuRoute);
}
else if (!empty($nonSefItemid) && !empty($vars['Itemid']) && $vars['Itemid'] != $nonSefItemid)
{
// there was an Itemid in non-sef, but router.php or ourselves changed it: use the new one
// and drop the title[] returned by router
$title = array($menuRoute);
}
else
{
// general use case: Itemid was not modified
array_unshift($title$menuRoute);
}
}
}
}
                    
                }elseif(
$hasProductPage){
// if no Itemid in the original non-sef url, but we have one now
                        
$validItemid 0;
if (empty($nonSefItemid) && empty($vars['Itemid']))
{
$validItemid = empty($helper->menu['virtuemart_product_id'][$vars['virtuemart_product_id']]) ? 0
$helper->menu['virtuemart_product_id'][$vars['virtuemart_product_id']];
}

                        
//get item id of category
                        
if(empty($validItemid)){

                                        
$my_virtuemart_router = new my_virtuemart_router();
                                        
$virtuemart_category_id $my_virtuemart_router->getParentProductcategory($vars['virtuemart_product_id']);
                                        if(!empty(
$virtuemart_category_id))
                                            
$vars['virtuemart_category_id'] = $virtuemart_category_id;
                                        
if(!empty( $vars['virtuemart_category_id'])){
$categoryRoute $helper->getCategoryRoute($vars['virtuemart_category_id']);
//if ($categoryRoute->route) $segments[] = $categoryRoute->route;
if ($categoryRoute->itemId$vars['Itemid'] = $categoryRoute->itemId;
}
                                
                                
$validItemid = empty($vars['Itemid']) ? $vars['Itemid'];
                        }
if (!empty($validItemid))
{
// we now use the calculated Itemid, either the original one
// or the one that was swapped in by Virtuemart router.php
//$Itemid = $validItemid;
//$vars['Itemid'] = $validItemid;
//$originalUri->setVar('Itemid', $validItemid);
//shAddToGETVarsList('Itemid', $validItemid);

$item JFactory::getApplication()->getMenu()->getItem($validItemid);
if (!empty($item))
{
$menuRoute $item->route;
// now we have to either insert the menuRoute at the beginning of
// what was returned by Virtuemart router.php, or replace it entirely.
if (empty($title))
// router.php returned nothing, use menu item alias
$title = array($menuRoute);
}
else
// router.php returned a title[] for that non-sef
if (empty($nonSefItemid) && !empty($validItemid))
{
// there was no itemid in non-sef, but router.php or ourselves found one
// drop the title[] returned by router
array_unshift($title$menuRoute);
}
else if (!empty($nonSefItemid) && !empty($validItemid) && $validItemid != $nonSefItemid)
{
// there was an Itemid in non-sef, but router.php or ourselves changed it: use the new one
// and drop the title[] returned by router
$title = array($menuRoute);
}
else
{
// general use case: Itemid was not modified
array_unshift($title$menuRoute);
}
}
}
                        }
                        
                }
            

}
}

if (!empty(
$title))
{
// add shop menu item, if asked to
if ($sefConfig->shVmInsertShopName)
{
array_unshift($title$shopName);
}

// add user defined prefix
$prefix shGetComponentPrefix($option);
if (!empty($prefix))
{
array_unshift($title$prefix);
}
        
$title = empty($title) ? $title $pageInfo->router->encodeSegments($title);
        if (!empty(
$sefConfig->suffix)) {
            
$title[count($title)-1] .= $sefConfig->suffix;
}
}

// manage GET var lists ourselves, as Joomla router.php does not do it
if (!empty($vars))
{
// there are some unused GET vars, we must transfer them to our mechanism, so
// that they are eventually appended to the sef url
foreach ($vars as $k => $v)
{
switch ($k)
{
case 'option':
case 'Itemid':
case 'lang':
shRemoveFromGETVarsList($k);
break;
default:
// if variable has not been used in sef url, add it to list of variables to be
// appended to the url as query string elements
if (array_key_exists($k$originalVars))
{
shAddToGETVarsList($k$v);
}
else
{
shRemoveFromGETVarsList($k);
}
break;
}
}
}

// ------------------  standard plugin finalize function - don't change ---------------------------
if ($dosef)
{
$string shFinalizePlugin($string$title$shAppendString$shItemidString, (isset($limit) ? $limit null),
(isset($limitstart) ? $limitstart null), (isset($shLangName) ? $shLangName null), (isset($showall) ? $showall null),
$suppressPagination true);
}
// ------------------  standard plugin finalize function - don't change ---------------------------



mhuebler

hello anisimow,

is there now options of the sh404sef virtuemart plugin to customize the vm urls.
i want exactly the same urls like my vm1.x and sh404sef 2.x

anisimow

Quote from: mhuebler on November 16, 2013, 00:03:26 AM
is there now options of the sh404sef virtuemart plugin to customize the vm urls.
i want exactly the same urls like my vm1.x and sh404sef 2.x
There'is no options. In common, plugin use standart virtuemart router with a little changes.
But you can program it there like you need.

mhuebler

after a lot of years i used sh404sef for j1.5 vm1 .. now i use artio joomsef for j2.5 vm2 .. it gives you all the options to configure your own virtuemart urls ;-)