Jump to content

Select different blockcart.tpl and blockcart.css if it is used Mobile Theme (Blockcart module)


Recommended Posts

Hello Everyone,

 

I am trying to modify blockcart.php showing a mobile/blockcart.tpl instead of the normal blockcart.tpl in case it is accessed through Mobile.

 

I have already modified the FrontController.php in order to show 'HOOK_HEADER' and 'HOOK_TOP' also when it is displayed the Mobile Theme, so I need to differentiate between the different visualization depending if the mobile theme is active.

 

But when I tried to use some function to identify if the mobile Theme is active (for example module object doesn't have $this->useMobileTheme() funtion), it doesn't work.

 

 

public function hookRightColumn($params)
    {
        if (Configuration::get('PS_CATALOG_MODE'))
            return;

        // @todo this variable seems not used
        $this->smarty->assign(array(
            'order_page' => (strpos($_SERVER['PHP_SELF'], 'order') !== false),
            'blockcart_top' => (isset($params['blockcart_top']) && $params['blockcart_top']) ? true : false,
        ));
        $this->assignContentVars($params);

 

        if($this->useMobileTheme()){

              return $this->display(__FILE__, 'mobile/blockcart.tpl');

        }else{

               return $this->display(__FILE__, 'blockcart.tpl');

        }
      
    }

 

 

Does someone know how can I identify in blockcart module if the mobile Theme is active? or Can someone give me another alternative to show the blockcart in my Mobile Theme with a different visualization than in the desktop version?

 

Thanks for your support!

 

Best regards,

 

Antonio Carceller

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...