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

Pull down menu for category and subcategory

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-08-2005, 10:12 PM
 
wm3508 wm3508 is offline
 

Member
  
Join Date: Jun 2005
Posts: 27
 

Default Pull down menu for category and subcategory

Any help with the code or direction on what needs to be edited would be greatly appreciated.

I am trying to make X-Cart Pro cart work, show and sell products and services based on a country and city selection, i.e. make customers first select a country, then a city in the selected country, and only then let them see and purchase products and services, offered in the country and the city they have selected, meaning that there is no need for shipping. Each city for a corresponding country will have different sets of services and products.

After studying the X-Cart Pro admin panel and the code of the shopping cart I think that the easiest way to implement the mentioned above approach would be via the category and subcategory creation for countries and cities in the admin panel. Only there are a few problems with it and I would appreciate it very much if someone would help me with the following:

1) I would like to create 1st pull-down menu (i.e. <option value="0">Select Country</option>, etc.) for a country selection (i.e. categories of 1st level for different countries), then create 2nd and separate pull-down menu for a city selection (i.e. subcategories in each 1st category for the cities in each country). Then I would like to place these pull-down menus at the center and next to each other at the bottom of the header, i.e. next and to the right from the search field. It means that I have to remove the pull-down menus for the 1st level categories from the menu on the left and the pull-down menus for the 2nd level categories and the usual list of subcategories from the loading page in the center, but I need 3rd or 4th level (it will depend if it will be decided to add the state selection as 3rd pull-down menu at the top for countries with states) of subcategories again load into the central page and appear the normal way, i.e. in 1-3 columns with images/thumbnails, links and descriptions for certain types of services and products, so customers could click on each image/thumbnail and view or purchase the different products and services listed in each type of products and services showing in the loaded page.

2) Additionally, I would like to keep track of categories and subcategories, i.e. list them as customer selections in the location bar, in the shopping cart during the checkout process, and finally in the order details, i.e. invoices stored in our database, including in the invoices, which are sent to customer via e-mail, i.e. make categories and subcategories a part of the customer selection process, so it would be known in which country and city customers would like to receive services and customers would see the country and city selections during checkout and in their invoices in addition to other details of their orders.

I was able to find some code in X-Cart forums and generated pull-downs of 1st level categories in the left menu box and pull-downs of further levels in the loading page in the center.

Here is what I used in the categories.tpl file

Code:
{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} <form name="form_cat" method="get" action="home.php"> <select name="cat" onChange="document.form_cat.submit()"> <option value="0">{$lng.lbl_category_country_select}</option> {section name=cat_num loop=$categories} <option class=CategoriesList value="{$categories[cat_num].categoryid}" {if $cat eq $categories[cat_num].categoryid}selected{/if}>{$categories[cat_num].category}</option> {/section} </select> </form> {else} {section name=cat_num loop=$subcategories} <font class=CategoriesList>{ $subcategories[cat_num].category_name|escape }</font> {/section} {/if} {/if} {/capture} {include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu}


and the subcategories.tpl file:

Code:
{* $Id: subcategories.tpl,v 1.43.2.5 2004/12/01 15:15:49 mclap Exp $ *} {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"} {include file="modules/Bestsellers/bestsellers.tpl"} {/if} {if $active_modules.Special_Offers} {include file="modules/Special_Offers/customer/category_offers_short_list.tpl} {/if} {if ($navigation_page eq "")||($navigation_page eq "1")}{$current_category.description|regex_replace:"/[\n]/":" "} {/if} {capture name=dialog} {assign var="tmp" value="0"} {section name=cat_num loop=$subcategories} {if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if} {/section} {if $subcategories} {if $tmp} <form name="form_subcat" method="get" action="home.php"> <select name="cat" onChange="document.form_subcat.submit()"> <option value="0">{$lng.lbl_category_city_select}</option> {section name=cat_num loop=$subcategories} <option class=CategoriesList value="{$subcategories[cat_num].categoryid}" {if $cat eq $subcategories[cat_num].categoryid}selected{/if}>{$subcategories[cat_num].category}</option> {/section} </select> </form> {/if} <TABLE border="0" cellspacing="5"> {foreach from=$subcategories item=subcat} <TR> <TD align="left" nowrap width="95%"><FONT class="ItemsList">{ $subcat.category|escape }</FONT> </TD> <TD align="right" nowrap><FONT class="Text">{if $config.Appearance.count_products eq "Y"} {if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_products} {elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower} {/if} {/if}</FONT></TD> </TR> {/foreach} </TABLE> {/if} {if $tmp and $products ne "" } <BR clear="left"> <HR size="1" noshade> {/if} {if $products} {if $sort_fields} <DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field direction=$search_prefilled.sort_direction url="home.php?cat=`$cat`&"}</DIV> {/if} {if $total_pages gt 2} { include file="customer/main/navigation.tpl" } {/if} <HR size="1" width="100%"> {include file="customer/main/products.tpl" products=$products} {/if} {if $products eq "" and $tmp eq "0"} {$lng.txt_no_products_in_cat} {/if} {/capture} {include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"} {if $products eq ""} {if $f_products ne ""} {include file="customer/main/featured.tpl"} {/if} {/if} { include file="customer/main/navigation.tpl" }


Unfortunately, this code does not allow stopping the pull-down creation at certain level in the subcategories, i.e. after the city selection in my case. Also, I do not know how to rip these pull-down menus out of their places in order to place them side by side in the header, i.e. I would like the category menu box on the left completely disappear without affecting the functionality of shopping cart and make disappear only 1-2 levels of subcategory pull-down menus in the loading page in the center. Then, I do not know how to stop the creation of pull-downs from subcategories at certain level, i.e. 3-4 levels deep, and then make subcategories load and show in normal way in the central page, i.e. how it was before - with images/thumbnails, links and descriptions. Please, help.
__________________
wm3508

X-Cart Pro v. 4.0.14
Reply With Quote
  #2  
Old 07-10-2005, 09:26 PM
 
wm3508 wm3508 is offline
 

Member
  
Join Date: Jun 2005
Posts: 27
 

Default For X-Cart technical support team from Ulyanovsk, Russia

This is for X-Cart technical support team from Ulyanovsk, Russia or wherever you are:

Please, read my post at the following link:

http://forum.x-cart.com/viewtopic.php?t=19798

I would like to get some comments/answers about those slowdowns, warnings and errors for invalid arguments when COOKIES and JAVASCRIPT are turned OFF, as well as about dysfunction of language selection.

If those issues are bug related, it would be nice to know about possible fix/patch., i.e. when it would be available, etc. Thank you.
__________________
wm3508

X-Cart Pro v. 4.0.14
Reply With Quote
  #3  
Old 07-11-2005, 03:29 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

If you want to contact X-Cart, you should do so via your file area. This forum is run by the users, not by X-Cart.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 07-11-2005, 04:41 AM
 
wm3508 wm3508 is offline
 

Member
  
Join Date: Jun 2005
Posts: 27
 

Default Contacting X-Cart technical support team

Thank you for advice to contact X-Cart via communication center in the file area of Help Desk.

I have contacted them from the file area and gave them the link to my post at this forum, so they could have a look at the code and solutions which I tried to find.

Since this forum is running from their server, I suppose they should have access to it.

Again, thank you.
__________________
wm3508

X-Cart Pro v. 4.0.14
Reply With Quote
  #5  
Old 07-11-2005, 04:44 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Yes, they do indeed have access to it, but it is mainly run by the users.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 07-11-2005, 05:10 AM
 
wm3508 wm3508 is offline
 

Member
  
Join Date: Jun 2005
Posts: 27
 

Default

Posting the code in this forum is much easier and gives a better view than in their communication center. I guess they do not expect people posting code in their support center. Then why do they offer technical support points? I hope not just for help with the installation, but with actual code and adaptation to customer needs, etc.

By the way, they just responded to my request in the communication center that

Quote:
normally no support assistance is rendered in the X-Cart forum.


Plus, they told me the following:

Quote:
Unfortunately, we cannot enumerate the exact files to be modified to achieve the needed changes. The matter is, the requested
modification is quite complex and presupposes preliminary investigations. Only afterwards can the work content be defined. As you
know, we forwarded your request to the quote manager, so you will receive a complete speciffication illustrating the modifications.
Then the project will be carried out by the x-cart highly skilled developers. Surely, you will be able to dicsuss the project details
both with the quote manager and with a development project manager.

Actually, I was hoping and thought that my 1st approach via categories is less invasive and would require just a couple of {if} and {else} logic statements and modification of a few template files. Well, I guess they know their software better than anybody else. Either way, I would like to see what they are going to quote and how much this custom work of theirs would cost.
__________________
wm3508

X-Cart Pro v. 4.0.14
Reply With Quote
  #7  
Old 07-11-2005, 05:12 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

They offer tech support points to fix problems/answer questions. Custom code projects (like the one you are proposing) wouldn't be handled by support points.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #8  
Old 07-11-2005, 05:22 AM
 
wm3508 wm3508 is offline
 

Member
  
Join Date: Jun 2005
Posts: 27
 

Default

Well, it is nice to know what their technical support points meant to cover. It would be nice if they would somehow specify this in their communication center, because different customers might have technical questions of different complexity.
__________________
wm3508

X-Cart Pro v. 4.0.14
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 07:44 AM.

   

 
X-Cart forums © 2001-2020