Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2006
    Posts
    39
    Plugin Contributions
    1

    Default Customers who bought this product also purchased... doesn't show any products

    ZC version 1.5.7
    I encountered a problem with the section Customers who bought this product also purchased... It does not get filled automatically on product pages and stays blank. The problem seems to arise from a change in the file includes\modules\also_purchased_products.php in the new 1.5.7 version of ZC. The solution was to change line 15 of also_purchased_products.php from:
    Code:
    $also_purchased_products = $db->ExecuteRandomMulti(sprintf(SQL_ALSO_PURCHASED, (int)$_GET['products_id'], (int)$_GET['products_id'], (int)MAX_DISPLAY_ALSO_PURCHASED));
    To:
    Code:
    $also_purchased_products = $db->ExecuteRandomMulti(sprintf(SQL_ALSO_PURCHASED, (int)$_GET['products_id'], (int)$_GET['products_id'], (int)MAX_DISPLAY_ALSO_PURCHASED), MAX_DISPLAY_ALSO_PURCHASED);
    The sprintf function takes one additional argument in the last ZC version, namely MAX_DISPLAY_ALSO_PURCHASED but the $db->ExecuteRandomMulti method still requires the value of MAX_DISPLAY_ALSO_PURCHASED otherwise it defaults to zero and nothing gets displayed in the section.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,046
    Plugin Contributions
    10

    Default Re: Customers who bought this product also purchased... doesn't show any products

    Don't know if the method changed in 1.5.7 but, you may want to check https://docs.zen-cart.com/user/admin...chased-display to make sure your settings match.

  3. #3
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,607
    Plugin Contributions
    11

    Default Re: Customers who bought this product also purchased... doesn't show any products

    Quote Originally Posted by vasilt View Post
    ZC version 1.5.7
    I encountered a problem with the section Customers who bought this product also purchased... It does not get filled automatically on product pages and stays blank. The problem seems to arise from a change in the file includes\modules\also_purchased_products.php in the new 1.5.7 version of ZC. The solution was to change line 15 of also_purchased_products.php from:
    Code:
    $also_purchased_products = $db->ExecuteRandomMulti(sprintf(SQL_ALSO_PURCHASED, (int)$_GET['products_id'], (int)$_GET['products_id'], (int)MAX_DISPLAY_ALSO_PURCHASED));
    To:
    Code:
    $also_purchased_products = $db->ExecuteRandomMulti(sprintf(SQL_ALSO_PURCHASED, (int)$_GET['products_id'], (int)$_GET['products_id'], (int)MAX_DISPLAY_ALSO_PURCHASED), MAX_DISPLAY_ALSO_PURCHASED);
    The sprintf function takes one additional argument in the last ZC version, namely MAX_DISPLAY_ALSO_PURCHASED but the $db->ExecuteRandomMulti method still requires the value of MAX_DISPLAY_ALSO_PURCHASED otherwise it defaults to zero and nothing gets displayed in the section.
    definite bug! thanks!
    author of square Webpay. called the savior by the chief bottle washer...
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    available for hire.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,461
    Plugin Contributions
    121

    Default Re: Customers who bought this product also purchased... doesn't show any products

    +1. Thanks for reporting, @vasilt.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,461
    Plugin Contributions
    121

    Default Re: Customers who bought this product also purchased... doesn't show any products

    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Oct 2009
    Posts
    297
    Plugin Contributions
    0

    Default Re: Customers who bought this product also purchased... doesn't show any products

    Hi,

    I have just upgraded to v.1.5.7 from v.1.5.5 and I had the Also Purchased not showing any products. I did make this code change to also_purchased_products.php, but it only showed 1 product (had correct values in Admin->Config with min. set to 1 and max. set to 15) and is now throwing errors in Debug.

    The last 2 lines of the Debug, which I am assuming are detailing the error is:

    --> PHP Warning: array_replace(): Argument #2 is not an array in /home/#####/public_html/shop/includes/classes/db/mysql/query_factory.php on line 625

    Were there other modified files??

    Thanks in advance for your help,
    Jeff

  7. #7
    Join Date
    Oct 2009
    Posts
    297
    Plugin Contributions
    0

    Default Re: Customers who bought this product also purchased... doesn't show any products

    Just a quick update to my problem.......I had contacted the creator of the template I have purchased at the same time as posting here in the Forum. They have provided me with an updated also_purchased_products.php file that has now resolved my issue and it is now displaying properly.

    Thanks,
    Jeff

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,461
    Plugin Contributions
    121

    Default Re: Customers who bought this product also purchased... doesn't show any products

    Thanks for confirming that your issue is fixed!
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. Customers who bought this product also purchased...
    By 1speedbump in forum General Questions
    Replies: 4
    Last Post: 23 Jan 2014, 06:03 PM
  2. Customers who bought this product also purchased...
    By explorer1979 in forum Templates, Stylesheets, Page Layout
    Replies: 33
    Last Post: 8 Nov 2011, 10:00 PM
  3. Customers who bought this product also purchased...
    By redsky in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 14 May 2009, 07:53 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