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

How to change the content on the front page?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-27-2016, 07:41 PM
 
garys garys is offline
 

Newbie
  
Join Date: Jul 2016
Posts: 5
 

Default How to change the content on the front page?

I have been programming for a living for almost 35 years now and although I never claimed to know everything, I have been able to figure most things out without assistance.

That doesn't seem to be the case with X-Cart 5. I am really struggling with things that, in my mind, should be easy to solve.

I thought it would be a simple thing to replace the Featured Products from the home page with New Arrivals and remove it from the sidebar. The main reason for this is that we want the new products to be featured automatically rather than having to select them manually every week.

It's easy to disable the Featured Products module. It's easy to add my own content to the page through Catalog | Front Page in the admin section.

On the other hand, I have no clue how to add the New Arrivals module to the main content section or remove it from the sidebar. I have tried to figure out what the code is doing but I feel like I'm going around in circles. As soon as I thought I found a solution, it turned out to be a dead end.

I have looked at the page with Webmaster Mode turned on and I can see the FeaturedProducts module entry in the Theme Tweaker. When I double-click the template, I am shown a .tpl file with a few lines of code ... none of which point me to anything that makes sense.

Clearly, I am not understanding the template system that is being used here. I have worked with other scripts that also used templates but was able to figure those out pretty easily. This is pretty discouraging.

Can somebody either help me with this particular issue or at least point me to an example of a similar issue? Telling me "you just have to write a module" isn't particularly helpful because I need to understand the concepts first.

Any help would be very much appreciated.

Thank you.
__________________
5.2.15
Reply With Quote
  #2  
Old 07-27-2016, 08:29 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: How to change the content on the front page?

XC5 is not easy to follow. There is no straight way to explain it as it goes back and forth between php scripts and templates.

I still have hard time in some cases figuring out what's what and where does it come from.

Anyway look at this file - classes/XLite/Module/CDev/ProductAdvisor/View/NewArrivals.php - which shows the new arrivals products on site.

Code:
/** * New arrivals block widget * * @ListChild (list="center.bottom", zone="customer", weight="500") * @ListChild (list="sidebar.single", zone="customer", weight="160") * @ListChild (list="sidebar.second", zone="customer", weight="110") */

ListChild tells the cart where to show the widget.

Take a look at - protected function isVisible() - it tells the cart where and when to show the widget. You can just overwrite this function in your module and remove the sidebar condition.

This is something to start with, you may need to do additional modifications though
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 07-27-2016, 09:22 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How to change the content on the front page?

Please also check these forum threads:
- https://forum.x-cart.com/showthread.php?t=73877
- https://forum.x-cart.com/showthread.php?t=74130

Quote:
Telling me "you just have to write a module" isn't particularly helpful because I need to understand the concepts first.

Have you checked the documentation for developers at http://kb.x-cart.com/ ?
It explains the concepts and basics and has a lot of examples.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #4  
Old 07-28-2016, 08:20 AM
 
garys garys is offline
 

Newbie
  
Join Date: Jul 2016
Posts: 5
 

Default Re: How to change the content on the front page?

Quote:
Originally Posted by qualiteam
Have you checked the documentation for developers at http://kb.x-cart.com/ ?
It explains the concepts and basics and has a lot of examples.

I do not see a way to access the developers' documentation from that link. It looks like more of a user guide.

After searching around (with Google), I found http://devs.x-cart.com/en/, which appears to be the correct page.
__________________
5.2.15
Reply With Quote
  #5  
Old 07-28-2016, 10:20 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: How to change the content on the front page?

Ouch. You're right. At the moment the XC5 team is updating the documentation portal and the new URL is http://devs.x-cart.com/ (http://kb.x-cart.com/ will be for the end-user documentation only).
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may 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 05:09 AM.

   

 
X-Cart forums © 2001-2020