Forum Replies Created

Viewing 15 replies - 1 through 15 (of 40 total)
  • Thread Starter ameraz

    (@ameraz)

    Nevermind, just found the answer.

    I just missed this new hook implemented in WooCommerce 2.6+

    // Product Single: Remove default sharing display
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );

    … to be placed within your theme functions.

    • This reply was modified 8 years ago by ameraz.
    Thread Starter ameraz

    (@ameraz)

    This was apparently a temporary error coming from ‘downloads.www.remarpro.com’.

    Thread Starter ameraz

    (@ameraz)

    The ’ was probably copy pasted, haven’t got a clue where it came from.
    You’re right I don’t have that character on my keyboard either.

    Already made sure its not there anymore.

    Thank you for your help.

    Thread Starter ameraz

    (@ameraz)

    Hey Jeremy, thanks for looking into this.

    I tried and removed the ’ as well as the ?, but keeps coming back with the same error.
    Is a french site so there will be a lot of funny characters around.

    Let me know if I can help testing in any other way.

    Cheers!

    Thread Starter ameraz

    (@ameraz)

    :$

    Awesome! Lets pretend this thread never existed.

    Thread Starter ameraz

    (@ameraz)

    Hey Jeremy, I really appreciate your help, but I think that I’m probably not explaining myself correctly. The problem is not in the form’s label but in the input placeholder.

    That being the text that appears within the input before typing anything into the field. It doesn’t have a space between the Field’s name and the required caption.

    Please see this:
    https://birchalltea.co.uk/free-sample/

    Look at the first field “First Name”, where the placeholder appears as:

    First Name(required)

    … all glued together. That’s what I’m referring to. Hope you can fix that tiny minuscule annoying detail.

    Thread Starter ameraz

    (@ameraz)

    Are you having trouble customizing the form on your site?

    Well, the problem is that there should be a space in the placeholder between the Field Name and the Required Caption where you cannot apply any styling… Apart from that I don’t have any problems with the label and the span margin, although I do think that a space its way better than having to handle such a simple thing with styling…

    Thread Starter ameraz

    (@ameraz)

    Great! I didn’t know that. That should be definitely in the docs!!

    Thread Starter ameraz

    (@ameraz)

    Thanks again for coming back.

    Well, just as the Open Graph suggests with the og:type product.group and having the resources to feed a Product Category – by that I mean having the $term‘s name, description and image, I think that providing the ability to share an Archive wether its Products or blog articles seems to be yet another interesting way of engaging with our audience.

    Although not yet in practice, with the combination of these functions I’ve managed to get my Open Graph Meta ready:

    function getUrl() {
    	$url  = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';
    	$url .= '://' . $_SERVER['SERVER_NAME'];
    	$url .= in_array( $_SERVER['SERVER_PORT'], array('80', '443') ) ? '' : ':' . $_SERVER['SERVER_PORT'];
    	$url .= $_SERVER['REQUEST_URI'];
    	return $url;
    }
    
    add_action('wp', __NAMESPACE__ . '\\pmt_remove_jetpack_og_meta');
    function pmt_remove_jetpack_og_meta() {
    	if (!is_admin()) {
    		if ( is_front_page() || is_home() || is_archive() || is_shop() || is_product_category() || (is_woocommerce() && is_tax()) ) {
    			add_filter( 'jetpack_enable_open_graph', '__return_false' );
    		}
    	}
    }
    
    add_action('wp_head', __NAMESPACE__ . '\\pmtScriptsLoaderHeader' );
    function pmtScriptsLoaderHeader() {
    	if (!is_admin()) {
    		// Set Facebook Open Graph Meta
    		$currentUrl = pmtGetUrl();
    		$fbMetaType = 'website';
    		$fbMetaTitle = get_bloginfo('name');
    		$fbMetaImg = get_template_directory_uri() . '/dist/images/Birchall-Tea.png';
    		$fbMetaDesc =  get_bloginfo('description');
    
    		if (is_front_page()) {
    			$fbMetaType = $fbMetaType;
    			$fbMetaTitle = $fbMetaTitle;
    			$fbMetaImg = $fbMetaImg;
    			$fbMetaDesc = $fbMetaDesc;
    		} elseif (is_shop()) {
    			$fbMetaType = 'product.group';
    			$fbMetaTitle = "Birchall's Tea Shop";
    			$shop = get_queried_object();
    			$thumbID = get_post_thumbnail_id($shop->ID);
    			$thumbSrc = wp_get_attachment_image_src( $thumbID, 'large');
    			$fbMetaImg = $thumbSrc[0];
    			$fbMetaDesc = $fbMetaDesc;
    		} elseif (is_product_category()) {
    			$fbMetaType = 'product.group';
    			$term = get_queried_object();
    			$tax_archive_title = get_field('tax_archive_title', $term);
    			$fbMetaTitle = $tax_archive_title;
    			$thumbID = get_woocommerce_term_meta( $term->term_id, 'thumbnail_id', true );
    			$thumbSrc = wp_get_attachment_image_src( $thumbID, 'large');
    			$fbMetaImg = $thumbSrc[0];
    			$fbMetaDesc = $term->description;
    		} elseif (is_woocommerce() && is_tax()) {
    			$fbMetaType = 'product.group';
    			$term = get_queried_object();
    			$tax_archive_title = get_field('tax_archive_title', $term);
    			$fbMetaTitle = $tax_archive_title;
    			$thumb = get_field('pa_thumb', $term);
    			$fbMetaImg = $thumb['sizes']['medium'];
    			$fbMetaDesc = $term->description;
    		} elseif (is_home()) {
    			$fbMetaType = 'website';
    			$blogPage = get_option('page_for_posts');
    			$blogPageObj = get_post($blogPage);
    			$fbMetaTitle = $blogPageObj->post_title;
    			$thumbID = get_post_thumbnail_id($blogPageObj->ID);
    			$thumbSrc = wp_get_attachment_image_src( $thumbID, 'large');
    			$fbMetaImg = $thumbSrc[0];
    			$fbMetaDesc = $blogPageObj->post_excerpt;
    		} elseif (is_archive()) {
    			$term = get_queried_object();
    			$fbMetaType = 'website';
    			$fbMetaTitle = $term->name;
    			$blogPage = get_option('page_for_posts');
    			$blogPageObj = get_post($blogPage);
    			$thumbID = get_post_thumbnail_id($blogPage->ID);
    			$thumbSrc = wp_get_attachment_image_src( $thumbID, 'large');
    			$fbMetaImg = $thumbSrc[0];
    			$fbMetaDesc = $fbMetaDesc;
    		}
    
    		if ( is_front_page() || is_shop() || is_product_category() || (is_woocommerce() && is_tax()) || is_home() || is_archive() ) { ?>
    			<!-- Facebook Open Graph Meta -->
    			<meta property="og:type" content="<?php echo $fbMetaType; ?>" />
    			<meta property="og:title" content="<?php echo $fbMetaTitle; ?>" />
    			<meta property="og:url" content="<?php echo $currentUrl; ?>" />
    			<meta property="og:description" content="<?php echo $fbMetaDesc; ?>" />
    			<meta property="og:site_name" content="<?php bloginfo('name'); ?>"/>
    			<meta property="og:image" content="<?php echo $fbMetaImg; ?>" />
    			<meta property="og:locale" content="en_GB">
    		<?php } ?>
    	}
    }

    But even with this in my Archive Page I can’t get the buttons to be printed:

    if ( function_exists( 'sharing_display' ) ) {
         sharing_display( '', true );
    }
    Thread Starter ameraz

    (@ameraz)

    Thanks for your reply Brandon, look this is my site: https://birchalltea.co.uk
    I really need this feature and although it’d be really cool if you were to include this at some point and make Jetpack flexible, what I really want to know is if there’s any way of hooking into the plugin to enable the printing of the buttons in archive pages, even if I’d have to put together my own Open Graph meta.
    Also, Im using Jetpack sharing feature for my products and the og:type is showing as article instead of product, might be worth taking a look into that.

    Cheers!

    Thread Starter ameraz

    (@ameraz)

    Hey @claudio Sanches,
    thanks for the great support.

    You’re right, my permalinks weren’t set up correctly. I’ve set them up as “Shop base with category” and it works. But when browsing a Product Attribute Archive Page, the Shop home page is not being included in the breadcrumbs.

    Perhaps core needs one last final tweak.

    Cheers bro!

    Thread Starter ameraz

    (@ameraz)

    Thank you very much for the prompt reply.

    One question though, my Breadcrumbs are missing the Shop Home link, whenever inside a Product Category, Product Attribute Archive or Product Single Page. It currently displays:

    – in the Shop home page:
    Home > Shop
    – in Product Category page:
    Home > Product Category
    – in Product Attribute page:
    Home > Product Attribute Taxonomy > Product Attribute
    – in Product Single:
    Home > Product Category > Product Title

    What is expected anywhere inside the Shop:
    Home > Shop > * > *

    Is it that I’m missing something in the config? or is it an error?

    Thread Starter ameraz

    (@ameraz)

    Brilliant, cheers!!

    Thread Starter ameraz

    (@ameraz)

    I want to be able to apply Bootstrap Grid System styles for layout and custom styling for some inputs.

    Thread Starter ameraz

    (@ameraz)

    Still not resolved.

    I do think that because of the relevance of both plugins -ACF and Jetpack- this issue shouldn’t be consider as a minor issue.

Viewing 15 replies - 1 through 15 (of 40 total)