Support » Plugins » [Plugin: WP ecommerce] Want to pull in related blog posts titles for products

  • I’m doing an ecommerce site for a store that sells spices. They’re also going to use blog posts to post recipes that use their spices. What we’d like to do is connect the recipes (with a tag or category) to the spices involved. I’m using a theme called wopshop from, which includes a field labeled “More Details,” which drops down when you click it. I’d love to include some sort of php call to find the related recipe posts and pull in the just the titles as links.

    I’ve looked through the documentation, though, and I can’t figure out what call or function or anything I could use inside that div to make it happen (I kind of understand php when I read it but can’t speak it. :P). Can anyone show me a possible solution?

    The code involved is in the products_page.php file of the wp ecommerce plugin, and goes like this:

    <?php if(wpsc_the_product_additional_description()) : ?>
    					<div class='additional_description_span'>
    						<a href='<?php echo wpsc_the_product_permalink(); ?>' class='additional_description_link'>
    							<img class='additional_description_button'  src='<?php echo WPSC_URL; ?>/images/icon_window_expand.gif' title='Additional Description' alt='Additional Description' /><?php echo TXT_WPSC_MOREDETAILS; ?>

    I don’t know in what file where the variable TXT_WPSC_MOREDETAILS gets defined, and I don’t know if that bit of information is relevant, anyway.

    By the way, I’ve been trying to implement this on the page that shows all the products in a single category (and thus, only an abbreviated entry). If it can more easily be done on the individual product page, that would be okay, too. The code in that file is this:

    <div class="wpsc_description"><?php echo wpsc_the_product_description(); ?></div>
    							do_action('wpsc_product_addons', wpsc_the_product_id());
    					<?php if(wpsc_the_product_additional_description()) : ?>
    						<div class="single_additional_description">
    							$value = '';
    							$the_addl_desc = wpsc_the_product_additional_description();
    							if( is_serialized($the_addl_desc) ) {
    								$addl_descriptions = @unserialize($the_addl_desc);
    							} else {
    								$addl_descriptions = array('addl_desc', $the_addl_desc);
    							if( isset($addl_descriptions['addl_desc']) ) {
    								$value = $addl_descriptions['addl_desc'];
                	if( function_exists('wpsc_addl_desc_show') ) {
                		echo wpsc_addl_desc_show( $addl_descriptions );
                	} else {
    								echo stripslashes( wpautop($the_addl_desc, $br=1));
    					<?php endif; ?>

    Help? This is a function the client would very much like. And if there is another solution, perhaps using an additional plugin, I’d love to hear it.

  • The topic ‘[Plugin: WP ecommerce] Want to pull in related blog posts titles for products’ is closed to new replies.