Question

So I've got a Magento install, with Fishpig Wordpress Integration and the ACF plugin to pull in meta values. I'm also using the repeater field here which pulls in the metadata as an array (as I understand it). The Fishpig documentation is non- existent so alot of this is guess work really but here's my code:

<?php
/**
 * @category    Fishpig
 * @package     Fishpig_Wordpress
 * @license     http://fishpig.co.uk/license.txt
 * @author      Ben Tideswell <help@fishpig.co.uk>
 */
?>
<?php $page = $this->getPage() ?>
<?php if ($page): ?>
    <?php $helper = $this->helper('wordpress') ?>
    <?php $author = $page->getAuthor() ?>
    <div class="page-title">
        <h1><?php echo $this->escapeHtml($page->getPostTitle()); ?></h1>
    </div>
        <?php

            $lookbooks = $page->getMetaValue('lookbooks');
            if($lookbooks):
            foreach ($lookbooks as $lookbook) { 
                $title = $lookbook['title'];
                $content = $lookbook['content']; 
                $images = array($lookbook['images']);?>
                <h2><?php echo $title;?></h2>
                    <div class="connected-carousels">
                        <div class="stage">
                            <ul>
                                <?php foreach($images as $image) { ?>
                                    <li>
                                        <img src="<?php echo $image['image'];?>" alt="<?php echo $image['alt'];?>" />
                                    </li>
                                <?php } ?>
                            </ul>
                            <a href="#" class="prev prev-stage inactive">‹</a> 
                            <a href="#" class="next next-stage" >›</a>
                        </div>
                        <div class="navigation">
                            <a href="#" class="prev prev-navigation inactive">‹</a>
                            <a href="#" class="next next-navigation" >›</a>
                            <div class="carousel carousel-navigation">
                            </div>
                        </div>
                    </div>
                <?php echo $content ; ?>
            <?php }
        else : ?>
    <div class="post-view">
        <div class="entry std">
            <?php if ($page->isViewableForVisitor()): ?>
                <?php if ($featuredImage = $page->getFeaturedImage()): ?>
                    <div class="featured-image left"><img src="<?php echo $featuredImage->getAvailableImage() ?>" alt=""/></div>
                <?php endif; ?>
                <?php echo $page->getPostContent() ?>
                <br style="clear:both;"/>
            <?php else: ?>
                <?php echo $this->getPasswordProtectHtml() ?>
            <?php endif; ?>
        </div>
    </div>
    <?php endif;?>
<?php endif; ?>

What I'm trying to do is use the repeater field to make a carousel using jcarousel, I'm fine with my jquery but there's some sort of PHP error here preventing the page from loading.

Here's my ACF structure with the labels:

lookbook (repeater)

--title

--content

--images (repeater)

----image

----alt

I can't see any php errors in the servers error log, nor is the page displaying any errors. It's just not echoing the $image array although it is repeating the loop the right amount of times.

Maybe I'm miles away, maybe I'm nearly there I just can't see anything wrong with it.

Thanks in advance

Was it helpful?

Solution

There is an issue in version 1.2.1.0 of the ACF extension that breaks repeater fields that are embedded inside a repeater field. I have just released version 1.2.2.0 that fixes this issue and allows you to use repeater fields inside other repeater fields.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top