Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

If In Each Page Rate Topic   - - - - -

 

Posted 30 September 2019 - 08:37 AM #1

in my add-on file:

controlers/frontend/init.post.php

if (Registry::get('runtime.controller') == 'index' && Registry::get('runtime.mode') == 'index') {

//my code

}
But this Conditional code, only works in Index Page. I want it to work in All pages Not only in the Main page.
Thanks.


 
  • sw1
  • Newbie
  • Trial users
  • Join Date: 16-Jun 16
  • 8 posts

Posted 30 September 2019 - 10:25 AM #2

Hello,

Check this code

    if (Registry::get('runtime.controller') && Registry::get('runtime.mode')) {
     
    //my code
     
    }


 

Posted 30 September 2019 - 11:14 AM #3

 

Hello,

Check this code

    if (Registry::get('runtime.controller') && Registry::get('runtime.mode')) {
     
    //my code
     
    }

hi my friend. not worked!

2019_09_30_14_43_07_.png



 

Posted 30 September 2019 - 11:30 AM #4

 

Hello,

Check this code

    if (Registry::get('runtime.controller') && Registry::get('runtime.mode')) {
     
    //my code
     
    }

i want if empty $geo['country_code'] redirect to an another page, i want to apply this condition for all pages.



 

Posted 30 September 2019 - 11:32 AM #5

i want if empty $geo['country_code'] redirect to an another page, i want to apply this condition for all pages.

i use this code but not work:

if (Registry::get('runtime.controller') !== 'unavailable_country ' && Registry::get('runtime.mode') !== 'unavailable_country ') {
    
    if(empty($geo_select)) {

        return array(CONTROLLER_STATUS_REDIRECT,'unavailable_country.select_country');

    }
    
}


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19794 posts

Posted 30 September 2019 - 01:28 PM #6

Do you receive error page or continuous redirect?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • soft-solid
  • Junior Member
  • Members
  • Join Date: 19-Apr 10
  • 903 posts

Posted 30 September 2019 - 03:29 PM #7

 

i use this code but not work:

if (Registry::get('runtime.controller') !== 'unavailable_country ' && Registry::get('runtime.mode') !== 'unavailable_country ') {
    
    if(empty($geo_select)) {

        return array(CONTROLLER_STATUS_REDIRECT,'unavailable_country.select_country');

    }
    
}

 

Hello

 

You have useless 1 space after unavailable_country

 

Best regards

Robert


Team of SoftSolid
cs-cart.pl