Home Forums Themes Support Claue Change size guide image with shortcode

Tagged: 

Viewing 9 reply threads
  • Author
    Posts
    • #26967

      Hello,

      how can i change the size guide image section with an shortcode from an other size guide plugin ?

      I will not use an image. I will use an other size guide plugin at the button “size guide”.

      Best regards Pascal

    • #26970

      Hi Pascal,

      Please add below code to claue-child > functions.php

      remove_action( 'woocommerce_single_product_summary', 'jas_claue_wc_add_extra_link_after_cart', 35 );
      
      function jas_claue_child_wc_add_extra_link_after_cart() {
      	// Get page options
      	$options = get_post_meta( get_the_ID(), '_custom_wc_options', true );
      
      	// Get image to display size guide
      	$size_guide = ( isset( $options['wc-single-size-guide'] ) && $options['wc-single-size-guide'] ) ? $options['wc-single-size-guide'] : cs_get_option( 'wc-single-size-guide' );
      
      	// Get help content
      	$message = cs_get_option( 'wc-single-shipping-return' );
      
      	if ( !empty( $size_guide ) || !empty( $message ) ) {
      
      		echo '<div class="extra-link mt__25 fwsb">';
      			if ( ! empty( $size_guide ) ) {
      				echo '<a class="cd chp jas-magnific-image  mr__20" href="' . esc_url( $size_guide ) . '">' . esc_html__( 'Size Guide', 'claue' ) . '</a>';
      			}
      
      			if ( ! empty( $message ) ) {
      				echo '<a data-type="shipping-return" class="jas-wc-help cd chp" href="#">' . esc_html__( 'Delivery & Return', 'claue' ) . '</a>';
      			}
      		echo '</div>';
      	}
      }
      add_action( 'woocommerce_single_product_summary', 'jas_claue_child_wc_add_extra_link_after_cart', 35 );

      And change your code

      echo '<a class="cd chp jas-magnific-image mr__20" href="' . esc_url( $size_guide ) . '">' . esc_html__( 'Size Guide', 'claue' ) . '</a>';

      To insert your short code like Shipping & Return.

      Regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #26972

      Hi Harry,

      thanks for your fast answer.

      I have change the source code at function.php. Now i get the link in duplicate view.

      Could you help me again ?

      Best regards Pascal

       

       

      remove_action( ‘woocommerce_single_product_summary’, ‘jas_claue_wc_add_extra_link_after_cart’, 35 );

      function jas_claue_child_wc_add_extra_link_after_cart() {
      // Get page options
      $options = get_post_meta( get_the_ID(), ‘_custom_wc_options’, true );

      // Get image to display size guide
      $size_guide = ( isset( $options[‘wc-single-size-guide’] ) && $options[‘wc-single-size-guide’] ) ? $options[‘wc-single-size-guide’] : cs_get_option( ‘wc-single-size-guide’ );

      // Get help content
      $message = cs_get_option( ‘wc-single-shipping-return’ );

      if ( !empty( $size_guide ) || !empty( $message ) ) {

      echo ‘

      ‘;
      }
      }
      add_action( ‘woocommerce_single_product_summary’, ‘jas_claue_child_wc_add_extra_link_after_cart’, 35 );

       

      Attachments:
      You must be logged in to view attached files.
    • #26979

      Hi,

      Please change code to

      add_action( 'wp_footer', 'remove_old_size_guider' );
      function remove_old_size_guider() {
      remove_action( 'woocommerce_single_product_summary', 'jas_claue_wc_add_extra_link_after_cart', 35 );
      }
      function jas_claue_child_wc_add_extra_link_after_cart() {
      	// Get page options
      	$options = get_post_meta( get_the_ID(), '_custom_wc_options', true );
      
      	// Get image to display size guide
      	$size_guide = ( isset( $options['wc-single-size-guide'] ) && $options['wc-single-size-guide'] ) ? $options['wc-single-size-guide'] : cs_get_option( 'wc-single-size-guide' );
      
      	// Get help content
      	$message = cs_get_option( 'wc-single-shipping-return' );
      
      	if ( !empty( $size_guide ) || !empty( $message ) ) {
      
      		echo '<div class="extra-link mt__25 fwsb">';
      			if ( ! empty( $size_guide ) ) {
      				echo '<a class="cd chp jas-magnific-image  mr__20" href="' . esc_url( $size_guide ) . '">' . esc_html__( 'Size Guide', 'claue' ) . '</a>';
      			}
      
      			if ( ! empty( $message ) ) {
      				echo '<a data-type="shipping-return" class="jas-wc-help cd chp" href="#">' . esc_html__( 'Delivery & Return', 'claue' ) . '</a>';
      			}
      		echo '</div>';
      	}
      }
      add_action( 'woocommerce_single_product_summary', 'jas_claue_child_wc_add_extra_link_after_cart', 35 );

      Regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #26989
      This reply has been marked as private.
    • #26992

      Hi,

      Could you send me admin wp account too. and which plugin you using for size guide.

      Thanks

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #26997
      This reply has been marked as private.
    • #27006

      Hi,

      I tried WordPress admin account but can’t access your site. Could you check it and send me again.

      Thanks

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

    • #27020
      This reply has been marked as private.
    • #27026

      Hi,

      I updated code it now work on your site.

      add_action( 'wp_head', 'remove_old_size_guider' );
      function remove_old_size_guider() {
      	remove_action( 'woocommerce_single_product_summary', 'jas_claue_wc_add_extra_link_after_cart', 35 );
      }
      function jas_claue_child_wc_add_extra_link_after_cart() {
      	// Get page options
      	$options = get_post_meta( get_the_ID(), '_custom_wc_options', true );
      
      	// Get help content
      	$message = cs_get_option( 'wc-single-shipping-return' );
      	
      	echo '<div class="extra-link mt__25 fwsb">';
      	//echo '<a class="cd chp jas-magnific-image  mr__20" href="#">' . esc_html__( 'Size Guide', 'claue' ) . '</a>';
      	echo do_shortcode('[ct_size_guide]');
      	
      	if ( ! empty( $message ) ) {
      		echo '<a data-type="shipping-return" class="jas-wc-help cd chp" href="#">' . esc_html__( 'Delivery & Return', 'claue' ) . '</a>';
      	}
      	echo '</div>';
      }
      add_action( 'woocommerce_single_product_summary', 'jas_claue_child_wc_add_extra_link_after_cart', 35 );

      Regards

      Harry
      Premium Wordpress themes and plugins, Best WooCommerce theme https://themeforest.net/user/janstudio/portfolio?ref=janstudio

Viewing 9 reply threads

You must be logged in to reply to this topic.