Bukimedia / PrestaSharp

CSharp .Net client library for the PrestaShop API via web service
GNU General Public License v3.0
154 stars 152 forks source link

Categories in Top Menu #373

Closed JM63 closed 4 years ago

JM63 commented 4 years ago

Hello

I have the a problem placing categories in the main menu. I saw that prestashop and prestasharp have a webservice named "configurations", it will be possible through this webservice to configure the main menu from the categories.

How can i create the main menu from the categories with prestasharp?

JM63 commented 4 years ago

Hello, For those who need it.


public void topMenuAddCategorie(long catid_)
{
     string itemname = "CAT" + catid_.toString();

     var config = new ConfigurationFactory(_prestashopConfig.baseurl, _prestashopConfig.account, _prestashopConfig.password);

     var filters = new Dictionary<string, string>();
     filters.Add("name", "MOD_BLOCKTOPMENU_ITEMS");
     var topmenu = config.GetByFilter(filters, null, null);

     topmenu[0].value += itemname;
     topmenu[0].date_add = DateTime.Now.toDateTimeString();
     topmenu[0].date_upd = DateTime.Now.toDateTimeString();
     config.Update(topmenu[0]);
}
lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.