Access The Cs-Cart Environment (Sessions Etc.)

Hi!

I'm new to CS-Cart, please understand and be patient with my questions. Thank you: :-)

If I have my own PHP page in the CS-Cart directory, how can I access the CS-Cart environment (variables, sessions, functions, etc.)? Which includes etc. are necessary?

I am happy about every answer!

Best regards

hummer

Please use

define('AREA', 'C');
require(dirname(__FILE__) . '/init.php');

You made my day, eComLabs! Thanks so much for your support.

I know I'm opening a lot of topics right now. But you can be sure that I'll only do that after I haven't found an answer in the doc or forum.

I still have one question in this regard: how to get the settings made in local_conf.php (or config.local.php), e.g.:

$config['https_host']

Is there a way to access these configuration parameters?

Looking forword to your answer.

Best regards

hummer

You made my day, eComLabs! Thanks so much for your support.

I know I'm opening a lot of topics right now. But you can be sure that I'll only do that after I haven't found an answer in the doc or forum.

I still have one question in this regard: how to get the settings made in local_conf.php (or config.local.php), e.g.:

$config['https_host']

Is there a way to access these configuration parameters?

Looking forword to your answer.

Best regards

hummer

Sure, use

Registry::get('config.https_host');

Thank you very much, eComLabs! Works like a charm. :grin:

You are welcome! :)

Hello!

I have a further question regarding this topic (using the CS-Cart environment):

How to enable jQuery on my self-scripted PHP page? Which include is necessary?

I would like to avoid having to integrate jQuery myself. Instead, there is certainly already a default include by CS Cart, isn't it?

Looking forward to your answer!

Best regards

hummer

If you display any smarty template, use the following code there

{include file="common/scripts.tpl"}

It will include all CS-Cart js

Sorry I wasn't specific enough. It is a separate PHP page without any smarty usage.

I want to avoid stating these lines of code within my "own" PHP page:

 

How to include jQuery on a smarter way?

For example, you can use

echo '';

CS-Cart does not have specific functions for this