Join our new community forum for support & discussion

Join Now

Home Support General HivePress Share URL of listing

Share URL of listing

  • Author
    Posts
  • jecux

    quiero compartir la URL de los anuncios, esta seria la forma correcta o como puedo agregar el código al botón ?

    https://api.whatsapp.com/send?text=Listing_url%’

    ihor developer

    Please try using the code snippets suggested in this topic. There’s no way to add the listing URL to the display format yet, but it’s possible with a code snippet.

    jecux

    yo utilize este: pero no he podido compartir cada pagina cual fragmento de código debo agregar en la url: https://api.whatsapp.com/send?text=Listing_url%

    add_filter(
    	'hivepress/v1/models/listing/fields',
    	function( $fields, $listing ) {
    		foreach ( $fields as $name => $field ) {
    			if ( isset( $field['display_template'] ) && strpos( $field['display_template'], '%listing_url%' ) !== false ) {
    				$fields[ $name ]['display_template'] = str_replace( '%listing_url%', get_permalink( $listing->get_id() ), $field['display_template'] );
    			}
    		}
    
    		return $fields;
    	},
    	1000,
    	2
    );
    ihor developer

    Please try using this display format instead: https://api.whatsapp.com/send?text=%listing_url%

    arkanarg

    Hello, is it possible that at the moment this snippet is not working?

    ihor developer

    The snippet should work, the API wasn’t changed – please make sure that you added it via the Code Snippets plugin, then the %listing_url% token should be available in the attribute Display Format.

    videorecover

    Hi, how to change the snippet to get %listing_url% parameter and insert it on seller’s block area?

    Also, I would to grab the listing title and insert both on a whatsapp link, for example:

    https://wa.me/%wa_number%?text=please+send+me+more+info+about+this+item:+%listing_title%+%listing_url%

    Thank you very much!

    ihor developer

    Hi,
    Please try using our new community forum https://community.hivepress.io/ This one is being deprecated and we will switch it to read-only within a few days.

Viewing 8 posts - 21 through 28 (of 28 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.

Black Friday sale! Get 30% off with FRIDAY22 coupon until Tuesday, November 29.
This is default text for notification bar