Joomla 3.3购物车在购买后没有清空,请检查我的路由器文件


Joomla 3.3 Cart not emptying after purchase when sef enabled, can someone check my router file please?

我遇到了一个问题,我的Joomla 3 mijoshop购物车在SEF启用后购买后没有清空,如果我关闭SEF,那么它就可以正常工作。经过一番搜索,我相信这可能是手推车路由器.php文件的问题,所以我想知道是否有人可以帮助我解决这个问题。我已将我当前的router.php文件代码粘贴到下面。

defined('_JEXEC') or die ('Restricted access');
require_once(JPATH_ROOT . '/components/com_mijoshop/mijoshop/mijoshop.php');
if (!class_exists('MiwisoftComponentRouterBase')) {
if (class_exists('JComponentRouterBase')) {
    abstract class MiwisoftComponentRouterBase extends JComponentRouterBase {}
}
else {
    class MiwisoftComponentRouterBase {}
}
}
class MijoShopRouter extends MiwisoftComponentRouterBase
{
static $cats = array();
static $path = array();
public function build(&$query) {
    return $this->buildRoute($query);
}
public function parse(&$segments) {
    return $this->parseRoute($segments);
}
public function buildRoute(&$query)
{
    $Itemid = null;
    $segments = array();
    $menu = $this->getMenu();
    $_get_itemid = 0;
    if($menu->getActive()){
        $_get_itemid = $menu->getActive()->id;
    }
    $_get_route = JRequest::getVar('route', '');
    if( isset($query['Itemid']) and $_get_itemid != $query['Itemid'] and $_get_route == 'product/category' and isset($query['route']) and $query['route'] == 'product/product' ){
        $query['Itemid'] = $_get_itemid;
    }
    if (!empty($query['Itemid'])) {
        $Itemid = $query['Itemid'];
    } else {
        $Itemid = $this->getItemid();
    }
    if (empty($Itemid)) {
        $a_menu = $menu->getActive();
    } else {
        $a_menu = $menu->getItem($Itemid);
    }
    if (isset($query['view'])) {
        if ($query['view'] == 'admin') {
            unset($query['view']);
            return $segments;
        }
        $_route = $this->getRoute($query['view'], false);
        if (!empty($_route)) {
            $query['route'] = $_route;
            unset($query['view']);
        }
        else {
            $segments[] = $query['view'];
            unset($query['view']);
        }
    }
    if (isset($query['route'])) {
        switch ($query['route']) {
            case 'product/product':
                if (is_object($a_menu) and $a_menu->query['view'] == 'product' and $a_menu->query['product_id'] == @$query['product_id']) {
                    unset($query['path']);
                    unset($query['product_id']);
                    unset($query['manufacturer_id']);
                    break;
                }
                $segments[] = 'product';
                if (isset($query['product_id'])) {
                    $id = $query['product_id'];
                    $name = MijoShop::get('db')->getRecordAlias($id);
                    if (!empty($name)) {
                        $segments[] = $id . ':' . $name;
                    } else {
                        $segments[] = $id;
                    }
                    unset($query['path']);
                    unset($query['product_id']);
                    unset($query['manufacturer_id']);
                    unset($query['sort']);
                    unset($query['order']);
                    unset($query['filter_name']);
                    unset($query['filter_tag']);
                    unset($query['limit']);
                    unset($query['page']);
                }
                break;
            case 'product/category':
                $_path = explode('_', @$query['path']);
                $m_id = end($_path);
                if (is_object($a_menu) and $a_menu->query['view'] == 'category' and $a_menu->query['path'] == $m_id) {
                    unset($query['path']);
                    break;
                }
                $segments[] = 'category';
                if (isset($query['path'])) {
                    $id = $query['path'];
                    if (strpos($id, '_')) {
                        $old_id = $id;
                        $_id = explode('_', $id);
                        $id = end($_id);
                        self::$cats[$id] = $old_id;
                    } else {
                        self::$cats[$id] = $id;
                    }
                    $name = MijoShop::get('db')->getRecordAlias($id, 'category');
                    if (!empty($name)) {
                        $segments[] = $id . ':' . $name;
                    } else {
                        $segments[] = $id;
                    }
                    unset($query['path']);
                }
                break;
            case 'product/manufacturer/info':
                if (is_object($a_menu) and $a_menu->query['view'] == 'manufacturer' and $a_menu->query['manufacturer_id'] == @$query['manufacturer_id']) {
                    unset($query['manufacturer_id']);
                    break;
                }
                $segments[] = 'manufacturer';
                if (isset($query['manufacturer_id'])) {
                    $id = $query['manufacturer_id'];
                    $name = MijoShop::get('db')->getRecordAlias($id, 'manufacturer');
                    if (!empty($name)) {
                        $segments[] = $id . ':' . $name;
                    } else {
                        $segments[] = $id;
                    }
                    unset($query['manufacturer_id']);
                }
                break;
            case 'information/information':
                if (is_object($a_menu) and $a_menu->query['view'] == 'information' and $a_menu->query['information_id'] == @$query['information_id']) {
                    unset($query['information_id']);
                    break;
                }
                $segments[] = 'information';
                if (isset($query['information_id'])) {
                    $id = $query['information_id'];
                    $name = MijoShop::get('db')->getRecordAlias($id, 'information');
                    if (!empty($name)) {
                        $segments[] = $id . ':' . $name;
                    } else {
                        $segments[] = $id;
                    }
                    unset($query['information_id']);
                }

提前感谢任何可以帮助的人:)

这个问题与您的router.php文件无关,它与结帐过程有关,因为这些购物车中的项目实际上存储在数据库中。

当您向购物车中添加商品时,它们被添加到数据库中的一个表中,一旦您结帐,您的商品通常被添加到order_item表中,订单表中填充您的订单信息,并且购物车被清空。

我会检查控制器/模型文件,看看签出代码在哪里-错误肯定在那里。