0
votes

How can I send a request to the Wordpress index.php from Magento with Fishpig Wordpress Integration?

I have Magento CE set up with Fishpig Wordpress Integration. The blog is properly integrated into Magento with the Fishpig extension. Wordpress is installed in the magento_root/wp directory. My "Wordpress Address" is http://site.localhost/wp. My "Site Address" is "http://site.localhost/blog".

I am trying to replicate the Jetpack subscribe sidebar widget in the sidebar of the Magento page with the blog but have not been able to find the correct url to send the request to. With Worpress + Jetpack and no Magento integration, the request is sent to "http://site.localhost/wp" and the request object looks like:

[email] => [email protected]
[action] => subscribe
[source] => http://site.localhost/wp/
[sub-type] => widget
[redirect_fragment] => blog_subscription-2
[_wpnonce] => ab277d6d6f
[jetpack_subscriptions_widget] => Subscribe

I have tried using both http://site.localhost/blog/index.php and http://site.localhost/wp/index.php as my request url.

1

1 Answers

0
votes

I solved this by:

  1. Creating a Magento "Subscribe" controller - I copied app/code/community/Fishpig/Wordpress to app/code/local/Fishpig/Wordpress/ and created app/code/local/Fishpig/Wordpress/controllers/SubscribeController.php
  2. Creating a subscribeAction() method within SubscribeController.php. The subscribeAction() method uses makeHttpPostRequest($url, array $data = array()) that is included in the Fishpig/Wordpress module in Helper/System.php
  3. Making an ajax request from the Magento subscribe block template to the subscribe controller.