View Single Post
  #8  
Old 05-17-2008, 04:59 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Adding ability sort by date

Quote:
Originally Posted by thefizix
Thanks for posting this I kind of ran into an problem. I got the "Add Date" to display on the customer section but its not in the drop down menu under general settings/display products. There is only a blank space for where its suppose to be. Also when I select that blank text in the drop down menu it gives me a SQL error on the customer section when viewing an item.

I did run into a problem earlier on I couldnt add "INSERT INTO xcart_languages VALUES ('US','lbl_add_date','Add date','Labels');"I was only able to add "REPLACE INTO xcart_config VALUES" query. Any suggestions

I think that is because the sql query in the first post is incorrect. I had the same problem. I used phpmyadmin and went into the database...

I looked in "xcart_config" for "products_order" under the "name" heading (mine was on page 8 - your results may vary) I found there were spaces where there shouldn't be, so I fixed them.

The "variants" section should read...
add_date:lbl_add_date
productcode:lbl_sku
title:lbl_product
orderby:lbl_default
price:lbl_price

(make sure there are no added spaces or it throws the whole thing off)

EDIT: I did find another problem however...

When selecting "Add Date" as the choice for "Select the order in which products should be displayed within a category:" there is a SQL error in the Product page to the customer.

INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 3' at line 1
SQL QUERY FAILURE:SELECT xcart_products.productid, IF(xcart_products_lng.productid != '', xcart_products_lng.product, xcart_products.product) as product, xcart_products.productcode, xcart_products.avail, xcart_pricing.price, xcart_quick_prices.variantid, IFNULL(xcart_variants.avail, xcart_products.avail) as avail, IFNULL(xcart_variants.weight, xcart_products.weight) as weight, IFNULL(xcart_variants.productcode, xcart_products.productcode) as productcode, IF(xcart_classes.classid IS NULL,'','Y') as is_product_options, IF(xcart_variants.variantid IS NULL,'','Y') as is_variant, xcart_product_taxes.taxid FROM xcart_pricing, xcart_products LEFT JOIN xcart_products_lng ON xcart_products.productid = xcart_products_lng.productid AND code = 'US' LEFT JOIN xcart_quick_prices ON xcart_quick_prices.productid = xcart_products.productid AND xcart_quick_prices.membershipid = 0 LEFT JOIN xcart_product_memberships ON xcart_product_memberships.productid = xcart_products.productid LEFT JOIN xcart_classes ON xcart_classes.productid = xcart_products.productid LEFT JOIN xcart_variants ON xcart_variants.productid = xcart_products.productid AND xcart_quick_prices.variantid = xcart_variants.variantid LEFT JOIN xcart_product_taxes ON xcart_product_taxes.productid = xcart_products.productid INNER JOIN xcart_products_categories ON xcart_products_categories.productid = xcart_products.productid INNER JOIN xcart_categories ON xcart_categories.categoryid = xcart_products_categories.categoryid AND xcart_categories.avail = 'Y' LEFT JOIN xcart_category_memberships ON xcart_category_memberships.categoryid = xcart_categories.categoryid WHERE (xcart_category_memberships.membershipid = '0' OR xcart_category_memberships.membershipid IS NULL) AND xcart_products.forsale='Y' AND (xcart_product_memberships.membershipid = '0' OR xcart_product_memberships.membershipid IS NULL) AND xcart_products.avail > 0 AND xcart_quick_prices.priceid = xcart_pricing.priceid AND xcart_products.productid = xcart_products_categories.productid AND xcart_products_categories.categoryid = xcart_categories.categoryid AND xcart_products.productid = xcart_pricing.productid AND xcart_pricing.quantity = '1' AND xcart_pricing.membershipid = 0 AND xcart_products.product_type <> 'C' AND xcart_products.forsale <> 'B' AND (xcart_pricing.variantid = 0 OR (xcart_variants.variantid = xcart_pricing.variantid AND xcart_variants.avail > 0)) AND xcart_products.productid IN ('16463','18287','17351') GROUP BY xcart_products.productid ORDER BY LIMIT 3

Any ideas why?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote