Zen Cart Version Checking in your Plugin

Determining which version of Zen Cart you are running

The function zen_get_zcversion was created for this purpose.

For example, to determine if you’re running Zen Cart 1.5.8 or higher, use

if (function_exists('zen_get_zcversion') && zen_get_zcversion() >= '1.5.8') { 

If you need to check for lower versions, use the defines from includes/version.php.

For example, if your code only runs on Zen Cart 1.5.6, use something like

if (PROJECT_VERSION_MAJOR != '1' && substr(PROJECT_VERSION_MINOR, 0, 3) == '5.6') { 
  // you are running 1.5.6-1.5.6c  
}



Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified November 22, 2022 by Scott C Wilson (39e51ad3).