Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2007
    Posts
    195
    Plugin Contributions
    3

    Default PHP Warning Use of undefined constant

    Using Cart Reminder and UK Post Code Shipping 1.5.6c PHP 7.3
    Can anyone help with these log errors, or explain how to fix issue please, thanks

    09-Oct-2019 13:59:16 UTC] Request URI: /index.php?main_page=checkout_shipping&ec_cancel=1&token=EC-37V002103B389921W, #1 ukpost->ukpost() called at [/var/www/vhosts/domain/httpdocs/includes/classes/shipping.php:63]
    #2 shipping->__construct() called at [/var/www/vhosts/domain/httpdocs/includes/modules/pages/checkout_shipping/header_php.php:102]
    #3 require(/var/www/vhosts/domain/httpdocs/includes/modules/pages/checkout_shipping/header_php.php) called at [/var/www/vhosts/domain/httpdocs/index.php:36]
    --> PHP Warning: Use of undefined constant MODULE_SHIPPING_ZONES_SORT_ORDER - assumed 'MODULE_SHIPPING_ZONES_SORT_ORDER' (this will throw an Error in a future version of PHP) in /var/www/vhosts/domain /httpdocs/includes/modules/shipping/ukpost.php on line 95.


    [09-Oct-2019 13:58:07 UTC] Request URI: /index.php?main_page=login&action=process,
    #1 observerAbandonedCartReminder->runAddCartReminder() called at [/var/www/vhosts/domain/httpdocs/includes/classes/observers/class.abandoned_cart_reminder.php:19]
    #2 observerAbandonedCartReminder->update() called at [/var/www/vhosts/domain/httpdocs/includes/classes/class.base.php:103]
    #3 base->notify() called at [/var/www/vhosts/domain/httpdocs/includes/modules/pages/login/header_php.php:116]
    #4 require(/var/www/vhosts/domain/httpdocs/includes/modules/pages/login/header_php.php) called at [/var/www/vhosts/domain/httpdocs/index.php:36]
    --> PHP Warning: Use of undefined constant CART_REMINDER - assumed 'CART_REMINDER' (this will throw an Error in a future version of PHP) in /var/www/vhosts/domain/httpdocs/includes/classes/observers/class.abandoned_cart_reminder.php on line 30.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,583
    Plugin Contributions
    260

    Default Re: PHP Warning Use of undefined constant

    These errors are both coming from mods, not core files. See if each of these mods has a support thread you can post to. (Looks like they're called "UK Post" and "Abandoned Cart" respectively.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  3. #3
    Join Date
    Jul 2007
    Posts
    195
    Plugin Contributions
    3

    Default Re: PHP Warning Use of undefined constant

    Quote Originally Posted by swguy View Post
    These errors are both coming from mods, not core files. See if each of these mods has a support thread you can post to. (Looks like they're called "UK Post" and "Abandoned Cart" respectively.
    Thanks for the reply yes they are mods. One I updated to fix an error in PHP7, but now using PHP 7.3 so different error showing. I was wondering if someone could give me a clue how to fix the issue. The UK shipping is a relatively simply mod but effective for UK based sites. So any pointers would be appreciated, thanks for taking an interest,

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,583
    Plugin Contributions
    260

    Default Re: PHP Warning Use of undefined constant

    My guess would be UK shipping hasn't been refactored the way the native shipping methods have. Look at includes/modules/shipping/freeshipper.php in 1.5.6c vs. 1.5.5f. See how in 1.5.6c in the constructor, it exits if sort_order is not set? Do the same thing.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  5. #5
    Join Date
    Jul 2007
    Posts
    195
    Plugin Contributions
    3

    Default Re: PHP Warning Use of undefined constant

    Quote Originally Posted by swguy View Post
    My guess would be UK shipping hasn't been refactored the way the native shipping methods have. Look at includes/modules/shipping/freeshipper.php in 1.5.6c vs. 1.5.5f. See how in 1.5.6c in the constructor, it exits if sort_order is not set? Do the same thing.
    thank you for the guidance. Still having an issue I guess I will need to look for support on the plugin support page.
    This is what I had
    PHP Code:
     class ukpost {    var $code$title$description$enabled$num_zones;
        function 
    ukpost() {      $this->code 'ukpost';      $this->title MODULE_SHIPPING_UKPOST_TEXT_TITLE;      $this->description MODULE_SHIPPING_UKPOST_TEXT_DESCRIPTION;      $this->sort_order defined('MODULE_SHIPPING_UKPOST_SORT_ORDER') ? MODULE_SHIPPING_ZONES_SORT_ORDER null;      $this->icon '';      $this->tax_class MODULE_SHIPPING_UKPOST_TAX_CLASS;      $this->tax_basis MODULE_SHIPPING_UKPOST_TAX_BASIS;
          if (
    zen_get_shipping_enabled($this->code)) {        $this->enabled = ((MODULE_SHIPPING_UKPOST_STATUS == 'True') ? true false);      } 
    Replaced with this
    PHP Code:
     class ukpost {    var $code$title$description$enabled$icon$num_zones;
    // class constructor  
      
    function __construct() {      global $order$db;
             
    $this->code 'ukpost';      $this->title MODULE_SHIPPING_UKPOST_TEXT_TITLE;      $this->description MODULE_SHIPPING_UKPOST_TEXT_DESCRIPTION;      $this->sort_order defined('MODULE_SHIPPING_UKPOST_SORT_ORDER') ? MODULE_SHIPPING_ZONES_SORT_ORDER null;      if (null === $this->sort_order) return false;      $this->icon '';      $this->tax_class MODULE_SHIPPING_UKPOST_TAX_CLASS;      $this->tax_basis MODULE_SHIPPING_UKPOST_TAX_BASIS;
          if (
    zen_get_shipping_enabled($this->code)) {        $this->enabled = ((MODULE_SHIPPING_UKPOST_STATUS == 'True') ? true false);      } 
    But still produced error in logs. In admin shipping when you activate the shipping module the icon stays red. Yet it all seems to work apart from the PHP errors in log.
    Appreciate the help, thanks.

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    6,583
    Plugin Contributions
    260

    Default Re: PHP Warning Use of undefined constant

    The reference to MODULE_SHIPPING_ZONES_SORT_ORDER should have been MODULE_SHIPPING_UKPOST_SORT_ORDER.
    I just submitted a fix.
    That Software Guy, Plugin Moderator. Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Contributions: Quantity Discounts, Better Together, SMS on Sale, Gift Wrap at Checkout, and more.

  7. #7
    Join Date
    Jul 2007
    Posts
    195
    Plugin Contributions
    3

    Default Re: PHP Warning Use of undefined constant

    Quote Originally Posted by swguy View Post
    The reference to MODULE_SHIPPING_ZONES_SORT_ORDER should have been MODULE_SHIPPING_UKPOST_SORT_ORDER.
    I just submitted a fix.
    Thanks so much didn't spot that it fixed the issues, many thanks much appreciated.

 

 

Similar Threads

  1. Replies: 12
    Last Post: 8 Mar 2019, 01:01 PM
  2. Replies: 2
    Last Post: 27 Feb 2019, 12:24 PM
  3. v155 adding constants - PHP Notice: Use of undefined constant
    By torvista in forum Contribution-Writing Guidelines
    Replies: 0
    Last Post: 4 May 2016, 07:07 AM
  4. Undefined Notice: Use of undefined constant
    By TheOracle in forum Bug Reports
    Replies: 0
    Last Post: 6 May 2007, 06:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR