Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2014
    Location
    ohio
    Posts
    216
    Plugin Contributions
    0

    Default Is there a way to show products sold in it's own category?

    I've noticed that once an item sells it is no longer available to view by either the customer or me.
    I would like to view the listing, as I usually have multiple pictures.
    So is there an easy way to create a "Sold" category that any part sold gets moved to?
    I do not want to clutter up my store with a bunch of sold items among items for sale.

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

    Default Re: Is there a way to show products sold in it's own category?

    In the settings for Configuration ... Stock ...

    Set to 1 for ON
    Products status in Catalog when out of stock should be set to
    Show Products when out of stock

    0= set product status to OFF
    1= leave product status ON
    Set to 1 for ON
    Show Sold Out Image in place of Add to Cart
    Show Sold Out Image instead of Add to Cart Button

    0= off
    1= on
    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
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Is there a way to show products sold in it's own category?

    So is there an easy way to create a "Sold" category that any part sold gets moved to?
    I do not want to clutter up my store with a bunch of sold items among items for sale.
    In addition to what Ajeh posted
    You can create a category with a name you prefer maybe "sold" but you then have to manually move these items into it

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

    Default Re: Is there a way to show products sold in it's own category?

    You could customize the orders.php class to move Products to the Sold Out Category when they sell out on the Order ...

    Do you use Linked Products?

    Do you want the Products when they sell out removed from their current Category(ies) and only be in the Sold Out Category?
    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 2014
    Location
    ohio
    Posts
    216
    Plugin Contributions
    0

    Default Re: Is there a way to show products sold in it's own category?

    My replies in bold

    Quote Originally Posted by Ajeh View Post
    You could customize the orders.php class to move Products to the Sold Out Category when they sell out on the Order ...

    Do you use Linked Products?

    Do you want the Products when they sell out removed from their current Category(ies) and only be in the Sold Out Category?
    customize the orders.php class to move Products to the Sold Out Category when they sell out on the Order <--- YES How?
    And yes I use linked products, for example glass has it's own category, but is also linked to the vehicle type

    Do you want the Products when they sell out removed from their current Category(ies) and only be in the Sold Out Category? YES

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

    Default Re: Is there a way to show products sold in it's own category?

    You could try this, after backing up your database and the file orders.php, by adding the code in RED:
    /includes/classes/order.php

    Code:
              //        if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
              if ($stock_left <= 0) {
    
    // bof: move Product to Sold Out Categories
    $categories_sold_out = 66; // Set to Sold Out categories_id
    $delete_sql = "DELETE from " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id ='" . zen_get_prid($this->products[$i]['id']) . "'";
    $db->Execute($delete_sql);
    $add_sql = "INSERT INTO " . TABLE_PRODUCTS_TO_CATEGORIES . "(products_id, categories_id) values (" . zen_get_prid($this->products[$i]['id']) . ", " . $categories_sold_out . ")";
    $db->Execute($add_sql);
    $update_sql = "UPDATE " . TABLE_PRODUCTS . " SET master_categories_id = " . $categories_sold_out . " WHERE products_id = '" . zen_get_prid($this->products[$i]['id']) . "'";
    $db->Execute($update_sql);
    // eof: move Product to Sold Out Categories
    
                // only set status to off when not displaying sold out
                if (SHOW_PRODUCTS_SOLD_OUT == '0') {
                  $db->Execute("update " . TABLE_PRODUCTS . " set products_status = 0 where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
                }
    Be sure to first Create your Sold Out Category and then edit this code and use that categories_id for this setting where it is set currently to 66 to your own categories_id:
    Code:
    $categories_sold_out = 66; // Set to Sold Out categories_id
    
    Last edited by Ajeh; 3 Jul 2015 at 04:43 PM.
    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!

  7. #7
    Join Date
    Sep 2014
    Location
    ohio
    Posts
    216
    Plugin Contributions
    0

    Default Re: Is there a way to show products sold in it's own category?

    Quote Originally Posted by Ajeh View Post
    You could try this, after backing up your database and the file orders.php, by adding the code in RED:
    /includes/classes/order.php

    Code:
              //        if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
              if ($stock_left <= 0) {
    
    // bof: move Product to Sold Out Categories
    $categories_sold_out = 66; // Set to Sold Out categories_id
    $delete_sql = "DELETE from " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id ='" . zen_get_prid($this->products[$i]['id']) . "'";
    $db->Execute($delete_sql);
    $add_sql = "INSERT INTO " . TABLE_PRODUCTS_TO_CATEGORIES . "(products_id, categories_id) values (" . zen_get_prid($this->products[$i]['id']) . ", " . $categories_sold_out . ")";
    $db->Execute($add_sql);
    $update_sql = "UPDATE " . TABLE_PRODUCTS . " SET master_categories_id = " . $categories_sold_out . " WHERE products_id = '" . zen_get_prid($this->products[$i]['id']) . "'";
    $db->Execute($update_sql);
    // eof: move Product to Sold Out Categories
    
                // only set status to off when not displaying sold out
                if (SHOW_PRODUCTS_SOLD_OUT == '0') {
                  $db->Execute("update " . TABLE_PRODUCTS . " set products_status = 0 where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
                }
    Be sure to first Create your Sold Out Category and then edit this code and use that categories_id for this setting where it is set currently to 66 to your own categories_id:
    Code:
    $categories_sold_out = 66; // Set to Sold Out categories_id
    
    Thanks, I will try that but first a few questions (so I can hopefully learn some code,,,)

    $categories_sold_out = SOLD ITEMS; //$categories_sold_out identifies a string called SOLD ITEMS

    Wow the next lines totally confuse me,,,

    At any rate, I manually moved the few items sold, but now my "Products" count is inaccurate, as it's still counting the sold items as active inventory. If I disable the item, then they don't display in my store. (Think I'll go fishing with all the worms that are crawling out of the can,,,) so I need to add code to remove the number of items in the "SOLD ITEMS" category, unless there's a check box for do not include items in this category to be added to the product count, or other work around.

    Thanks for the help so far Ajeh

 

 

Similar Threads

  1. Replies: 3
    Last Post: 7 Oct 2014, 03:07 PM
  2. Replies: 3
    Last Post: 3 Jul 2013, 08:51 PM
  3. v150 Is there a way to only show the sub cats when main category clicked?
    By spiggles87 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 4 Mar 2013, 10:17 PM
  4. Is there a way to just show the Products and not have a category?
    By tanyaleann in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 15 Oct 2008, 05:32 PM
  5. Is there a way to make my own attributes?
    By volleybiggs in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 7 Sep 2008, 08:20 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