Post by akgamerx » Wed Mar 21, 2012 4:15 pm

Hey guys, I'd really appreciate if someone can inform me on how to display the "Related Products" in the product page in alphabetical order, like the way "Name A-Z" works in the category page.

1.5.2.1

Thank you.

Newbie

Posts

Joined
Tue Aug 09, 2011 2:26 am

Post by uksitebuilder » Thu Mar 22, 2012 12:55 am

edit: catalog/model/catalog/product.php

find

Code: Select all

		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_related pr LEFT JOIN " . DB_PREFIX . "product p ON (pr.related_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pr.product_id = '" . (int)$product_id . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'");
change to

Code: Select all

		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_related pr LEFT JOIN " . DB_PREFIX . "product p ON (pr.related_id = p.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE pr.product_id = '" . (int)$product_id . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' Order By pd.name ASC");

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by akgamerx » Thu Mar 22, 2012 3:03 am

Appreciate your fast reply, that worked great.

Thanks again.

Newbie

Posts

Joined
Tue Aug 09, 2011 2:26 am
Who is online

Users browsing this forum: No registered users and 16 guests