Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1

    Default also purchased query question

    Hello, I have a question on how the also purchased gets it's results. Does it just grab the first four products that where bought with the particular product it?

    If so, how would I change it to grab the most popular items that were also purchased with the particular item. Is that possible?

    Thanks

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

    Default Re: also purchased query question

    There isn't an override for this but you could customize the define for:
    PHP Code:
    DEFINE('SQL_ALSO_PURCHASED'"select p.products_id, p.products_image
                         from " 
    TABLE_ORDERS_PRODUCTS " opa, " TABLE_ORDERS_PRODUCTS " opb, "
                                
    TABLE_ORDERS " o, " TABLE_PRODUCTS " p
                         where opa.products_id = '%s'
                         and opa.orders_id = opb.orders_id
                         and opb.products_id != '%s'
                         and opb.products_id = p.products_id
                         and opb.orders_id = o.orders_id
                         and p.products_status = 1
                         group by p.products_id
                         order by o.date_purchased desc
                         limit " 
    MAX_DISPLAY_ALSO_PURCHASED); 
    This is located in the:
    /includes/classes/db/mysql/define_queries.php

    You would need to reconstruct how that query is done and your criteria that you want to use ...
    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!]
    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!

  3. #3

    Default Re: also purchased query question

    Yeah I saw that, I was hoping someone knew the sql to enter.

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

    Default Re: also purchased query question

    It grabs however many you set in the Maximum settings based on the date:
    PHP Code:
                         order by o.date_purchased desc
                         limit 
    " . MAX_DISPLAY_ALSO_PURCHASED); 
    You could try to work in the field products_ordered and see if that gives you a better selection than by date ...

    NOTE: advantage of date is that when products come and go you are looking at more recent products based on recent orders ...
    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!]
    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!

  5. #5
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    347
    Plugin Contributions
    0

    Default Re: also purchased query question

    I have a question in regards to the display images in the also purchased box.

    I have it set so they display horizontally, 4 per row. But they are coming up vertically in a sigle column.

    I set it in Configuration > Product Info > Also Purchased Products Columns per Row > 4.

    Is there somewhere else that I need to set it?

  6. #6
    Join Date
    Nov 2005
    Posts
    44
    Plugin Contributions
    0

    Default Re: also purchased query question

    is there a way to reset "Also Purchased" to 0.

    By making some test orders I have some strange combinations...

  7. #7

    Default Re: also purchased query question

    I'm assuming you have done the test orders before you have made the site live.

    I just go into Tools - Store Managerand click on Reset ALL Products Ordered to fix problems like that before making the site live.

    On a new site, I also disable "Also Purchased Products" until I get enough orders in for it to be useful. Disabled by Configuration - Product Info & set "Also Purchased Products Columns per Row" = 0

  8. #8
    Join Date
    Feb 2007
    Location
    Leicester UK
    Posts
    219
    Plugin Contributions
    0

    Default Re: also purchased query question

    Quote Originally Posted by erwin208 View Post
    is there a way to reset "Also Purchased" to 0.

    By making some test orders I have some strange combinations...
    Delete your test orders and they won't affect the module any longer.

  9. #9
    Join Date
    Mar 2005
    Location
    Tempe, AZ
    Posts
    324
    Plugin Contributions
    0

    Default Re: also purchased query question

    I have a question for some reason my Also Purchased Products are not showing under the tab any ideas why see example here.

    http://www.lextechs.com/index.php?ma...ducts_id=14017


    Thanks in advance
    Lextechs.com Powered By ZenCart

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

    Default Re: also purchased query question

    What value do you have on the Configuration ... Maximum Values ...
    Also Purchased Products
    Number of products to display in the 'This Customer Also Purchased' box
    In your tpl_products_info_display.php file do you have:
    PHP Code:
    <!--bof also purchased products module-->
    <?php require($template->get_template_dir('tpl_modules_also_purchased_products.php'DIR_WS_TEMPLATE$current_page_base,'templates'). '/' 'tpl_modules_also_purchased_products.php');?>
    <!--eof also purchased products module-->
    Also check in the Configuration ... Product Info ...
    Also Purchased Products Columns per Row
    Also Purchased Products Columns per Row
    0= off or set the sort order
    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!]
    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!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 13
    Last Post: 23 Mar 2010, 02:29 PM
  2. Customers who purchased this, also purchased this, CSS issue
    By stlnyc in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 25 Jul 2009, 11:12 PM
  3. Also Purchased
    By jayson.gurney in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 17 Apr 2007, 05:28 PM
  4. Replies: 2
    Last Post: 14 Sep 2006, 08:08 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