Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Create a query based based on price

    Is there a way to create a query to display a listing page for products from a particular category/sub-category; which the product prices are less than a certain dollar amount?
    Using Zen Cart 1.5.1

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Create a query based based on price

    Where does the "category/sub-category" value get set? Is it a cPath specification, e.g. category 1/subcategory 5 represented as 1_5?

  3. #3
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Create a query based based on price

    Thanks for the reply.

    Yes it is cPath specific.

    http: // MyDomain . com/index.php?main_page=index&cPath=22
    or
    http: // MyDomain . com/index.php?main_page=index&cPath=22_10
    Using Zen Cart 1.5.1

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Create a query based based on price

    Is this a completely stand-alone page you want, or more like limiting the category page to just a certain price range on demand?

    If the latter, it would pretty much be a matter of inserting something like a " and products_price < xx" in the "where" clause of an existing query.
    Last edited by gjh42; 25 Feb 2014 at 05:50 PM.

  5. #5
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Create a query based based on price

    Quote Originally Posted by gjh42 View Post
    Is this a completely stand-alone page you want, or more like limiting the category page to just a certain price range on demand?

    If the latter, it would pretty much be a matter of inserting something like a " and products_price < xx" in the "where" clause of an existing query.
    It would be wonderful to have a stand alone page! I just don't know how involved that would be?

    But for now limiting the display of category page for product prices less than xx.xx would just do.

    Can this be done from URL? Or is it more involved than that?

    Don't laugh, but I tried this and did not produce anything.
    index.php?main_page=index&cPath=22_10&products_price%3C50.00 (%3C is <)

    Thanks Glen.
    Using Zen Cart 1.5.1

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Create a query based based on price

    Not possible from the URL. You would have to alter a query in the file that fetches the listing content. If you want to allow user choice of filtered or unfiltered, or even better the price breakpoint, you would have to additionally build a form that would re-call the page with the new info in the URL, which you would build code to extract and use in the query (with appropriate sanitization so a user couldn't input something malicious).

    The "standalone page" you would like would still be a category listing page, wouldn't it? Or would it be a special "low-price" page that would not look like a standard page? In either case you would use the product listing page as a base, to clone and modify for the special page, or to add conditional code to use the limit on the standard page.

  7. #7
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Create a query based based on price

    Got it thanks.
    Using Zen Cart 1.5.1

 

 

Similar Threads

  1. Need help adjusting letter price based on size attrbute price
    By areticorp in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 5 Oct 2011, 09:02 PM
  2. Fixed based price and adding price on each item
    By dipen10 in forum Addon Shipping Modules
    Replies: 2
    Last Post: 21 May 2010, 10:19 AM
  3. Need to Create a Report - Based on Orders
    By tirjasdyn in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 18 Jan 2009, 03:25 AM
  4. Setting Up Shipping Prices based on categories or Based on Table?
    By CoolCarPartsOnline in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 21 May 2008, 07:22 AM

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