Post by xkenx » Sun Jun 10, 2012 11:42 am

Because there are many products , some products may have same name or similar, So can anybody tells how can change the Autocomplete not using the product name instead of Model number ?
I found a solution , it greats for Related Product, bur it cannot apply to Featured Product !
http://forum.opencart.com/viewtopic.php?f=23&t=55362

Thank you for your Help !

Newbie

Posts

Joined
Wed May 30, 2012 8:25 pm

Post by Candesco » Sat Aug 18, 2012 7:33 pm

xkenx,

I managed to make Autocomplete work with product model instead of product name.

1. Open /admin/controller/module/featured.tpl

FIND :

Code: Select all

			if ($product_info) {
				$this->data['products'][] = array(
					'product_id' => $product_info['product_id'],
					'name'       => $product_info['name']
				);
REPLACE WITH :

Code: Select all

			if ($product_info) {
				$this->data['products'][] = array(
					'product_id' => $product_info['product_id'],
					'name'       => $product_info['name'],
					'model'       => $product_info['model']
				);

2. Open /admin/view/template/module/featured.tpl

FIND :

Code: Select all

<?php echo $product['name']; ?>
REPLACE WITH :

Code: Select all

<?php echo $product['model']; ?>
This will display the product model instead of the product name in the scrollbox.

If you want to display MODEL and NAME, replace with :

Code: Select all

<?php echo $product['model'] . ' - ' . $product['name']; ?>

FIND :

Code: Select all

filter_name
REPLACE WITH :

Code: Select all

filter_model

FIND :

Code: Select all

label: item.name,
REPLACE WITH :

Code: Select all

label: item.model,
That's it ! :)

New member

Posts

Joined
Thu Nov 11, 2010 12:01 am

Post by GraemeH » Thu Apr 18, 2013 6:00 pm

Just want to say thanks for this - exactly what I was after. :)

New member

Posts

Joined
Fri Apr 20, 2012 4:56 pm

Post by GraemeH » Tue Jul 07, 2015 8:24 pm

Silly question, but I tried changing model to sku and it wouldn't work. Is there any particular reason for that?

New member

Posts

Joined
Fri Apr 20, 2012 4:56 pm

Post by farukh77 » Wed Sep 28, 2016 10:29 pm

thanks. This is working Featured Products. But how can we change same settings for Related Product ?

Newbie

Posts

Joined
Fri Sep 23, 2016 8:27 pm
Who is online

Users browsing this forum: No registered users and 345 guests