- Автор темы
- #11
В файле /administrator/components/com_virtuemart/classes/ps_session.php примерно в районе 499 строки.
PHP:// Original Virtuemart Code: // $Itemid = "&Itemid=".$this->getShopItemid(); // VM-Expert Hack – Start // Strip the parameters from the $text variable and parse to a temporary array $tmp_text=str_replace('amp;','',substr($text,strpos($text,'?'))); if(substr($tmp_text,0,1)=='?') $tmp_text=substr($tmp_text,1); parse_str($tmp_text,$ii_arr); // Init the temp. Itemid $tmp_Itemid=''; $db = new ps_DB; // Check if there is a menuitem for a product_id (highest priority) if ($ii_product_id=intval($ii_arr['product_id'])) { $db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%product_id=$ii_product_id%' AND published=1"); if( $db->next_record() ) $tmp_Itemid = $db->f("id"); } // Check if there is a menuitem for a category_id $ii_cat_id=intval($ii_arr['category_id']); if ( $ii_cat_id && $tmp_Itemid=='') { $db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%category_id=$ii_cat_id%' AND published=1"); if( $db->next_record() ) $tmp_Itemid = $db->f("id"); } // Check if there is a menuitem for a flypage $ii_flypage=$ii_arr['flypage']; if ($ii_flypage && $tmp_Itemid=='') { $db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%flypage=$ii_flypage%' AND published=1"); if( $db->next_record() ) $tmp_Itemid = $db->f("id"); } // Check if there is a menuitem for a page $ii_page=$ii_arr['page']; if ($ii_page && $tmp_Itemid=='') { $db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND params like '%page=$ii_page%' AND published=1"); if( $db->next_record() ) $tmp_Itemid = $db->f("id"); } // If we haven't found an Itemid, use the standard VM-Itemid $Itemid = "&Itemid=" . ($tmp_Itemid ? $tmp_Itemid : $this->getShopItemid()); // VM-Expert Hack - End
воткнул этот хак вместо
$Itemid = "&Itemid=".$this->getShopItemid();
все равно итем ID наследуется неправильно ((nezn: