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

Wordpress in XC5 -- wordpress home page as site home page?

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 10-19-2014, 09:12 AM
 
JannieB JannieB is offline
 

Senior Member
  
Join Date: Sep 2004
Posts: 117
 

Question Wordpress in XC5 -- wordpress home page as site home page?

Hi,
I have installed the wordpress module to XC5 ... all fine.

There is an option to have recent posts on the home page of the site .... I don't want this, I want the page I have denoted as the wordpress home page to appear here ....
... any idea how I can do that?

I have tried making an htaccess rule to direct the index page to be /blog/index.php - but it doesn't like that! There must be a simple way ...

Any ideas?

Jan
__________________
Jan Beesley
(Currently Xcart 5
Previously XCart Gold from 3.5....)
Reply With Quote
  #2  
Old 10-20-2014, 10:46 PM
  soldatov's Avatar 
soldatov soldatov is offline
Moderator
 

X-Cart team
  
Join Date: Apr 2011
Posts: 163
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

Hi Jan,

Just a quick question.

Not sure that I understand what exactly you need...

Do you need the wordpress-in-xcart page to be displayed first (as it does when you click on the "Blog" tab), or you need the Wodrpress itself to be showing first instead of X-Cart's homepage?
Reply With Quote
  #3  
Old 10-21-2014, 12:34 AM
 
JannieB JannieB is offline
 

Senior Member
  
Join Date: Sep 2004
Posts: 117
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

Hi,

Yes I want the "wordpress in x-cart" page to display as the home page .... so the same as if you had clicked the "Blog" tab.

I tried and failed to do this with .htaccess ..... but then I'm no expert at rewrite rules ....

Thanks,

Jan
__________________
Jan Beesley
(Currently Xcart 5
Previously XCart Gold from 3.5....)
Reply With Quote
  #4  
Old 10-21-2014, 03:11 AM
  soldatov's Avatar 
soldatov soldatov is offline
Moderator
 

X-Cart team
  
Join Date: Apr 2011
Posts: 163
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

You can try the .htaccess rule:

Code:
DirectoryIndex cart.php?target=blog

Let me know if this helped.
Reply With Quote
  #5  
Old 10-21-2014, 04:18 AM
 
JannieB JannieB is offline
 

Senior Member
  
Join Date: Sep 2004
Posts: 117
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

I tried that and it came up with page not found ... even though the url ended with /blog/. If you then press refresh it comes up with the right page ......
...

I think it's dropping through to the rewrite rules below it. I'm wondering if a 301 redirect might do it but not sure how to stop it redirecting everything!

I think what I need to tell the htaccess is to redirect to /blog/ if there is no filename (or if the filename is just cart.php)


Jan
__________________
Jan Beesley
(Currently Xcart 5
Previously XCart Gold from 3.5....)
Reply With Quote
  #6  
Old 10-21-2014, 04:22 AM
  soldatov's Avatar 
soldatov soldatov is offline
Moderator
 

X-Cart team
  
Join Date: Apr 2011
Posts: 163
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

Well, in this case I'd recommend you to ask Qualiteam for a quote for this modification. This can be done within the HelpDesk interface.
Reply With Quote
  #7  
Old 10-21-2014, 04:43 AM
 
JannieB JannieB is offline
 

Senior Member
  
Join Date: Sep 2004
Posts: 117
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

Thanks for your help .... it's such a simple thing really ... I can't understand why its so hard ......

reluctant to spend money on something they can probably answer in 5 minutes .....

... I will persevere!

If anyone from Qualiteam reads this ... please help.
__________________
Jan Beesley
(Currently Xcart 5
Previously XCart Gold from 3.5....)
Reply With Quote
  #8  
Old 10-22-2014, 03:26 AM
 
JannieB JannieB is offline
 

Senior Member
  
Join Date: Sep 2004
Posts: 117
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

Having given up on the rewrite rules, I am trying a different tack ...
... trying to include "main" as an Allowed target for the blog class, in the hop of adding the wordpress module to the home page ...
so far I have added this class in my custom module:

Code:
class WordPress extends XLite\Module\QSL\WordPress\View\WordPress implements \XLite\Base\IDecorator { /** * Return list of allowed targets * * @return array */ public static function getAllowedTargets() { return array_merge(parent::getAllowedTargets(), array('main')); } protected function isVisible() { return (\XLite::getController()->getTarget() == 'main' && \XLite\Core\Config::getInstance()->QSL->WordPress->section_style == 'content section') ? true : false; } }

But no joy ..... surely there must be a away to do this?

Can anyone help?

Jan
__________________
Jan Beesley
(Currently Xcart 5
Previously XCart Gold from 3.5....)
Reply With Quote
  #9  
Old 10-23-2014, 05:27 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,431
 

Default Re: Wordpress in XC5 -- wordpress home page as site home page?

Hi Jan!

I believe, after change of getAllowedTargets() method you start receiving PHP errors into <X-Cart>/var/log/ folder like this:

Code:
[23-Oct-2014 15:09:46 Europe/Berlin] PHP Fatal error: Call to undefined function XLite\Module\QSL\WordPress\View\getInfoAboutWP() in /Applications/MAMP/htdocs/next/src/var/run/classes/XLite/Module/QSL/WordPress/View/WordPress.php on line 58 [23-Oct-2014 15:09:46] Error (code: 1): Call to undefined function XLite\Module\QSL\WordPress\View\getInfoAboutWP() Server API: apache2handler; Request method: GET; URI: /next/src/; Backtrace: #0 Includes\ErrorHandler::logInfo(Call to undefined function XLite\Module\QSL\WordPress\View\getInfoAboutWP(), 1) called at [/Applications/MAMP/htdocs/next/src/Includes/ErrorHandler.php:324] #1 Includes\ErrorHandler::handleError(Array ([type] => 1,[message] => Call to undefined function XLite\Module\QSL\WordPress\View\getInfoAboutWP(),[file] => /Applications/MAMP/htdocs/next/src/var/run/classes/XLite/Module/QSL/WordPress/View/WordPress.php,[line] => 58)) called at [/Applications/MAMP/htdocs/next/src/Includes/ErrorHandler.php:309] #2 Includes\ErrorHandler::shutdown()

If you look into these errors you will see that you need to require_once several PHP files:
<X-Cart>/classes/XLite/Module/QSL/WordPress/wp/wp-lib.php
<X-Cart>/blog/wp-load.php

and then track down other errors if they arise.

All I can say is that WP module was done with assumption that it will be displayed on blog page. That is why implementing it on home page should be considered as another task. Pretty much the same as skot told you earlier.

Anyway, I am not saying that you cannot accomplish it yourself. Surely, if you have PHP knowledge, you will implement this task.
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


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 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 04:48 PM.

   

 
X-Cart forums © 2001-2020