-carousel__slide" tabindex="0" class="carousel__slide">';
// $productItem .= ' ';
// $productItem .= '';
// }
// $productItem .= '';
// $productItem .= '';
// $productItem .= '
';
// $productItem .= "";
// endwhile;
// $productItem .= '';
// return $productItem;
// }, 10, 2);
// add_filter( 'cs_looper_custom_customer_also_bought', function( $result, $args )
// {
// $products = new WP_Query(
// array(
// 'post_type' => 'product',
// 'meta_query' => array(
// array(
// 'key' => 'customer_also_bought',
// 'value' => 'TRUE',
// 'compare' => '='
// ),
// array(
// 'key' => '_stock_status',
// 'value' => 'instock'
// )
// ),
// )
// );
// return $products->posts;
// }, 10, 2);
// function filter_projects() {
// $catSlug = $_POST['category'];
// $catSlug = rtrim($catSlug, ",");
// $selectFilter = trim($_POST['filtersSelected']);
// //echo 'CatSlug: '.$catSlug.' ';
// $catSlugValue = $catSlug;
// if (str_contains($selectFilter, 'footwear-size')) $catSlugValue = $catSlug;
// if (str_contains($catSlug, 'footwear-color-')) $catSlugValue = str_replace("footwear-color-", "",$catSlugValue);
// if (str_contains($catSlug, 'clothing-color-')) $catSlugValue = str_replace("clothing-color-", "",$catSlug);
// //echo 'catSlugValue: '.$catSlugValue.' ';
// if (str_contains($selectFilter, 'clothing-size')) {
// //echo 'Clothing Size Filter: '.$selectFilter.' ';
// if (str_contains($catSlugValue, 'x-small')) $catSlugValue = str_replace("x-small", "xs",$catSlugValue);
// if (str_contains($catSlugValue, 'small')) $catSlugValue = str_replace("small", "s",$catSlugValue);
// if (str_contains($catSlugValue, 'medium')) $catSlugValue = str_replace("medium", "m",$catSlugValue);
// if (str_contains($catSlugValue, 'large')) $catSlugValue = str_replace("large", "l",$catSlugValue);
// if (str_contains($catSlugValue, 'x-large')) $catSlugValue = str_replace("x-large", "xl",$catSlugValue);
// if (str_contains($catSlugValue, '2x-large')) $catSlugValue = str_replace("2x-large", "xxl",$catSlugValue);
// }
// //echo 'catSlugValue: '.$catSlugValue.' ';
// $catSlugLookup = explode(',', $catSlugValue);
// //echo 'CatSlugArray '.print_r($catSlugLookup, true).' ';
// //echo 'selectFilter: '.$selectFilter.' ';
// if(is_null($_POST['pageOffset']) || !isset($_POST['pageOffset']))
// $pageOffset = 0;
// else
// $pageOffset = intval( $_POST['pageOffset'] );
// if(is_null($_POST['postsPerPage']) || !isset($_POST['postsPerPage']))
// $postsPerPage = 30;
// else
// $postsPerPage = intval( $_POST['postsPerPage'] );
// $lookupSlug = explode(',', $catSlug);
// if (empty($catSlug)) {
// $ajaxposts = new WP_Query([
// 'posts_per_page' => $postsPerPage,
// 'post_type' => 'product',
// 'orderby' => 'menu_order',
// 'order' => 'ASC',
// 'meta_query' => array(
// array(
// 'key' => '_stock_status',
// 'value' => 'instock'
// )
// ),
// 'offset' => $pageOffset
// ]);
// } elseif (count($lookupSlug) > 1) {
// //echo 'Category Check: '.$catSlug.' ';
// $taxQueryArray = [];
// foreach ($lookupSlug as $value) {
// $taxInnerArr = array(
// 'taxonomy' => 'product_cat',
// 'field' => 'slug',
// 'terms' => $value,
// 'operator' => 'IN'
// );
// array_push($taxQueryArray, $taxInnerArr);
// }
// $ajaxposts = new WP_Query([
// 'posts_per_page' => $postsPerPage,
// 'tax_query' => array(
// 'relation' => 'AND',
// $taxQueryArray
// ),
// 'post_type' => ['product','product_variation'],
// 'orderby' => 'menu_order',
// 'order' => 'ASC',
// 'offset' => $pageOffset,
// 'meta_query' => array(
// array(
// 'key' => '_stock_status',
// 'value' => 'instock'
// )
// )
// ]);
// } else {
// //echo 'Category Check: '.$catSlug.' ';
// $ajaxposts = new WP_Query([
// 'posts_per_page' => $postsPerPage,
// 'tax_query' => array(
// array(
// 'taxonomy' => 'product_cat',
// 'field' => 'slug',
// 'terms' => $lookupSlug
// )
// ),
// 'post_type' => 'product',
// 'orderby' => 'menu_order',
// 'order' => 'ASC',
// 'offset' => $pageOffset,
// 'meta_query' => array(
// array(
// 'key' => '_stock_status',
// 'value' => 'instock'
// )
// )
// ]);
// }
// // echo 'Found '.print_r($ajaxposts->posts,true).' Post IDs ';
// // echo 'Found ajaxposts '.$ajaxposts->found_posts.' Posts ';
// if($ajaxposts->have_posts()) {
// while($ajaxposts->have_posts()) : $ajaxposts->the_post();
// $inStock = true;
// if ($selectFilter != '') {
// $inStock = false;
// $product = wc_get_product();
// $variations = $product->get_available_variations(); // $return='objects' $return='array'
// //echo 'variations '.print_r($variations,true).' ';
// //echo ' product name '.$product->get_title().' ';
// foreach ($variations as $variation) {
// //echo 'variation '.print_r($variation,true).' ';
// //echo 'variation color '.$variation['attributes']['attribute_pa_color'].' ';
// //echo 'variation size '.$variation['attributes']['attribute_pa_size'].' ';
// $availableColors = 'Black,Blue,Brown,Gray,Green,Orange,Pink,Purple,Red,White,Yellow';
// $isInStock = $variation['is_in_stock'];
// //echo 'variation in stock '.print_r($isInStock, true).' ';
// if (str_contains($selectFilter, 'footwear-size') || str_contains($selectFilter, 'footwear-color')) {
// $attributeSize = $variation['attributes']['attribute_pa_size'];
// $attributeColor = $variation['attributes']['attribute_pa_color'];
// if (str_contains($selectFilter, 'footwear-size') && str_contains($selectFilter, 'footwear-color')) {
// foreach ($catSlugLookup as $value) {
// if (str_contains($availableColors, $value)) $lookupValue = trim($value);
// }
// //echo 'Footwear Color lookupValue '.$lookupValue.' ';
// if ($isInStock && (in_array($attributeSize, $catSlugLookup) && str_contains($attributeColor, $lookupValue))) {
// //echo 'both Footwear variations in stock '.print_r($isInStock, true).' ';
// $inStock = true;
// break;
// }
// continue;
// }
// if (str_contains($selectFilter, 'footwear-size')) {
// if ($isInStock && in_array($attributeSize, $catSlugLookup)) {
// //echo 'Footwear variation size in stock '.print_r($isInStock, true).' ';
// $inStock = true;
// break;
// }
// }
// if (str_contains($selectFilter, 'footwear-color')) {
// $lookupValue = '';
// foreach ($catSlugLookup as $value) {
// if (str_contains($availableColors, $value)) $lookupValue = trim($value);
// }
// //echo 'Footwear Color lookupValue '.$lookupValue.' ';
// if ($isInStock && str_contains($attributeColor, $lookupValue)) {
// //echo 'Footwear Color variation size in stock '.print_r($isInStock, true).' ';
// $inStock = true;
// break;
// }
// }
// }
// if (str_contains($selectFilter, 'clothing-size') || str_contains($selectFilter, 'clothing-color')) {
// $attributeSize = $variation['attributes']['attribute_pa_size'];
// $attributeColor = $variation['attributes']['attribute_pa_color'];
// if (str_contains($selectFilter, 'clothing-size') && str_contains($selectFilter, 'clothing-color')) {
// foreach ($catSlugLookup as $value) {
// if (str_contains($availableColors, $value)) $lookupValue = trim($value);
// }
// //echo 'Footwear Color lookupValue '.$lookupValue.' ';
// if ($isInStock && (in_array($attributeSize, $catSlugLookup) && str_contains($attributeColor, $lookupValue))) {
// //echo 'Both Clothing variation in stock '.print_r($isInStock, true).' ';
// $inStock = true;
// break;
// }
// continue;
// }
// if (str_contains($selectFilter, 'clothing-size')) {
// if ($isInStock && in_array($attributeSize, $catSlugLookup)) {
// //echo 'Clothing variation size in stock '.print_r($isInStock, true).' ';
// $inStock = true;
// break;
// }
// }
// if (str_contains($selectFilter, 'clothing-color')) {
// foreach ($catSlugLookup as $value) {
// if (str_contains($availableColors, $value)) $lookupValue = trim($value);
// }
// //echo 'Footwear Color lookupValue '.$lookupValue.' ';
// if ($isInStock && str_contains($attributeColor, $lookupValue)) {
// //echo 'Clothing variation size in stock '.print_r($isInStock, true).' ';
// $inStock = true;
// break;
// }
// }
// }
// }
// }
// //echo 'variation inStock '.print_r($inStock, true).' ';
// if ($inStock) {
// ?>
//
// //
//
HICKORY LACES 54" FLAT - The Running Well Store - Running Shoe Store in Kansas City
Product has been added to your cart