Hello,
im using V2.3.4
the desktop theme is different than mobile,.
i get below error in mobile homepage (the other pages working properly even checkout)
the homepage error is :
Error filtering template: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ordered_qty' in 'order clause', query was: SELECT DISTINCT 1 AS `status`, `e`.`entity_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`created_at`, `e`.`updated_at`, `e`.`sku`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `e`.`name`, `e`.`short_description`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`manufacturer`, `e`.`manufacturer_value`, `e`.`image`, `e`.`small_image`, `e`.`thumbnail`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`msrp`, `e`.`msrp_display_actual_price_type`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`url_key`, `e`.`links_purchased_separately`, `e`.`links_exist`, `e`.`tax_class_id`, `e`.`swatch_image`, `e`.`sm_featured`, `e`.`wallet_credit_based_on`, `e`.`wallet_credit_based_on_value`, `e`.`wallet_cash_back`, `e`.`gift_expiry_days`, `e`.`gift_min_amount`, `e`.`gift_max_amount`, `e`.`is_gift_card_allowed`, `e`.`ced_rpoint`, `e`.`Shops_Sellers`, `e`.`Shops_Sellers_value`, `e`.`special_from_date`, `e`.`special_to_date`, `at_category_id`.`category_id`, `cat_index`.`position` AS `cat_index_position`, `mv`., `ra`.`reviews_count` AS `num_reviews_count`, `ra`.`rating_summary` AS `num_rating_summary`, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_flat_1` AS `e` INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 LEFT JOIN `catalog_category_product` AS `at_category_id` ON (at_category_id.`product_id`=e.entity_id) INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id=2 LEFT JOIN (SELECT `report_event`., COUNT(`event_id`) AS `num_view_counts` FROM `report_event` WHERE (event_type_id = 1 AND store_id=1) GROUP BY `object_id`) AS `mv` ON mv.object_id = e.entity_id LEFT JOIN `review_entity_summary` AS `ra` ON e.entity_id = ra.entity_pk_value AND ra.store_id=1 INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id WHERE ((at_category_id.category_id IN('2', '97', '98', '99', '100', '101', '103', '105', '109', '185', '186', '187', '189', '190', '193', '194', '195', '196', '197', '199', '200', '212', '213', '285', '288', '289', '292', '293', '294', '295', '296', '297', '299', '300', '301', '302', '303', '304', '305', '306', '307', '310', '311', '315', '316', '317', '318', '319', '320', '321'))) AND (stock_status_index.stock_status = 1) GROUP BY `e`.`entity_id` ORDER BY `ordered_qty` ASC LIMIT 6
anyone could help is this point?
Regards
Gabriel
you need to check the custom blocks/widgets you have for your home page.
it seems like you are having a block for your mobile theme which is fetching best seller products and the sort order is set to ordered_qty but There is no table regarding the order in the select query.
kindly check the block/observer's code if that is a 3rd party or custom extension.
you can check in the admin for widgets.
Hello @amitsamsukha
i checked the block in homepage mobile:
{{block class="Sm\ListingTabs\Block\ListingTabs" template="Sm_ListingTabs::default.phtml" title="Best Sellers" type_show="slider" type_listing="all" display_countdown="0" under_price="5" type_filter="categories" field_tabs="" category_select="" category_tabs="445" order_by="ordered_qty" order_dir="ASC" limitation="6"}}
but same block are in Desktop homepage, and the desktop homepage working fine. !
also i removed that block from mobile homepage, after reindexing and clean and flush...the error is changed to :
SELECT DISTINCT 1 AS `status`, `e`.`entity_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`created_at`, `e`.`updated_at`, `e`.`sku`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `e`.`name`, `e`.`short_description`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`manufacturer`, `e`.`manufacturer_value`, `e`.`image`, `e`.`small_image`, `e`.`thumbnail`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`msrp`, `e`.`msrp_display_actual_price_type`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`url_key`, `e`.`links_purchased_separately`, `e`.`links_exist`, `e`.`tax_class_id`, `e`.`swatch_image`, `e`.`sm_featured`, `e`.`wallet_credit_based_on`, `e`.`wallet_credit_based_on_value`, `e`.`wallet_cash_back`, `e`.`gift_expiry_days`, `e`.`gift_min_amount`, `e`.`gift_max_amount`, `e`.`is_gift_card_allowed`, `e`.`ced_rpoint`, `e`.`Shops_Sellers`, `e`.`Shops_Sellers_value`, `e`.`special_from_date`, `e`.`special_to_date`, `at_category_id`.`category_id`, `cat_index`.`position` AS `cat_index_position`, `mv`., `ra`.`reviews_count` AS `num_reviews_count`, `ra`.`rating_summary` AS `num_rating_summary` FROM `catalog_product_flat_1` AS `e` INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 LEFT JOIN `catalog_category_product` AS `at_category_id` ON (at_category_id.`product_id`=e.entity_id) INNER JOIN `catalog_category_product_index_store1` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=1 AND cat_index.visibility IN(2, 4) AND cat_index.category_id=2 LEFT JOIN (SELECT `report_event`., COUNT(`event_id`) AS `num_view_counts` FROM `report_event` WHERE (event_type_id = 1 AND store_id=1) GROUP BY `object_id`) AS `mv` ON mv.object_id = e.entity_id LEFT JOIN `review_entity_summary` AS `ra` ON e.entity_id = ra.entity_pk_value AND ra.store_id=1 WHERE ((at_category_id.category_id IN('334', '337', '419', '504', '507', '508', '510', '511', '512', '513', '514', '515', '420', '518', '519', '520', '979', '428', '523', '524', '525', '429', '1066', '531', '906', '907', '533', '534', '535', '431', '536', '537', '432', '421', '1088', '1089', '433', '434', '435', '436', '437', '913', '993', '994', '995', '996', '422', '438', '439', '440', '441', '911', '912', '977', '978', '423', '424', '425', '426', '427', '861', '862', '863', '864', '865', '866', '867', '868', '869', '870', '871', '873', '875', '908', '909', '933', '980', '983', '987', '988', '981', '982', '1067', '1068', '1069', '984', '990', '991', '997'))) GROUP BY `e`.`entity_id` ORDER BY `created_at` DESC LIMIT 8haiza
please advice.
Regards
Gabriel