Ryan Stutzman
Forum Replies Created
-
Forum: Reviews
In reply to: [WordPress Beta Tester] horrible do not downloadYou really should change your review, IMO. This plugin is clearly for testing unstable beta versions and warns you multiple times not to use it on a production site. Why it the world would you install a plugin called “WordPress Beta Tester” and then get upset when it installs a beta version?
Forum: Fixing WordPress
In reply to: get_post_meta Returns an Empty Array inside a FunctionTurns out I was declaring my variables out of scope.
Forum: Plugins
In reply to: [Menu Item Visibility Control] better walker and filteringForum: Plugins
In reply to: [Menu Item Visibility Control] WordPress 4.3Ah, never mind. It’s not listed under screen options. I’m on the latest version of both WP and the plugin. Could it be conflicting with another plugin?
Forum: Plugins
In reply to: [Menu Item Visibility Control] WordPress 4.3@bjuniper, Make sure it’s enabled under “Screen Options.”
Forum: Plugins
In reply to: [Menu Item Visibility Control] Use with other variables?For anyone who is interested, I got it to work by registering a custom taxonomy…
add_action( 'init', 'create_country_tax' ); function create_country_tax() { $userInfo = geoip_detect2_get_info_from_current_ip(); $country = $userInfo->country->isoCode; register_taxonomy($country,'country'); }
and then calling
taxonomy_exists('US')
in the visibility field.Forum: Plugins
In reply to: [Menu Item Visibility Control] WordPress 4.3Thanks Peter! I got it to work by registering a custom taxonomy…
add_action( 'init', 'create_country_tax' ); function create_country_tax() { $userInfo = geoip_detect2_get_info_from_current_ip(); $country = $userInfo->country->isoCode; register_taxonomy($country,'country'); }
and then calling
taxonomy_exists('US')
in the visibility field.Forum: Plugins
In reply to: [Menu Item Visibility Control] WordPress 4.3I’m trying to get it to work with the GeoIP plugin.
Unfortunately if I enter a country code like
in_array('TH', $userInfo->country->isoCode)
or$userInfo->country->isoCode == 'TH'
it does nothing even though the variable is working elsewhere on my site.Forum: Plugins
In reply to: [Menu Item Visibility Control] Use with other variables?I tried
in_array('TH', $userInfo->country->isoCode)
but it’s not working. It’s working fine elsewhere on my site. Any ideas?Here’s how I fixed it.
line 45 of
inc\woocommerce\template-tags-categories.php
in the theme directory reads:$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button ajax_add_to_cart' : '',
I changed it to:
$product->is_purchasable() && $product->is_in_stock() && $product->is_type( 'simple' ) ? 'add_to_cart_button ajax_add_to_cart' : '',
Forum: Plugins
In reply to: [Better Search Replace] Modifying Image Type?Never mind. It worked. ??
Forum: Plugins
In reply to: [Search & Replace] Changing Image ExtentionsNever mind. It worked! Excellent plugin!!
Forum: Plugins
In reply to: [WooCommerce] Variation Images Slow to LoadAh, ok. Thanks.
Ok, problem solved. Thanks for your help.
Changed
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button ajax_add_to_cart' : '',
to
$product->is_purchasable() && $product->is_in_stock() && $product->is_type( 'simple' ) ? 'add_to_cart_button ajax_add_to_cart' : '',
The problem was with the theme (Flatsome).
I don’t know if it’s the theme adding it or not. I wrote the theme author a couple days ago but haven’t gotten a response.
Here’s what I found digging around in the theme files…
wp-content\themes\flatsome\inc\woocommerce\template-tags-categories.php:
// Show Add To Cart Button in Grid if($flatsome_opt['add_to_cart_icon'] == "button") { function flatsome_add_button_in_grid (){ global $product; echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf( '<div class="add-to-cart-button"><a href="%s" rel="nofollow" data-product_id="%s" class="%s product_type_%s button alt-button small clearfix">%s</a></div>', esc_url( $product->add_to_cart_url() ), esc_attr( $product->id ), $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button ajax_add_to_cart' : '', esc_attr( $product->product_type ), esc_html( $product->add_to_cart_text() ) ), $product ); } add_action('woocommerce_after_shop_loop_item_title', 'flatsome_add_button_in_grid', 30); }
and…
wp-content\themes\flatsome\woocommerce\content-product.php:
<?php if($flatsome_opt['add_to_cart_icon'] == "show") { echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s add-to-cart-grid clearfix"> <div class="cart-icon tip-top" title="%s"> <strong> <span class="icon-inner"></span></strong><span class="cart-icon-handle"></span></div></a>', esc_url( $product->add_to_cart_url() ), esc_attr( isset( $quantity ) ? $quantity : 1 ), esc_attr( $product->id ), esc_attr( $product->get_sku() ), esc_attr( isset( $class ) ? $class : 'add_to_cart_button ajax_add_to_cart' ), esc_html( $product->add_to_cart_text() ) ), $product ); ?>