Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanesa Reinerth committed Jun 20, 2019
2 parents 8e51f32 + d6748ad commit afd334d
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 53 deletions.
11 changes: 7 additions & 4 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Contributors: getbowtied, vanesareinerth, adrianlbs
Tags: gutenberg, blocks
Requires at least: 5.0
Tested up to: 5.2.1
Stable tag: 1.3.1
Tested up to: 5.2.2
Stable tag: 1.3.2
Requires PHP: 5.5.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
~Current Version:1.3.1~
~Current Version:1.3.2~

Extends the functionality of the The Retailer theme by adding theme specific features.

Expand Down Expand Up @@ -39,7 +39,10 @@ Companion plugin for the **The Retailer** theme. Extends the functionality by ad

== Changelog ==

= 1.3.1
= 1.3.2 =
- Fixed: Featured products slider shortcode display issues

= 1.3.1 =
- Added: Row and Inner Row Options for WPBakery's Page Builder

= 1.3 =
Expand Down
8 changes: 4 additions & 4 deletions core/updater/assets/plugin.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "The Retailer Extender",
"version": "1.3.1",
"version": "1.3.2",
"download_url": "https://github.com/getbowtied/the-retailer-extender/zipball/master",

"homepage": "https://themeforest.net/item/the-retailer-responsive-wordpress-theme/4287447",
"requires": "5.0",
"tested": "5.2.1",
"last_updated": "2019-05-30 15:00:00",
"tested": "5.2.2",
"last_updated": "2019-06-20 16:00:00",

"author": "GetBowtied",
"author_homepage": "https://getbowtied.com/",

"sections": {
"description": "<p>Companion plugin for the <b>The Retailer</b> theme. Extends the functionality by adding theme specific features.</p><h4>Features:</h4><ul><li>Adds 'Social Media' section in Customizer for easy management of links to social media profiles</li><li>Adds header image option for WooCommerce product categories</li><li>Adds 'Additional JS' section in Customizer allowing for site customization with custom JavaScript code</li><li>Adds social sharing buttons for WooCommerce products and blog posts</li></ul><h4>Gutenberg Blocks:</h4><ul><li>Banner</li><li>Image Slider</li><li>Posts Grid</li><li>Social Media Profiles</li></ul><h4>WPBakery Page Builder Elements:</h4><ul><li>Slider</li><li>Banner</li><li>Blog Posts</li><li>Title & Subtitle</li><li>Social Media Profiles</li><li>Team Members</li><li>Icon Box</li><li>Product Sliders</li></ul>",
"changelog": "<h4>1.3.1</h4><ul><li>Added: Row and Inner Row Options for WPBakery's Page Builder</li></ul><h4>1.3</h4><ul><li>Adds: the 'Social Media' section in Customizer allowing for easy management of links to social media profiles. The icons are being displayed in the footer area and can be displayed in pages using the Gutenberg Block or the WPBakery Page Builder element (functionality transferred from the theme).</li><li>Adds: Theme-specific WPBakery Page Builder elements: Slider, Banner, Blog Posts, Title & Subtitle, Social Media Profiles, Team Members, Icon Box, Product Sliders (functionality transferred from the theme).</li><li>Adds: Upload header images for WooCommerce product categories (functionality transferred from the theme).</li><li>Adds: Theme-specific 'Additional JS' section in Customizer allowing for site customization with custom JavaScript code</li><li>Adds: Theme-specific social sharing buttons for WooCommerce products and blog posts</li></ul><h4>1.2.2</h4><ul><li>WordPress 5.1 compatibility improvements</li></ul><h4>1.2.1</h4><ul><li>Fixed: Columns Block displaying issue</li></ul><h4>1.2</h4><ul><li>WordPress 5+ compatibility improvements</li><li>Improved styles for theme neutrality</li> <li>Localization issues with the Posts Grid Block</li></ul><h4>1.1</h4><ul><li>WordPress 5+ compatibility improvements</li></ul><h4>1.0</h4><ul><li>Initial Version</li></ul>"
"changelog": "<h4>1.3.2</h4><ul><li>Fixed: Featured products slider shortcode display issues</li></ul><h4>1.3.1</h4><ul><li>Added: Row and Inner Row Options for WPBakery's Page Builder</li></ul><h4>1.3</h4><ul><li>Adds: the 'Social Media' section in Customizer allowing for easy management of links to social media profiles. The icons are being displayed in the footer area and can be displayed in pages using the Gutenberg Block or the WPBakery Page Builder element (functionality transferred from the theme).</li><li>Adds: Theme-specific WPBakery Page Builder elements: Slider, Banner, Blog Posts, Title & Subtitle, Social Media Profiles, Team Members, Icon Box, Product Sliders (functionality transferred from the theme).</li><li>Adds: Upload header images for WooCommerce product categories (functionality transferred from the theme).</li><li>Adds: Theme-specific 'Additional JS' section in Customizer allowing for site customization with custom JavaScript code</li><li>Adds: Theme-specific social sharing buttons for WooCommerce products and blog posts</li></ul><h4>1.2.2</h4><ul><li>WordPress 5.1 compatibility improvements</li></ul><h4>1.2.1</h4><ul><li>Fixed: Columns Block displaying issue</li></ul><h4>1.2</h4><ul><li>WordPress 5+ compatibility improvements</li><li>Improved styles for theme neutrality</li> <li>Localization issues with the Posts Grid Block</li></ul><h4>1.1</h4><ul><li>WordPress 5+ compatibility improvements</li></ul><h4>1.0</h4><ul><li>Initial Version</li></ul>"
},

