Page 2 of 16 FirstFirst 123412 ... LastLast
Results 11 to 20 of 154
  1. #11
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Cross Sell Advanced [Support Thread]

    Quote Originally Posted by Ajeh View Post
    NOTE: you really need to read through that file to find any other similar issues ...
    Well if I run the query
    Code:
    SELECT configuration_group_id FROM zen_configuration_group WHERE configuration_group_title = 'Deluxe Cross Sell' LIMIT 1;
    I get zero results. So wouldn't the delete statement be deleting nothing and NOT the 0 configuration group???
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  2. #12
    Join Date
    May 2012
    Posts
    36
    Plugin Contributions
    0

    Default Re: Cross Sell Advanced [Support Thread]

    Quote Originally Posted by DivaVocals View Post
    Well if I run the query
    Code:
    SELECT configuration_group_id FROM zen_configuration_group WHERE configuration_group_title = 'Deluxe Cross Sell' LIMIT 1;
    I get zero results. So wouldn't the delete statement be deleting nothing and NOT the 0 configuration group???
    I see that this is the same thing going on when I asked in the Testimonials manager about those inserts in the uninstall sql. And Ajeh responded that those are 3 stock configs for ZC. After research under certain circumstances it can remove the 3 stock configs. So the 3 inserts plus another for IH was there as a safety when the sql deletes the id for 0.

    After reading, there has to be a "and xxx != 0" as a fallback in case the mod id equates to 0.

  3. #13
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Cross Sell Advanced [Support Thread]

    I would suggest posting your full proposed fix, before contributing it so that it can be checked ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #14
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Cross Sell Advanced [Support Thread]

    Not the SAME thing at all.. The Testimonials Manager SQL is just plain old WRONG because it inadvertently sets a configuration group id variable to configuration group '0'. (read my response in that thread -- I DO state the issue and solution)

    The SQL in question for this module DOES NOT do this..
    Quote Originally Posted by grantopt View Post
    I see that this is the same thing going on when I asked in the Testimonials manager about those inserts in the uninstall sql. And Ajeh responded that those are 3 stock configs for ZC. After research under certain circumstances it can remove the 3 stock configs. So the 3 inserts plus another for IH was there as a safety when the sql deletes the id for 0.

    After reading, there has to be a "and xxx != 0" as a fallback in case the mod id equates to 0.
    No fall back required.. simply DO NOT set a variable for configuration group id '0'.. Just don't write SQL scripts which delete ANYTHING from configuration_group '0'
    Last edited by DivaVocals; 11 Apr 2014 at 09:22 PM.
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  5. #15
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Cross Sell Advanced [Support Thread]

    Quote Originally Posted by Ajeh View Post
    I would suggest posting your full proposed fix, before contributing it so that it can be checked ...
    Are you responding to my previous post.. because HONESTLY I am still not seeing the issue with the SQL.. If I query for a configuration group that does not exist, I can't possibly delete anything from it let alone configuration group ID '0'.. I WANT to fix it if it's broken, but I'm REALLY not understanding why it's wrong..

    **confused**
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  6. #16
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,474
    Plugin Contributions
    88

    Default Re: Cross Sell Advanced [Support Thread]

    As I tiptoe into the discussion, I'd like to propose the following changes to the code fragment that Ajeh posted in post #9. The issue, as I see it, is that if the 'old title' didn't exist, the $result object wouldn't have any fields and, with mySQL's conversion in effect the value '$xsell_old_configuration_id' would be magically converted to (you guessed it) 0.
    Code:
    /* Find configuation group ID of Previous Version of Cross Sell */
            $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
            $result = $db->Execute($sql);
            $xsell_old_configuration_id = $result->fields['configuration_group_id'];
    
            /* Remove Previous Version of Cross Sell from the configuration group table */
            $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
            $db->Execute($sql);
    
            /* Remove Previous Version of Cross Sell items from the configuration table */
            $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
            $db->Execute($sql);
    I'd suggest a small recoding of the fragment as follows:
    Code:
    /* Find configuation group ID of Previous Version of Cross Sell */
            $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
            $result = $db->Execute($sql);
            // -----
            // Only remove the old configuration if it exists!
            //
            if (!$result->EOF) {
              $xsell_old_configuration_id = $result->fields['configuration_group_id'];
    
               /* Remove Previous Version of Cross Sell from the configuration group table */
              $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
              $db->Execute($sql);
    
              /* Remove Previous Version of Cross Sell items from the configuration table */
              $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
              $db->Execute($sql);
            }

  7. #17
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Cross Sell Advanced [Support Thread]

    As a test, temporarily create the file:
    /your_secret_admin/test_delete.php

    with the code:
    Code:
    <?php
    require('includes/application_top.php');
    
    
        $xsell_old_menu_title = 'Cross Sell';
        $xsell_menu_title = 'Cross Sell Advanced';
        $xsell_menu_text = 'Cross Sell Advanced Configuration';
    
    echo 'Previous Version of Cross Sell: ' . '<br><br>';
          /* Find configuation group ID of Previous Version of Cross Sell */
          $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
    echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
          $result = $db->Execute($sql);
            $xsell_old_configuration_id = $result->fields['configuration_group_id'];
    echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';
    
          /* Remove Previous Version of Cross Sell from the configuration group table */
          $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
    //        $db->Execute($sql);
    echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
    
    
    // test results with SELECT
    echo '==================================' . '<br><br>';
          $sql = "SELECT * FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
          $chk_sql =  $db->Execute($sql);
    echo 'TEST XSELL CODE what SELECT finds in TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
    echo '<strong>RecordCount found TABLE_CONFIGURATION_GROUP: ' . $chk_sql->RecordCount() . '</strong><br>';
    
    // if found what would be deleted
    while (!$chk_sql->EOF) {
      echo 'configuration_group_id: ' . $chk_sql->fields['configuration_group_id'] . '<br><br>';
      $chk_sql->MoveNext();
    }
    
    // test results with SELECT
          /* Remove Previous Version of Cross Sell items from the configuration table */
          $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
    echo '==================================' . '<br><br>';
    echo 'TEST XSELL CODE what would be deleted TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
    echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';
    echo 'XSELL CODE what DELETE would be run on TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
    //        $db->Execute($sql);
          $sql = "SELECT * FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
          $chk_sql =  $db->Execute($sql);
    
    echo 'XSELL CODE what SELECT finds in TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
    echo '<strong>RecordCount found TABLE_CONFIGURATION: ' . $chk_sql->RecordCount() . '</strong><br><br>';
    
    echo 'What would be removed: ' . '<br>';
    // if found what would be deleted
    while (!$chk_sql->EOF) {
      echo 'configuration_key: ' . $chk_sql->fields['configuration_key'] . '<br>';
      $chk_sql->MoveNext();
    }
    echo '==================================' . '<br><br>';
    While kind of a scrappy file, it would show you the results of what gets deleted if there isn't a value for: $xsell_old_configuration_id

    and what would end up deleted from the configuration table ...

    This will not delete anything as it uses SELECTS rather than actual DELETE on the tables but does show you the content of the $sql and what keys would get wiped out ...

    Lat9's fix would add a safety on this portion of the code, and it needs to be done similarly on anything else doing DELETE in this file ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #18
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Cross Sell Advanced [Support Thread]

    Quote Originally Posted by Ajeh View Post
    As a test, temporarily create the file:
    /your_secret_admin/test_delete.php

    with the code:
    Code:
    <?php
    require('includes/application_top.php');
    
    
        $xsell_old_menu_title = 'Cross Sell';
        $xsell_menu_title = 'Cross Sell Advanced';
        $xsell_menu_text = 'Cross Sell Advanced Configuration';
    
    echo 'Previous Version of Cross Sell: ' . '<br><br>';
          /* Find configuation group ID of Previous Version of Cross Sell */
          $sql = "SELECT configuration_group_id FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_title='".$xsell_old_menu_title."' LIMIT 1";
    echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
          $result = $db->Execute($sql);
            $xsell_old_configuration_id = $result->fields['configuration_group_id'];
    echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';
    
          /* Remove Previous Version of Cross Sell from the configuration group table */
          $sql = "DELETE FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
    //        $db->Execute($sql);
    echo 'XSELL CODE what would be deleted TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
    
    
    // test results with SELECT
    echo '==================================' . '<br><br>';
          $sql = "SELECT * FROM ".TABLE_CONFIGURATION_GROUP." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
          $chk_sql =  $db->Execute($sql);
    echo 'TEST XSELL CODE what SELECT finds in TABLE_CONFIGURATION_GROUP <br>$sql: ' . $sql . '<br><br>';
    echo '<strong>RecordCount found TABLE_CONFIGURATION_GROUP: ' . $chk_sql->RecordCount() . '</strong><br>';
    
    // if found what would be deleted
    while (!$chk_sql->EOF) {
      echo 'configuration_group_id: ' . $chk_sql->fields['configuration_group_id'] . '<br><br>';
      $chk_sql->MoveNext();
    }
    
    // test results with SELECT
          /* Remove Previous Version of Cross Sell items from the configuration table */
          $sql = "DELETE FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
    echo '==================================' . '<br><br>';
    echo 'TEST XSELL CODE what would be deleted TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
    echo '$xsell_old_configuration_id set to: ' . $xsell_old_configuration_id . '<br><br>';
    echo 'XSELL CODE what DELETE would be run on TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
    //        $db->Execute($sql);
          $sql = "SELECT * FROM ".TABLE_CONFIGURATION." WHERE configuration_group_id ='".$xsell_old_configuration_id."'";
          $chk_sql =  $db->Execute($sql);
    
    echo 'XSELL CODE what SELECT finds in TABLE_CONFIGURATION <br>$sql: ' . $sql . '<br><br>';
    echo '<strong>RecordCount found TABLE_CONFIGURATION: ' . $chk_sql->RecordCount() . '</strong><br><br>';
    
    echo 'What would be removed: ' . '<br>';
    // if found what would be deleted
    while (!$chk_sql->EOF) {
      echo 'configuration_key: ' . $chk_sql->fields['configuration_key'] . '<br>';
      $chk_sql->MoveNext();
    }
    echo '==================================' . '<br><br>';
    While kind of a scrappy file, it would show you the results of what gets deleted if there isn't a value for: $xsell_old_configuration_id

    and what would end up deleted from the configuration table ...

    This will not delete anything as it uses SELECTS rather than actual DELETE on the tables but does show you the content of the $sql and what keys would get wiped out ...

    Lat9's fix would add a safety on this portion of the code, and it needs to be done similarly on anything else doing DELETE in this file ...
    At last.. thanks ladies.. It's not that I didn't believe there WAS a problem.. I just wasn't quite sure how it was an issue (thanks for the explanation lat9!! I GET IT now.. ) I will make the change and re-submit when I return from New York next week..

    GIRL POWER ROCKS!!!
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  9. #19
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Cross Sell Advanced [Support Thread]

    Again, you might post your customizations for this file before you submit it to the add-ons to ensure the fixes are complete ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #20
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,023
    Plugin Contributions
    32

    Default Re: Cross Sell Advanced [Support Thread]

    Quote Originally Posted by Ajeh View Post
    Again, you might post your customizations for this file before you submit it to the add-ons to ensure the fixes are complete ...
    yes ma'am will do!
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

 

 
Page 2 of 16 FirstFirst 123412 ... LastLast

Similar Threads

  1. Multi Cross Sell mod [Support thread]
    By gilby in forum All Other Contributions/Addons
    Replies: 475
    Last Post: 11 Apr 2020, 10:44 PM
  2. Ultimate Cross Sell [Support Thread]
    By ultimate_zc in forum All Other Contributions/Addons
    Replies: 239
    Last Post: 17 May 2015, 03:25 AM
  3. Replies: 1
    Last Post: 18 Sep 2013, 11:24 PM
  4. Just another Cross-Sell mod (support thread)
    By yellow1912 in forum All Other Contributions/Addons
    Replies: 702
    Last Post: 3 Nov 2012, 04:30 AM
  5. Cross Sell and Advanced Cross Sell Modules
    By fairway in forum Addon Templates
    Replies: 4
    Last Post: 8 Dec 2009, 08:44 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