Page 2 of 2 FirstFirst 12
Results 11 to 20 of 38

Hybrid View

  1. #1
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,845
    Plugin Contributions
    25

    Default Re: Compare multiple products support thread

    Quote Originally Posted by honda-crunch View Post
    Hi
    Just wondered if anyone has seen the following and if there is a fix for it:

    I just recently installed v1.02. Everything except a previous noted error regarding advance search worked ok. I managed to fix the advance search myself. However, looking through the cahe log I noticed the following:

    PHP Warning: Invalid argument supplied for foreach() in /var/www/vhosts/*****************/httpdocs/catalog/ajax_compare.php on line 29

    Has anybody else noticed this?

    I found a website that gave an indication that the coding may be wrong on line 29. As I'm not a programmer, I am at a loss.

    Below is an extract from the web site I found:

    (Invalid argument supplied for foreach() can happen if you try to do a foreach on an variable that isn't an array. Maybe it is "supposed to" be an array, maybe you thought it was an array, but sorry -- it isn't.)
    I have the same problem.

  2. #2
    Join Date
    Mar 2011
    Posts
    364
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    Quote Originally Posted by rbarbour View Post
    Copy the following define statements from index.php to advanced_search_result.php
    Code:
    // values for compare system
      define('COMPARE_DEFAULT', 'Compare');
      define('COMPARE_REMOVE', 'remove');
      define('COMPARE_COUNT_START', 'up to ');
      define('COMPARE_COUNT_END', ' items');
    copy the following code from tpl_index_product_list.php to tpl_advanced_search_result_default.php

    Code:
    <div id="compareResult">
      <div class="back compareText"><b><?php echo COMPARE_DEFAULT; ?></b><br /><?php echo COMPARE_COUNT_START . COMPARE_VALUE_COUNT . COMPARE_COUNT_END; ?></div>
      <div id="compareProducts">
    <?php
    if (!empty($_SESSION['compare'])) {
      foreach ($_SESSION['compare'] as $value) {
        $product_comp_image = $db->Execute(
            "SELECT p.products_id, p.master_categories_id, pd.products_name, p.products_image
             FROM " . TABLE_PRODUCTS . " p
             LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd
             ON pd.products_id=p.products_id
             WHERE p.products_id='".$value."'");
             
        $comp_images .= '<div class="compareAdded"><br /><a href="' . zen_href_link(zen_get_info_page($product_comp_image->fields['products_id']), 'cPath=' . (zen_get_generated_category_path_rev($product_comp_image->fields['master_categories_id'])) . '&products_id=' . $product_comp_image->fields['products_id']) . '">' . $product_comp_image->fields['products_name'] . '</a><div>'.'<a onclick="javascript: compareNew('.$product_comp_image->fields['products_id'].', \'remove\')" alt="remove">'.COMPARE_REMOVE.'</a>'.'</div></div>';
      }
      echo '<div id="compareMainWrapper"><div class="compareAdded compareButton">'.'<a href="index.php?main_page=compare" alt="compare">'.'<span class="cssButton">'.COMPARE_DEFAULT.'</span></a></div>'.$comp_images.'</div>';
      echo '<br class="clearBoth" />';
    }
    ?>
    </div>
    </div>
    Now you will be able to add & compare products from the search result page.

    Hope this helps!
    Hey! Sorry I missed your reply. Yes the first part work which makes sense. I did the code copy to the advanced tpl file but it does not work.

  3. #3
    Join Date
    Mar 2011
    Posts
    364
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    My apologies. It does work. I just did not scroll down to the bottom where it appeared. It is dependent on where you put the code!

    I put mine after

    <h1 id="advSearchResultsDefaultHeading"><?php echo HEADING_TITLE; ?></h1>

    Thanks again.

  4. #4
    Join Date
    May 2006
    Posts
    102
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    Hello nice work.
    Tell me its possible to join your module with-> Stock Level Indicator in Product Listing http://www.zen-cart.com/index.php?ma...roducts_id=633

    soo the traffic lights appear instead of quantity??
    Tanks

  5. #5
    Join Date
    Feb 2012
    Posts
    3
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    I have a fix for this issue but I'm unsure if it leaves open a security hole.

    You only have to comment out one line within 'includes/init_includes/init_sanitize.php' at about line 34:

    zen_redirect ( zen_href_link ( FILENAME_PAGE_NOT_FOUND, '', $request_type ) );

  6. #6
    Join Date
    Jul 2009
    Posts
    127
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    Not sure how to fix it but I'm nearly positive it has something to do with jQuery no conflict.

  7. #7
    Join Date
    Jul 2009
    Posts
    127
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    Quote Originally Posted by novastar View Post
    Not sure how to fix it but I'm nearly positive it has something to do with jQuery no conflict.
    This is the javascript error I get when I click on one of the checkboxes.

    Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function

    I tried to resolve with the many different no conflict solutions but none of them worked.

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

    Default Re: Compare multiple products - support thread

    Hi has anyone used this on 1.38a
    Thanks
    RR

  9. #9
    Join Date
    Oct 2011
    Posts
    67
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    I uploaded this plug-in...ah where is located in admin...can't seem to find it...under which heading...thanks!

  10. #10
    Join Date
    Jun 2012
    Posts
    4
    Plugin Contributions
    0

    Default Re: Compare multiple products - support thread

    Has anyone updated this plugin for version 1.5? I tried to install it but the check boxes won't show up next to the products in the product listing.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 Multiple Ship-To Addresses [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 84
    Last Post: 14 Dec 2022, 07:02 PM
  2. Multiple Zone Rates Support Thread
    By totalsam in forum Addon Shipping Modules
    Replies: 54
    Last Post: 24 Feb 2015, 03:34 PM
  3. v150 Compare multiple products now working properly
    By nnagarajan in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 30 Jun 2012, 03:04 AM
  4. Compare Multiple Products/Stock Level Indicator
    By dinix in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Feb 2012, 02:42 AM
  5. Products Disclaimer Support Thread
    By clydejones in forum All Other Contributions/Addons
    Replies: 12
    Last Post: 2 Jun 2010, 11:29 PM

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