Amethyst_fairy:
<?php
/**Single Listing Template mod v1.8
* Featured Products header_php.php
```
That's not how the original Zen Cart file begins, so clearly it's been altered.
Whoever rewrote this file broke it:
Note the use of
$listing_sql vs
$featured_products_split in the code you quoted:
> **Amethyst\_fairy:**
>
> ```
$listing_sql = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
p.product_is_always_free_shipping, p.products_qty_box_status,
p.master_categories_id, m.manufacturers_id
FROM (" . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " .
TABLE_PRODUCTS_DESCRIPTION . " pd
LEFT JOIN " . TABLE_FEATURED . " f on pd.products_id = f.products_id )
WHERE p.products_status = 1 and p.products_id = f.products_id and f.status = 1
AND p.products_id = pd.products_id and pd.language_id = :languagesID " .
$order_by;
$[B]listing_sql[/B] = $db->bindVars(
$listing_sql, ':languagesID', $_SESSION['languages_id'], 'integer');
$featured_products_split = new splitPageResults(
$[B]featured_products_query_raw[/B], MAX_DISPLAY_PRODUCTS_FEATURED_PRODUCTS);
```
Now note what the template file is expecting:
> **Amethyst\_fairy:**
>
> [20-Jul-2016 09:27:58 America/Denver] PHP Fatal error: 1064:You have an error in your SQL syntax;
> ... /includes/templates/template_default/templates/**tpl_modules_products_featured_listing.php** on line 23 <== in
```
22 if (
$featured_products_split->number_of_rows > 0) {23 $featured_products = $db->Execute($
featured_products_split->sql_query);
```
In the header file, $listing_sql contains the query
And $featured_products_split is set to $featured_products_query_raw instead of to $listing_sql ... so instead of generating a complete query all it does is respond to the "limit" syntax for limiting the maximum number of records to display (ie: "limit 10" in your case, as reported in your error log).
So when the template tries to access $featured_products_split, it gets a broken query, and of course no results.
Solution: put back the original header_php.php file until you sort out why it had been changed in the first place and obtain/create a proper working version of the customizations you're using ... if you really even need them at all. Most people don't need the change anyway.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.