Manufacturer on Product List / Recommended
I searched through all of the previous topics mentioning this, but none of the solutions seem to have worked for me; I tried adding the following function to product.php:
Code:
//$thisManufactorer = $product_info["manufacturerid"]; (without commenting them out of course), which all seemed pretty straightforward, but didn't seem to work. Also tried (again in product.php): Code:
$product_info['manufacturer'] = func_query("SELECT manufacturer FROM xcart_manufacturers WHERE manufacturerid='" . $product_info[manufacturerid] . "'"); which again, the logic behind it seems pretty straightforward to me, but didn't work. For reference, here is the code I'm using on the products_t.tpl: Code:
<div class="brand">{$product.manufacturer}</div> Webmaster mode even shows manufacturer as a variable under the product arrays, but I just can't seem to access it. Any help appreciated before I slam my head against the wall! :D/ |
Re: Manufacturer on Product List / Recommended
Check out the end of this thread. It looks like the same code but the smarty code they used to call the manufacturer was different. 7thdesire said this allowed him to see the manufacturer name on the products list.
Try changing (in your template products_t.tpl): PHP Code:
To this: PHP Code:
Edit: I forgot if you are using columns for your products list you want to edit products_t.tpl, if not edit product_list.tpl |
Re: Manufacturer on Product List / Recommended
Quote:
Thanks for the idea - one of the codes I was testing in the OP was modified from 7thdesire's. I just plugged in the original again to see if it worked, and tried a few different arrangements for the variable on products_t and none of them appear to display anything: {$manufacturer.manufacturer} {$product.manufacturer} {$manufacturer.manufacturer}{$product.manufacturer } - this one works on the individual product pages, at least! The <div class="brand"></div>s are showing up though, so at least I'm fairly certain that I'm using the correct .tpl file |
Re: Manufacturer on Product List / Recommended
Ok I almost slammed my head into a wall too trying to figure this one out. Okay so here's the solution for X-Cart 4.4.4.
FORGET ABOUT PRODUCT.PHP!!! All the other posts are saying to add to that file and it doesn't do anything. Edit: /products.php <---- That's products.... with a 'S' on the end Find this at the bottom of the file: PHP Code:
Add this magical rare code above that line: PHP Code:
Now edit: /skin/your_skin/customer/main/products_list.tpl (if you are using single column) /skin/your_skin/customer/main/products_t.tpl (if you are using multi column) Add this code where you want the manufacturer name to appear: PHP Code:
That makes it work on the regular category pages. But if you want it to appear on the search pages read on. Edit: /search.php Find this line all the way at the bottom: PHP Code:
Add this code above: PHP Code:
And that's all. This mod is free! :mrgreen: |
Re: Manufacturer on Product List / Recommended
It worked perfectly on both counts! Thank you so much.
|
Re: Manufacturer on Product List / Recommended
Could this be turned into array and display manufacturers on category page?
display only manufacturers that exist in products belonging to category you are viewing Thanks. |
Re: Manufacturer on Product List / Recommended
XCart4Life--thanks so much for your solution. I was able to get this to work on the homepage of my site, but for some reason, it doesn't work on category or manufacturer product listing pages. Any idea why that might be?
|
Re: Manufacturer on Product List / Recommended
Thanks XCart4Life
I confirm that your code works for 4.5.4 gold+ also :) Now, I just need some help to display for featured products on home page....do you have any idea ? |
Re: Manufacturer on Product List / Recommended
Ok I managed to show it for featured products also :D/
Open featured_products.php Find this at the bottom of the file: PHP Code:
Add this code above that line: PHP Code:
Done...Now it should display on featured products also on home page :-) |
Re: Manufacturer on Product List / Recommended
I recommend doing a single query rather than a separate query for each product. For example (untested):
PHP Code:
|
All times are GMT -8. The time now is 08:33 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.