Forum Replies Created

Viewing 3 replies - 31 through 33 (of 33 total)
  • Thread Starter argeee

    (@argeee)

    Sorry Scribu,
    but it’s this bit:
    <li><?php echo p2p_get_meta( $connection_type->p2p_id, 'characteristic', true ); ?></li>
    that is giving me problems as is not outputing the ‘characteristic’ custom field.

    Any suggestions as why this might be.

    BTW, I would sincerely like to thank you for all your time. It is greatly appreciated.

    Thread Starter argeee

    (@argeee)

    Thanks,
    I made to partially work. However, I cannot seem to access the meta data for the product.

    Here is the code:

    <?php
    	$connected = new WP_Query( array(
    		'post_type' => 'product',
    		'connected_from' => get_the_ID(),
    		'nopaging' => true,
    		'suppress_filters' => false
    	) );
    ?>
    <div class="products_wrapper">
    	<h2>you may also be interested</h2>
    
    		<?php if (have_posts()) : while( $connected->have_posts() ) : $connected->the_post();
    		$connection_type = p2p_get_meta( $post->p2p_id, 'connection_type', true );
    		?>
    			<h3><?php the_title();?></h3>
    			<ul>
    				<li>
    					<a href=" <?php echo get_permalink($connection_type->ID); ?> ">
    						<?php echo get_the_post_thumbnail($connection_type->ID, 'thumbnail'); ?>
    					</a>
    				</li>
    				<li><?php echo get_the_excerpt(); ?></li>
    				<li><?php echo p2p_get_meta( $connection_type->p2p_id, 'characteristic', true ); ?></li>
    			</ul>
    
    		<?php endwhile;
    			wp_reset_postdata();?>
    
    	<?php else:?>
    		<li>
    		   <div class="description_product_wrapper">
    			 <?php echo "there are no accessories associated to this product"; ?>
    			</div> <!-- end description_accessory_wrapper -->
    		</li>
    	<?php endif;?>
    </div>
    <!-- end products_wrapper -->

    Thread Starter argeee

    (@argeee)

    Does anyone have an answer? Please is becoming kind of urgent…

    Thanks

Viewing 3 replies - 31 through 33 (of 33 total)