Christopher Mitchell
Forum Replies Created
-
Forum: Plugins
In reply to: [Property Hive] Mapping Lettings and SalesActually, those look like they were withdrawn from within the Jupix system. So I will have to work out a way to change over the text to say Withdrawn instead. Or is there a way to hide withdrawn properties from the system?
Forum: Plugins
In reply to: [Property Hive] Mapping Lettings and SalesAwesome.. I have changed those over and have re done the import.
I’m still getting some errors though it seems the “For Sale” one doesn’t want to replace to the “To Let”
I updated the code to be this:
add_action( "propertyhive_property_imported_jupix_xml", "correct_property_availability", 10, 2 ); function correct_property_availability($post_id, $property) { if ( (string)$property->department == 'Lettings' ) { // It's a lettings property wp_suspend_cache_invalidation( false ); wp_defer_term_counting( false ); wp_defer_comment_counting( false ); if ( (string)$property->availability == '2' || (string)$property->availability == '1' ) // To Let { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 155, 'availability' ); // CHANGE 6 TO BE YOUR 'TO LET' TERM ID } if ( (string)$property->availability == '3' || (string)$property->availability == '4' ) // References Pending / Let Agreed { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 157, 'availability' ); // CHANGE 7 TO BE YOUR 'LET AGREED' TERM ID } if ( (string)$property->availability == '5' ) // Let { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 159, 'availability' ); // CHANGE 8 TO BE YOUR 'LET' TERM ID } wp_suspend_cache_invalidation( true ); wp_defer_term_counting( true ); wp_defer_comment_counting( true ); } }
Forum: Plugins
In reply to: [Property Hive] Mapping Lettings and SalesThere is an import already set to call from Jupix. IF you edit it you will see the settings that were set before I looked at this. And then you will be able to see the extra bits for the To Let etc.
Forum: Plugins
In reply to: [Property Hive] Mapping Lettings and SalesHave set you up with a user. It should’ve sent through an email for you to reset your password etc.
Forum: Plugins
In reply to: [Property Hive] Mapping Lettings and SalesHi Steve, I have run the import again and this is the result:
Lettings: https://jamesonpartners.co.uk/property-search/?department=residential-lettings&minimum_price=&maximum_price=&minimum_rent=&maximum_rent=&minimum_bedrooms=&property_type=&minimum_floor_area=&maximum_floor_area=&commercial_property_type=
Sales: https://jamesonpartners.co.uk/property-search/?department=residential-sales&minimum_price=&maximum_price=&minimum_rent=&maximum_rent=&minimum_bedrooms=&property_type=&minimum_floor_area=&maximum_floor_area=&commercial_property_type=Its fine on Sales but not happy on Lettings.
I will set you up with a user now so you can take a quick look at the import function from Jupix.
Thanks Steve
Forum: Plugins
In reply to: [Property Hive] Mapping Lettings and SalesHi Steve,
I’ve updated the code to use the next one in the list instead (number 8)add_action( "propertyhive_property_imported_jupix_xml", "correct_property_availability", 10, 2 ); function correct_property_availability($post_id, $property) { if ( (string)$property->department == 'Lettings' ) { // It's a lettings property wp_suspend_cache_invalidation( false ); wp_defer_term_counting( false ); wp_defer_comment_counting( false ); if ( (string)$property->availability == '2' ) // To Let { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 8, 'availability' ); // CHANGE 6 TO BE YOUR 'TO LET' TERM ID } if ( (string)$property->availability == '3' || (string)$property->availability == '4' ) // References Pending / Let Agreed { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 6, 'availability' ); // CHANGE 7 TO BE YOUR 'LET AGREED' TERM ID } if ( (string)$property->availability == '5' ) // Let { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 7, 'availability' ); // CHANGE 8 TO BE YOUR 'LET' TERM ID } wp_suspend_cache_invalidation( true ); wp_defer_term_counting( true ); wp_defer_comment_counting( true ); } }
But its still not working ?? any ideas why?
Chris
Oddly it fixed itself.. not sure how or why though. So please mark as resolved
Hi Predrag,
We are running PHP version 7.
Many Thanks
Chris
Forum: Plugins
In reply to: [LinkedIn Company Updates] Linkedin ID not workingFrustratingly I managed to get it working just as soon as I posted the question.. which is annoying ?? sorry
Forum: Plugins
In reply to: [CM Tooltip Glossary] Plugin Hacked?Not a problem, thats what I thought.. I was just asked to double check ??
Forum: Plugins
In reply to: [WP Ultimate Search] Top level categories onlyThe results aren’t the problem, its the actual search bar. Its when you do the drop down for categories. Ideally I only want to display the top level categories in the category drop down.
That worked great!
Now is there any way to specify past events with a class so I can target it with some CSS?
Forum: Plugins
In reply to: [YITH WooCommerce Waitlist] Waiting list button not appearingUnfortunately, i’ve not removed that bit of code at all…
This is the content-single-product.php I compiled all the bits of the single product to be able to control some of the various aspects and to force it into columns etc. The client would just love to have this Waiting List plugin as part of the system.
That was the reason why I was wondering if there was a shortcode (like the wishlist plugin, which is awesome btw) so that I could just add it to the template below where I needed it..
Here is the code i’m using:
<?php /** * The template for displaying product content in the single-product.php template * * Override this template by copying it to yourtheme/woocommerce/content-single-product.php * * @author WooThemes * @package WooCommerce/Templates * @version 1.6.4 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } global $post, $woocommerce, $product; $heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) ); if ( ! $product->is_purchasable() ) { return; } $cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) ); $tag_count = sizeof( get_the_terms( $post->ID, 'product_tag' ) ); $rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) ); ?> <?php /** * woocommerce_before_single_product hook * * @hooked wc_print_notices - 10 */ do_action( 'woocommerce_before_single_product' ); if ( post_password_required() ) { echo get_the_password_form(); return; } ?> <div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?>" id="product-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="images gameimage"> <?php if ( has_post_thumbnail() ) { $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) ); $image_caption = get_post( get_post_thumbnail_id() )->post_excerpt; $image_link = wp_get_attachment_url( get_post_thumbnail_id() ); $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array( 'title' => $image_title, 'alt' => $image_title ) ); $attachment_count = count( $product->get_gallery_attachment_ids() ); if ( $attachment_count > 0 ) { $gallery = '[product-gallery]'; } else { $gallery = ''; } echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" data-rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_caption, $image ), $post->ID ); } else { echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="%s" />', wc_placeholder_img_src(), __( 'Placeholder', 'woocommerce' ) ), $post->ID ); } ?> <?php do_action( 'woocommerce_product_thumbnails' ); ?> </div> <div class="summary entry-summary description"> <h1 itemprop="name" class="product_title entry-title"><?php the_title(); ?></h1> <?php the_content(); ?> </div><!-- .summary --> <div class="column3 productwidth"> <div itemprop="offers" itemscope itemtype="https://schema.org/Offer"> <div class="containerforprice"> <div style="display:inline-block;width:30%;float:left;margin-top:15px;" class="outofstockprice"><p class="price"><?php echo $product->get_price_html(); ?></p><meta itemprop="price" content="<?php echo $product->get_price(); ?>" /> </div> <div style="display:inline-block;width:68%;"> <?php if ( $product->is_in_stock() ) : ?> <?php do_action( 'woocommerce_before_add_to_cart_form' ); ?> <form class="cart" method="post" enctype='multipart/form-data'> <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?> <?php if ( ! $product->is_sold_individually() ) woocommerce_quantity_input( array( 'min_value' => apply_filters( 'woocommerce_quantity_input_min', 1, $product ), 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->backorders_allowed() ? '' : $product->get_stock_quantity(), $product ) ) ); ?> <input type="hidden" name="add-to-cart" value="<?php echo esc_attr( $product->id ); ?>" /> <button type="submit" class="single_add_to_cart_button button alt"><?php echo $product->single_add_to_cart_text(); ?></button> <?php do_action( 'woocommerce_after_add_to_cart_button' ); ?> </form> <?php do_action( 'woocommerce_after_add_to_cart_form' ); ?> <?php endif; ?> </div> </div> <meta itemprop="priceCurrency" content="<?php echo get_woocommerce_currency(); ?>" /> <link itemprop="availability" href="https://schema.org/<?php echo $product->is_in_stock() ? 'InStock' : 'OutOfStock'; ?>" /> </div> <div class="greybar"><span class="greybartitle">Availability</span><?php // Availability $availability = $product->get_availability(); $availability_html = empty( $availability['availability'] ) ? '' : '<p class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability['availability'] ) . '</p>'; echo apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $product ); ?> </div> <div class="greybar"><span class="greybartitle">Designer</span><p><?php the_field('designer'); ?></p></div> <div class="greybar"><span class="greybartitle">Publisher</span> <ul class="categorylist"><?php $taxonomy = 'product_cat'; // get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); // separator between links $separator = ', '; if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { $term_ids = implode( ',' , $post_terms ); $terms = wp_list_categories( 'title_li=&child_of=52&taxonomy=' . $taxonomy . '&include=' . $term_ids ); $terms = rtrim( trim( str_replace( '<br />', $separator, $terms ) ), $separator ); // display post categories echo $terms; } ?></ul></div> <div class="greybar"><span class="greybartitle">Genre</span> <ul class="categorylist"><?php $taxonomy = 'product_cat'; // get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); // separator between links $separator = ', '; if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { $term_ids = implode( ',' , $post_terms ); $terms = wp_list_categories( 'title_li=&child_of=40&taxonomy=' . $taxonomy . '&include=' . $term_ids ); $terms = rtrim( trim( str_replace( '<br />', $separator, $terms ) ), $separator ); // display post categories echo $terms; } ?></ul></div> <div class="greybar"><span class="greybartitle">Published</span> <ul class="categorylist"><?php $taxonomy = 'product_cat'; // get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); // separator between links $separator = ', '; if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { $term_ids = implode( ',' , $post_terms ); $terms = wp_list_categories( 'title_li=&child_of=63&taxonomy=' . $taxonomy . '&include=' . $term_ids ); $terms = rtrim( trim( str_replace( '<br />', $separator, $terms ) ), $separator ); // display post categories echo $terms; } ?></ul></div> <div class="greybar"><span class="greybartitle">Expansions</span> <?php if( get_field('has_extensions') ) { ?> <?php $post_object = get_field('expansions'); if($post_object) : $post = $post_object; // Overwrite $post setup_postdata( $post ); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php // Reset $post so the rest of the page works wp_reset_postdata(); endif; ?> <?php } else { ?> <p>None</p> <?php } ?></div> <div class="greybar"><span class="greybartitle">Cafe Location</span><p><?php the_field('cafe_location'); ?></p></div> <div class="containerforplayers"> <div class="players"><img src="https://83.167.180.132/~meeple/wp-content/uploads/2015/05/players.png"><?php the_field('number_of_players'); ?></div> <div class="age"><img src="https://83.167.180.132/~meeple/wp-content/uploads/2015/05/age.png"><?php the_field('age_from'); ?></div> <div class="time"><img src="https://83.167.180.132/~meeple/wp-content/uploads/2015/05/clock.png"><?php the_field('duration'); ?></div> </div> <div class="product_meta"> <?php do_action( 'woocommerce_product_meta_start' ); ?> <?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?> <div class="greybar" style="display:none;"><span class="greybartitle sku_wrapper"><?php _e( 'SKU', 'woocommerce' ); ?></span> <p><span class="sku" itemprop="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : __( 'N/A', 'woocommerce' ); ?></span></p></div> <?php endif; ?> <div class="greybar" style="display:none;"><span class="greybartitle sku_wrapper">Categories</span><p><?php echo $product->get_categories( ', ', '<span class="posted_in">' . _n( '', '', $cat_count, 'woocommerce' ) . ' ', '.</span>' ); ?></p></div> <?php echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' ); ?> <?php do_action( 'woocommerce_product_meta_end' ); ?> </div> <?php echo do_shortcode('[yith_wcwl_add_to_wishlist]'); ?> </div> <br/> <br/> <?php /** * woocommerce_after_single_product_summary hook * * @hooked woocommerce_output_product_data_tabs - 10 * @hooked woocommerce_upsell_display - 15 * @hooked woocommerce_output_related_products - 20 */ do_action( 'woocommerce_after_single_product_summary' ); ?> <meta itemprop="url" content="<?php the_permalink(); ?>" /> </div><!-- #product-<?php the_ID(); ?> --> <?php do_action( 'woocommerce_after_single_product' ); ?>
Any ideas?
Forum: Plugins
In reply to: [YITH WooCommerce Waitlist] Waiting list button not appearingi’m running 2.3.8 and I have one out of stock product here:
https://83.167.180.132/~meeple/product/the-3-commandments/
I have tested the twenty thirteen theme myself and it displays.. is there something i’ve missed?
I can see that the js file is being called in the header, but nothing else.
Is there a specific area of the woocommerce template where this appears? I might have removed that by accident while making my custom template.
Forum: Plugins
In reply to: [Favorites] Style favourites listCould the problem be that i’m running W3 total cache? As it doesn’t even work when the user is not logged in.
The user can click the add to favourites button and it will go, but it doesn’t add to the favourites section. If you reload that page it just goes back to being unselected again.
Also when the user isn’t logged in the Favourites page displays a load of posts instead of the ones that are favourited.
Is the URL.
I’m hoping that you can help me figure this last bit out.