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

function addJS from cart.php controller misses Itemid on links

Started by razor7, May 17, 2012, 19:43:36 PM

Previous topic - Next topic

razor7

Hi, I think Itemid must be added to JS popup link buttons

On line 125 and 126, links misses the Itemid parameter
$this->json->msg = '<a class="continue" href="' . $continue_link . '" >' . JText::_('COM_VIRTUEMART_CONTINUE_SHOPPING') . '</a>';
$this->json->msg .= '<a class="showcart floatright" href="' . JRoute::_("index.php?option=com_virtuemart&view=cart") . '">' . JText::_('COM_VIRTUEMART_CART_SHOW_MODAL') . '</a>';


Tryed to get Itemid like this
$Itemid = &JSite::getMenu()->getActive()->id;

But I can't find the item id, because  $Itemid gets empty ¿?

Thanks in advise.
MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

WebStuff

This should give you an ItemId string to add to the end of the URL if one is returned.
//Find VM2 Itemid from Joomla.
$db = &JFactory::getDbo();
$qry = "SELECT `id` FROM #__menu WHERE `link` LIKE \"%com_virtuemart%\" AND `client_id` =0 ";
$db->setQuery($qry);
$db->query();
$modules = $db->loadResult();

$ItemIdString = "";
if ($modules) {
$ItemIdString = "&Itemid=".$modules;
}

Hope this helps.

razor7

MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store