Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Month-By-Month Breakdown of Products Expected

    (Firstly, sorry for constantly asking these questions as I can see I'm the last four posters >.> but I'm still newish to coding and the like besides simple debugging)

    I have the following Query ready to go for a modification to the bestseller list. I'm trying to use this list to separate the list by groups based on month as an <ul>. But I cannot quite figure out how to do this with a $db->execute($some_query). Anyone mind helping?

    Code:
    select p.products_id, pd.products_name, p.products_date_available as date_expected, 
    p.master_categories_id, MONTHNAME(STR_TO_DATE(MONTH(p.products_date_available), '%m')) as month_expected
                           from jg1_products p, jg1_products_description pd
                           where p.products_id = pd.products_id
                           and p.products_status = 1
                           and pd.language_id = 1
                           and p.products_date_available >20140721235959
                           GROUP BY MONTH(p.products_date_available)

  2. #2
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Idea or Suggestion Re: Month-By-Month Breakdown of Products Expected

    It should also be noted that I see this in the ZenCart Plugin database guidelines:

    License: Must be GPL, since it's integrating into Zen Cart® core code, which is GPL. A complete copy of the license should be included in the contribution files, preferably as a separate file. If an addon is free-standing (ie: doesn't use *any* existing Zen Cart® files in order to operate) then it can be licensed under another license provided that license is fully compatible with GPL.
    The guidelines doesn't state that GPLv2 must be used but I'm also not seeing the "clause" that a later/newer version can be used like I do in other GPL based coding. I mean is GPLv3 is compatible with GPLv2?

  3. #3
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Month-By-Month Breakdown of Products Expected

    When say can't figure out how... What about the how is the problem? Thought would just set the query to a variable and then execute the variable? Might need to add a semi-colon to the end of the statement. (;)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #4
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Month-By-Month Breakdown of Products Expected

    Oh wow I forgot to come back and answer this. I solved this problem by using a few group commands in MySQL. This was the final result:

    PHP Code:
    $expected_products_query "select p.products_id, pd.products_name, products_date_available as date_expected,                                   p.master_categories_id, CONCAT(MONTHNAME(STR_TO_DATE(MONTH(products_date_available), '%m')), ' ', YEAR(products_date_available)) as month_year 
                                from " 
    TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd 
                                where p.products_id = pd.products_id 
                                and p.products_status = 1 
                                and pd.language_id = '" 
    . (int)$_SESSION['languages_id'] . "'" .
                                
    zen_get_upcoming_date_range() . "
                                ORDER BY YEAR(date_expected) ASC, MONTH(date_expected) ASC, pd.products_name ASC"


  5. #5
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Month-By-Month Breakdown of Products Expected

    Addressing in alternate thread where licensing is being discussed.
    Last edited by mc12345678; 25 Jul 2014 at 12:16 AM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Replies: 2
    Last Post: 16 Nov 2009, 07:35 AM
  2. i can't upgrade the special prices from month to month?
    By zooma in forum Setting Up Specials and SaleMaker
    Replies: 2
    Last Post: 1 Oct 2009, 06:56 AM
  3. Changing the Month in the "New Products for [Month]"
    By ashain in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 29 Jun 2008, 11:50 AM
  4. how do I change "New Products for 'month' and 'monthly specials for 'month'
    By Fatum in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Mar 2008, 07:08 PM
  5. Credit Card Month menu by number not month name?
    By re_active in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 18 Jan 2007, 01:11 AM

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