Advertisement
jegtheme

review-content.php

Oct 18th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.59 KB | None | 0 0
  1. <section class="article-content">
  2.     <?php
  3.     $pricewidgetlocation = vp_option('joption.show_price_widget', 'none');
  4.     $pricelist = vp_metabox('jmagz_review_price.price');
  5.  
  6.     if(!empty($pricelist)) {
  7.         if($pricewidgetlocation == 'onarticle' || $pricewidgetlocation == 'both') {
  8.             $pricehtml = '';
  9.             foreach($pricelist as $pricestore) {
  10.                 $price = vp_option('joption.review_price_front', '$') . $pricestore['price'] . vp_option('joption.review_price_behind');
  11.                 $pricehtml .=
  12.                     '<li>
  13.                    <strong class="store-name">' . $pricestore['shop'] . '</strong>
  14.                    <div class="store-aff">
  15.                        <a target="_blank" href="' . $pricestore['link'] . '" class="aff-price">' . $price . '</a>
  16.                        <a target="_blank" href="' . $pricestore['link'] . '" class="aff-link">' . __('Buy', 'jeg_textdomain') . '</a>
  17.                    </div>
  18.                </li>';
  19.             }
  20.             $lowestprice = get_post_meta(get_the_ID(),'price_lowest');
  21.             $lowestprice = vp_option('joption.review_price_front', '$') . $lowestprice[0] . vp_option('joption.review_price_behind');
  22.  
  23.             $lowestpriceinfo = '';
  24.  
  25.             if(sizeof($pricelist) > 1) {
  26.                 $lowestpriceinfo =
  27.                     '<div class="price-info">
  28.                    <h4 class="info-title">' . __('Lowest Price at:', 'jeg_textdomain') . '</h4>
  29.                    <strong>' . $lowestprice . '</strong>
  30.                </div>';
  31.             }
  32.  
  33.             echo
  34.                 '<aside class="aside-post">
  35.                    <div class="productinfo">
  36.                        <h3 class="product-name">' . vp_metabox('jmagz_review_meta.product_name') . '</h3>
  37.                        ' . $lowestpriceinfo . '
  38.                        <div class="store-info">
  39.                            <h4 class="info-title">' . __('Where to buy:', 'jeg_textdomain') . '</h4>
  40.                            <ul class="stores">
  41.                                ' . $pricehtml . '
  42.                            </ul>
  43.                        </div>
  44.                    </div>
  45.                </aside>';
  46.         }
  47.     }
  48.  
  49.     the_content();
  50.     get_template_part('fragment/review-box');
  51.     wp_link_pages(array(
  52.         'before' => '<div id="pagination" class="article-pagination clearfix"><div class="pagination-number">',
  53.         'link_before' => '<span class="page-item">',
  54.         'link_after' => '</span>',
  55.         'after' => '</div></div>'
  56.     ));
  57.     ?>
  58.     <div id="end-content"></div>
  59. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement