Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Could be useful to many. Need help correcting

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-04-2011, 10:35 AM
 
Anty Anty is offline
 

Advanced Member
  
Join Date: Aug 2009
Posts: 40
 

Default 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
__________________
v4.2.2
Reply With Quote
  #2  
Old 01-04-2011, 01:52 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 01-05-2011, 12:49 AM
 
Anty Anty is offline
 

Advanced Member
  
Join Date: Aug 2009
Posts: 40
 

Default 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
__________________
v4.2.2
Reply With Quote
  #4  
Old 01-05-2011, 03:20 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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"?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 01-05-2011, 06:11 AM
 
Anty Anty is offline
 

Advanced Member
  
Join Date: Aug 2009
Posts: 40
 

Default 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
__________________
v4.2.2
Reply With Quote
  #6  
Old 01-05-2011, 06:23 AM
 
Anty Anty is offline
 

Advanced Member
  
Join Date: Aug 2009
Posts: 40
 

Default 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
__________________
v4.2.2
Reply With Quote
  #7  
Old 01-05-2011, 08:45 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Could be useful to many. Need help correcting

Shouldn't form method be "post"? Is this the original code?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #8  
Old 01-05-2011, 10:05 AM
 
Anty Anty is offline
 

Advanced Member
  
Join Date: Aug 2009
Posts: 40
 

Default 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

__________________
v4.2.2
Reply With Quote
  #9  
Old 01-05-2011, 10:28 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #10  
Old 01-05-2011, 10:29 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020