"icons" : {
Expand Down
155 changes: 112 additions & 43 deletions includes/shortcodes/wc/featured-products-slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,55 +22,124 @@ function tr_ext_shortcode_products_slider($atts, $content=null, $code) {

<div class="swiper-wrapper">

<?php
<?php

$atts = shortcode_atts( array(
'per_page' => '12',
'columns' => '4',
'orderby' => 'date',
'order' => 'desc',
'category' => '', // Slugs
'operator' => 'IN', // Possible values are 'IN', 'NOT IN', 'AND'.
), $atts, 'featured_products' );
$atts = shortcode_atts( array(
'per_page' => '12',
'columns' => '4',
'orderby' => 'date',
'order' => 'desc',
'category' => '', // Slugs
'operator' => 'IN', // Possible values are 'IN', 'NOT IN', 'AND'.
), $atts, 'featured_products' );

$meta_query = WC()->query->get_meta_query();
$tax_query = WC()->query->get_tax_query();
$tax_query[] = array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
'operator' => 'IN',
);
$meta_query = WC()->query->get_meta_query();
$tax_query = WC()->query->get_tax_query();
$tax_query[] = array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
'operator' => 'IN',
);

$query_args = array(
'post_type' => 'product',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => $per_page,
'orderby' => $orderby,
'order' => $order,
'meta_query' => $meta_query,
'tax_query' => $tax_query,
);
$query_args = array(
'status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => $per_page,
'orderby' => $orderby,
'order' => $order,
'meta_query' => $meta_query,
'tax_query' => $tax_query,
);

$products = new WP_Query( $query_args );

if ( $products->have_posts() ) : ?>

<?php while ( $products->have_posts() ) : $products->the_post(); ?>
$products = wc_get_products( $query_args );

foreach( $products as $product ) : ?>

<div class="swiper-slide">
<?php wc_get_template_part( 'content', 'product-slider' ); ?>
<div class="swiper-slide">

<li class="products_slider_item">

</div>

<?php endwhile; // end of the loop. ?>

<?php

endif; ?>

<div class="products_slider_content">

<div class="products_slider_images_wrapper">
<div class="products_slider_images">
<a href="<?php echo $product->get_permalink(); ?>">
<?php echo $product->get_image( 'large' ); ?>
</a>
</div>
</div>

<div class="products_slider_infos">

<!-- Show only the first category-->
<?php $gbtr_product_cats = wc_get_product_category_list($product->get_id(), '|||', '',''); ?>
<div class="products_slider_category">
<?php list($firstpart) = explode('|||', $gbtr_product_cats); echo $firstpart; ?>
</div>

<div class="products_slider_title">
<a href="<?php echo $product->get_permalink(); ?>"><?php echo $product->get_name(); ?></a>
</div>

<div class="products_slider_price">
<?php echo $product->get_price_html(); ?>
</div>

<?php if ( !get_theme_mod( 'catalog_mode', false ) ) { ?>

<div class="products_slider_button_wrapper">

<?php
if ( ! $product->is_purchasable() && ! in_array( $product->get_type(), array( 'external', 'grouped' ) ) ) return;
?>

<?php if ( ! $product->is_in_stock() ) : ?>

<a class="dark_button" href="<?php echo apply_filters( 'out_of_stock_add_to_cart_url', get_permalink( $product->get_id() ) ); ?>"><?php echo apply_filters( 'out_of_stock_add_to_cart_text', __( 'Read More', 'woocommerce' ) ); ?></a>

<?php else : ?>

<?php

switch ( $product->get_type() ) {
case "variable" :
$link = apply_filters( 'variable_add_to_cart_url', get_permalink( $product->get_id() ) );
$label = apply_filters( 'variable_add_to_cart_text', __('Select options', 'woocommerce') );
break;
case "grouped" :
$link = apply_filters( 'grouped_add_to_cart_url', get_permalink( $product->get_id() ) );
$label = apply_filters( 'grouped_add_to_cart_text', __('View options', 'woocommerce') );
break;
case "external" :
$link = apply_filters( 'external_add_to_cart_url', get_permalink( $product->get_id() ) );
$label = apply_filters( 'external_add_to_cart_text', __('Read More', 'woocommerce') );
break;
default :
$link = apply_filters( 'add_to_cart_url', esc_url( $product->add_to_cart_url() ) );
$label = apply_filters( 'add_to_cart_text', __('Add to cart', 'woocommerce') );
break;
}

printf('<a class="dark_button" href="%s" rel="nofollow" data-product_id="%s">%s</a>', $link, $product->get_id(), $label);

?>

<?php endif; ?>

</div>
<?php } ?>

</div>

</div>

</li>

</div>

<?php endforeach; ?>

</div>

<div class='swiper-button-prev'></div>
Expand Down
25 changes: 23 additions & 2 deletions the-retailer-extender.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* Plugin Name: The Retailer Extender
* Plugin URI: https://theretailer.wp-theme.design/
* Description: Extends the functionality of The Retailer with theme specific features.
* Version: 1.3.1
* Version: 1.3.2
* Author: GetBowtied
* Author URI: https://getbowtied.com
* Requires at least: 5.0
* Tested up to: 5.2.1
* Tested up to: 5.2.2
*
* @package The Retailer Extender
* @author GetBowtied
Expand Down Expand Up @@ -111,6 +111,27 @@ public function __construct() {
}
}
});

add_action('the_retailer_footer_end', array($this, 'tr_custom_code_footer'));
add_action('the_retailer_header_start', array($this, 'tr_custom_code_header'));
}

/**
* Outputs custom code to footer action
*
* @return void
*/
public function tr_custom_code_footer() {
echo get_option( 'tr_custom_code_footer_js', '' );
}

/**
* Outputs custom code to header action
*
* @return void
*/
public function tr_custom_code_header() {
echo get_option( 'tr_custom_code_header_js', '' );
}

/**
Expand Down

0 comments on commit afd334d

Please sign in to comment.