X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Could be useful to many. Need help correcting (https://forum.x-cart.com/showthread.php?t=57359)

Anty 01-04-2011 10:35 AM

Could be useful to many. Need help correcting
 
Hi to all, could someone tell me what I'm doing wrong here.I'm trying to add a manufacturer menu block
to the existing manufacturer menu.Included code in home.tpl and duplicated code from menu_manfacturer.tpl
into new file menu2_manufaturer.tpl. In first menu I want to list manufacturers from up to 300 (pos order)
and in second menu 300 over.

This is the code I'm trying but have some problems.

{if $manufacturers_menu ne ''}
{capture name=menu}
<form name="form_manuf" method="get" action="manufacturers.php">
<select size="12" name="manufacturerid" onchange="document.form_manuf.submit()">
{section name=mid loop=$manufacturers_menu}
<option value="{$manufacturers_menu[mid].manufacturerid}">{$manufacturers_menu[mid].manufacturer|truncate:18:"...":true}</option>
{/section}
</select>
</form>
{/capture}
{include file="customer/menu_dialog.tpl" title=$lng.lbl_manufacturers content=$smarty.capture.menu additional_class="menu-manufacturers"}
{/if}
{foreach from=$manufacturers_menu item=m}
{if $m.order_by lt 300}
{<div class="Manufacturers list"><a href="home.php?cat={$m.manufacturerid}" class="VertMenuItems">{$m.manufacturers}</a></div>
{/if}
{/foreach}

same for "menu2_manufaturer.tpl" but change {if $m.order_by gt 301}
Doing what I have said both menus list the same manufacturers and links to pages don't work.
I'm surely missing something.Any expert coder out there please help.

Cheers :-)

cflsystems 01-04-2011 01:52 PM

Re: Could be useful to many. Need help correcting
 
The first part of the code already lists manufacturers

Code:

{if $manufacturers_menu ne ''}
{capture name=menu}
<form name="form_manuf" method="get" action="manufacturers.php">
<select size="12" name="manufacturerid" onchange="document.form_manuf.submit()">
{section name=mid loop=$manufacturers_menu}
<option value="{$manufacturers_menu[mid].manufacturerid}">{$manufacturers_menu[mid].manufacturer|truncate:18:"...":true}</option>
{/section}
</select>
</form>
{/capture}
{include file="customer/menu_dialog.tpl" title=$lng.lbl_manufacturers content=$smarty.capture.menu additional_class="menu-manufacturers"}
{/if}


You need to edit that part not adding an additional one

Code:

{if $manufacturers_menu ne ''}
{capture name=menu}
<form name="form_manuf" method="get" action="manufacturers.php">
<select size="12" name="manufacturerid" onchange="document.form_manuf.submit()">
{section name=mid loop=$manufacturers_menu}

{if $manufacturers_menu[mid].order_by lt 300}
<option value="{$manufacturers_menu[mid].manufacturerid}">{$manufacturers_menu[mid].manufacturer|truncate:18:"...":true}</option>

{/if}
{/section}
</select>
</form>
{/capture}
{include file="customer/menu_dialog.tpl" title=$lng.lbl_manufacturers content=$smarty.capture.menu additional_class="menu-manufacturers"}
{/if}


Anty 01-05-2011 12:49 AM

Re: Could be useful to many. Need help correcting
 
Thanks for trying to solve my problem cflsystems but still having same problems.Used your code for both menus changing "lt" but still both menus list the same manufacturers and links to pages don't work.

Anyone else to help please

cflsystems 01-05-2011 03:20 AM

Re: Could be useful to many. Need help correcting
 
Are you sure you are editing the correct template? Are you sure is "order_by" and not "orderby" or "pos"?

Anty 01-05-2011 06:11 AM

Re: Could be useful to many. Need help correcting
 
Thanks again Steve,
I'm editing in "skin1/modules/Manufacturers/menu_manufacturers.tpl" and editing order_by.As I said "In first menu I want to list manufacturers from up to 300 (pos order) and in second menu 300 (pos order) over.

Antonio

Anty 01-05-2011 06:23 AM

Re: Could be useful to many. Need help correcting
 
Thanks Steve,
had to use pos so "orderby" ,but links from menu to maufacturer page still not working. Any other correction you could point out to get this working.

Thanks a billion
Antonio

cflsystems 01-05-2011 08:45 AM

Re: Could be useful to many. Need help correcting
 
Shouldn't form method be "post"? Is this the original code?

Anty 01-05-2011 10:05 AM

Re: Could be useful to many. Need help correcting
 
Hi Steve,
no its not the original code.The "lt" "gt" limits seem to be working fine. The problem now are the links from menu to manufacturer pages.Was thinking about something like this that was working before I made this customization.

<div class="Manufacturers list"><a href="home.php?cat={$?????.manufacturerid}" class="VertMenuItems">{$?????.manufacturers}</a></div>

Tried this in different ways and variables but links still not working

Thanks Steve


cflsystems 01-05-2011 10:28 AM

Re: Could be useful to many. Need help correcting
 
That's what I thought. Not sure who did that for you and why they used form when you can just loop with foreach and use <a> tags

cflsystems 01-05-2011 10:29 AM

Re: Could be useful to many. Need help correcting
 
And select box is not good for SEO - SE can't read the links in there


All times are GMT -8. The time now is 02:04 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.