Social AP on productpages

May 2014 WordPress Theme
GK User
Thu Apr 23, 2015 11:35 am
Hi,
is it possible to use your integrated social API on product pages as well?

/linus
User avatar
Senior Boarder

GK User
Thu Apr 23, 2015 12:06 pm
Hi,

Try to replace StoreFront/woocommerce/single-product/price.php file with the following:
Code: Select all
<?php
/**
 * Single Product Price, including microdata for SEO
 *
 * @author       WooThemes
 * @package    WooCommerce/Templates
 * @version     1.6.4
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $post, $product, $gk_tpl;
?>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
   
   <?php
   // variable for the social API HTML output
   $social_api_output = gk_social_api(get_the_title(), get_the_ID());
   ?>

   <?php if($social_api_output != '' ): ?>
      <?php echo $social_api_output; ?>
   <?php endif; ?>

   <p itemprop="price" class="price"><?php echo __('<span class="price-text">' . __( 'Price: ', GKTPLNAME ) . '</span>', GKTPLNAME); ?><?php echo $product->get_price_html(); ?></p>

   <meta itemprop="priceCurrency" content="<?php echo get_woocommerce_currency(); ?>" />
   <link itemprop="availability" href="http://schema.org/<?php echo $product->is_in_stock() ? 'InStock' : 'OutOfStock'; ?>" />

</div>
User avatar
Moderator

GK User
Fri Apr 24, 2015 9:46 am
Thanks, that works but the implementation wasn't that nice looking, takes to much space. If you wan't to place something under the product images instead, is that possible?
User avatar
Senior Boarder

GK User
Fri Apr 24, 2015 10:08 am
I placed it in the product-image.php and changed the #gk-social-api and that could work. Is it possible to change to other icons.
User avatar
Senior Boarder

GK User
Mon Apr 27, 2015 7:49 am
What other icons exactly? You can use only the same social icons like in your posts/pages.
User avatar
Moderator


cron