Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default DC 1054 error, and error in 'Product Restrictions' section

    I have created a discount coupon for new customers, and it is being mailed out with the welcome email correctly. On attempting to redeem the DC it generates a 1054 error. I have set restrictions to 'Allow' on 'Top' category, which means all categories. I am unable to set the same restrictions for products due to the following error:

    Catchable fatal error: Object of class queryFactoryResult could not be converted to string in /home/nilajah/public_html/sweetAfrikA999/includes/functions/html_output.php on line 334
    When I try to offer new signups a GV for the same amount, it generates something like "Gift Certificate code is invalid" in a red box on top. The GV does show up under 'Sent' listing, but not in 'Queue'. I had my daughter test it, and in the admin section her GV shows a status of 'Redeemed' even though she has neither checked out, nor had the appropriate adjustment made in her subtotal.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    Thanks for the reply, Dr. Byte. The debug logs did not show anything for this error, although the enable_error_logging.php file already exists in the extra_configures directory. Since the error specifically referenced a file name and a line number I thought I would go straight there first. Here is what I found:

    Code:
        if ($type=='button'){
    // link button
       $css_button = '<span class="' . $mouse_out_class . '" ' . $css_button_js . $style . ' >&nbsp;' . $text . '&nbsp;</span>'; // add $parameters ???
        }
        return $css_button;
      }
    The referenced line 334 of html_output.php is the last line of code, with a single closing curly bracket. Does this appear to be a problem? It is followed by 2 blank lines, and then the next bit of code continues. Perhaps I should reduce the 2 blank lines to 1, could that be it?

  4. #4
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    Perhaps I should quote the whole section of code, from line 298 to 334

    Code:
    /**
     * generate CSS buttons in the current language
     * concept from contributions by Seb Rouleau and paulm, subsequently adapted to Zen Cart
     * note: any hard-coded buttons will not be able to use this function
    **/
      function zenCssButton($image = '', $text, $type, $sec_class = '', $parameters = '') {
    
        // automatic width setting depending on the number of characters
        $min_width = 80; // this is the minimum button width, change the value as you like
        $character_width = 6.5; // change this value depending on font size!
        // end settings
        // added html_entity_decode function to prevent html special chars to be counted as multiple characters (like &amp;)
        $width = strlen(html_entity_decode($text)) * $character_width;
        $width = (int)$width;
        if ($width < $min_width) $width = $min_width;
        $style = ' style="width: ' . $width . 'px;"';
        // if no secondary class is set use the image name for the sec_class
        if (empty($sec_class)) $sec_class = basename($image, '.gif');
        if(!empty($sec_class))$sec_class = ' ' . $sec_class;
        if(!empty($parameters))$parameters = ' ' . $parameters;
        $mouse_out_class  = 'cssButton' . $sec_class;
        $mouse_over_class = 'cssButtonHover' . $sec_class . $sec_class . 'Hover';
        // javascript to set different classes on mouseover and mouseout: enables hover effect on the buttons
        // (pure css hovers on non link elements do work work in every browser)
        $css_button_js .=  'onmouseover="this.className=\''. $mouse_over_class . '\'" onmouseout="this.className=\'' . $mouse_out_class . '\'"';
    
        if ($type == 'submit'){
    // form input button
       $css_button = '<input class="' . $mouse_out_class . '" ' . $css_button_js . ' type="submit" value="' .$text . '"' . $parameters . $style . ' />';
        }
    
        if ($type=='button'){
    // link button
       $css_button = '<span class="' . $mouse_out_class . '" ' . $css_button_js . $style . ' >&nbsp;' . $text . '&nbsp;</span>'; // add $parameters ???
        }
        return $css_button;
      }

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    My point was that you need to identify all the ways in which your code is different from original Zen Cart code, and then resolve the differences that are breaking your site from working the way an unaltered copy of the software normally works.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    OK, thanks Dr. Byte, I will do that then.

  7. #7
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    OK, bring out the dunce cap! I forgot that the admin folder had been renamed, so the upgrade to 1.3.9h left the old admin folder of 1.3.7 untouched - I'm surprised it kept working just fine! Anyway, I decided to run WinMerge on it, and over wrote 294 old files. Now I am left with 25 files in the old folder that do not exist in the proper 1.3.9 admin folder. Some of these I can see are from add-ons, which I would rather re-install than attempt to merge. I hadn't kept a log of code changes I had made, and I didn't want to bother examining 294 files individually to see which ones to edit again.

    I am now installing the latest versions of the add-ons to the local folder. When it's all done, I'll upload the folder and see how things work out. Thanks again, Dr. Byte, for the right idea.

  8. #8
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    OK, all admin directory files updated to default 1.3.9 versions. Now, the GV/DC page does not load at all, with error

    1054 Unknown column 'coupon_zone_restriction' in 'field list'
    in:
    [select coupon_id, coupon_code, coupon_amount, coupon_type, coupon_start_date,coupon_expire_date,uses_per_user,uses_per_coupon,restrict_to_p roducts, restrict_to_categories, date_created,date_modified, coupon_active, coupon_zone_restriction from zen_coupons where coupon_type != 'G' limit 0, 20]
    If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
    Does that look like an SQL error?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    The error is from MySQL telling you that the requested field (from the SQL query built by your PHP files) doesn't exist in the database.
    What's interesting is that the coupons table has had a coupon_zone_restriction table since at least v1.3.8, so either you've attempted an upgrade from a very old version and the upgrade failed, or your database is significantly damaged.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default Re: DC 1054 error, and error in 'Product Restrictions' section

    The upgrade was from 1.3.7, which ran for a long time, and it was executed by Cpanel/Fantastico built in script. I have looked at the discount_coupon and gv_* files in WinMerge and they are identical to the default version. Here is the patch history reported by the admin section:

    v1.3.9h [2012-02-24 18:09:51] (Version Update 1.3.8->1.3.9h)
    v1.3.9g [2012-02-24 18:09:51] (Version Update 1.3.8->1.3.9g)
    v1.3.9d [2012-02-24 18:09:51] (Version Update 1.3.8b->1.3.9d)
    v1.3.9b [2012-02-24 18:09:51] (Version Update 1.3.8->1.3.9b)
    v1.3.8 [2012-02-24 18:09:51] (Version Update 1.3.7->1.3.8)
    v1.3.7 [2007-01-17 04:13:46] (Version Update 1.3.6->1.3.7)
    v1.3.5 [2007-01-16 23:52:33] (Version Update 1.3.0.2->1.3.5)
    v1.3.0.2 [2007-01-16 23:52:31] (Version Update 1.3.0.1->1.3.0.2)
    v1.3.0.1 [2007-01-16 23:52:31] (Version Update 1.3.0->1.3.0.1)
    v1.3.0 [2006-06-19 19:42:31] (Fresh Installation)

    I am an SQL ignoramus but I don't mind using either Zen or myAdmin from Cpanel to insert the missing table, if someone would be kind enough to write me the proper command.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v139h Trouble with error 1054 from numinix fast and easy checkout
    By tmacarle in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 26 Jan 2014, 08:16 AM
  2. Coupon error with restrictions set
    By LissaE in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 12
    Last Post: 29 Jul 2011, 06:59 PM
  3. 1054 Error when I try to add new product
    By Shinmai in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 8 Jul 2010, 02:33 AM
  4. Catchable fatal error in Product Restrictions?
    By gabstero in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 25 Jun 2008, 07:31 AM
  5. Error 1054
    By micatex in forum General Questions
    Replies: 3
    Last Post: 9 May 2008, 07:30 AM

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