X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Re-order modules on the sidebar (https://forum.x-cart.com/showthread.php?t=70166)

haleystudio 10-06-2014 11:34 AM

Re-order modules on the sidebar
 
I'd like to move the modules around on the sidebar.

Site in question: http://7sorrowsrosaries.com/

Current order:
  • Categories
  • New Arrivals
  • Facebook
Desired order:
  • Categories
  • Facebook
  • New Arrivals
I have a lot of experience in X-cart 4, but this is my first with X-cart 5... so different...

totaltec 10-06-2014 02:30 PM

Re: Re-order modules on the sidebar
 
I think you are in some trouble if you took this on without XC5 experience. Its going to be a big uphill journey trying to understand.

I'll do my best to help get you up to speed. First you need to create a module. Do you have a custom module for the client created yet? If not follow this tutorial: http://xcartguru.com/tutorials/x-cart-5-tutorials/building-a-custom-skin-in-x-cart-5/

It teaches you how to build the bones of a custom skin which is also a module. Get that done, then you will have a place to start from.

haleystudio 10-06-2014 03:29 PM

Re: Re-order modules on the sidebar
 
Thanks for your reply! I will read the link soon.

Yes, I already have a custom skin started. The facebook feed is not a module I created, but it's one that's installed and I was able to customize the CSS for it. All 3 sidebar sections are working (as you can see on the site)... I just want to change the order.

totaltec 10-06-2014 03:56 PM

Re: Re-order modules on the sidebar
 
Okay great, well then you have a nice headstart. To change the order you first need to determine how the sections are being added to the sidebar list. They could be assigned directly in the template, or they could be assigned in the php code of the module. Since the Facebook section is created by a module already, I would start there. One change to the weight of this section could easily place it higher in the list.

Each template that gets assigned to a list has a weight, decreasing the amount of weight for the Facebook template will move it higher in the sidebar list. Can you determine how the Facebook template is getting assigned? In the template code, or in the PHP?

tony_sologubov 10-14-2014 06:20 AM

Re: Re-order modules on the sidebar
 
Hi haleystudio!

Great to hear you decided to write a little mod for X-Cart 5. In order to see, what classes/templates are assigned to the sidebar, you can run a simple MySQL query:

Code:

select * from xc_view_lists where list="sidebar.first" order by weight;

Please, run this query and publish the output here.

Tony.


All times are GMT -8. The time now is 12:57 AM.

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