• Resolved Simba123

    (@simba123)


    Hi,

    I have done some research on my query along with reading through previous forums and have not been able to solve my problem.

    Current Situation

    1. I currently have a magento website which is up and running. https://www.domain1.com

    2. I am developing a WordPress website on a separate server. https://www.domain2.com

    3. After researching I have discovered that I can not connect the two whilst on different domains.

    4 .I have installed a fresh installation of magento on to my wordpress server so currently wordpress sits at https://www.domain2.com and magento sits at https://www.domain2.com/shop (I plan to swap the fresh magento with the existing one at a later date)

    5. I have updated the magento functions.php file to the one in the installation documentation.

    6. Here is where I’m stuck. I’m trying to set up my path to mage.php. I’ve copied the root as shown on the side and then added /shop/app/mage.php but it keeps returning with ‘invalid url’

    I need to fix this to say ‘valid url’ obviously and I also need to show the following on my wordpress site:
    – 4 popular products on the homepage
    – all products page
    – individual products page

    Is this possible? Also will I be able to style the magento bits once integrated through wordpress style.css so it matches my wordpress theme?

    https://www.ads-software.com/plugins/magento-wordpress-integration/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Simba123

    (@simba123)

    UPDATE:

    I managed to connect to Mage.php. Even though I had updated the functions.php, I hadn’t made a ‘local’ directory so I was missing that path.

    Once I made the new functions.php, Mage.php was suddenly found.

    I’ve now managed to get Magento and WordPress to connect (yay).

    My next problem:
    I added a block for test purposes:
    <?php the_block("footer_links"); ?>

    and it worked like a charm, however, when I try to add my own custom block

    <?php the_block("popular_products"); ?>

    The output is ‘sorry that block couldn’t be found’. What am I doing wrong?

    Thread Starter Simba123

    (@simba123)

    UPDATE

    I’ve discovered it isn’t as simple as making a block and calling it.

    I’ve created the following files:

    app/code/local/Mage/Catalog/Block/Product/Mostviewed.php
    app/code/local/Mage/Catalog/Block/Product/Bestseller.php

    After this, I created a static block in magento called ‘Popular Products’ with the identifier ‘popular_products’. In the block I then placed:

    <block type="catalog/product_mostviewed" name="popular.products" template="catalog/product/mostviewed.phtml"/>

    And called the block trying both the following:

    <?php the_block("popular_products"); ?>

    <?php the_block("popular.products"); ?>

    Still the block can’t be found ??

    Thread Starter Simba123

    (@simba123)

    Update:

    – I added this into a static block
    {{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

    – then this into my WordPress page template
    <?php $staticblock = get_static_block("new_products"); echo $staticblock; ?>

    And it worked ?? I assume the same process will work for showing all products.

    saverdaj

    (@saverdaj)

    Just want to say thanks this was exactly what I needed.

    Plugin Author jamesckemp

    (@jamesckemp)

    Hey,

    Just wanted to check that your package/theme were both entered correctly – assuming the theme has been built correctly, those blocks should work using the functions provided

    Thanks!

    Thread Starter Simba123

    (@simba123)

    Hi James,

    I was being silly and was entering my code into a static block but using the wrong code to call it. Everything is working great now. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need help integrating Magento and WordPress then calling Magento sections’ is closed to new replies.