Home › Forums › Themes Support › Claue › Change size guide image with shortcode
Tagged: size guide
- This topic has 9 replies, 2 voices, and was last updated 6 years ago by Harry.
-
AuthorPosts
-
-
November 22, 2018 at 9:08 pm #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
-
November 22, 2018 at 10:21 pm #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 -
November 23, 2018 at 12:03 am #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 ‘
‘;
if ( ! empty( $size_guide ) ) {
echo do_shortcode(‘[ct_size_guide]’);
}if ( ! empty( $message ) ) {
echo ‘‘ . esc_html__( ‘Delivery & Return’, ‘claue’ ) . ‘‘;
}
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. -
November 23, 2018 at 9:42 am #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 -
November 24, 2018 at 3:40 am #26989This reply has been marked as private.
-
November 24, 2018 at 12:31 pm #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 -
November 25, 2018 at 2:14 am #26997This reply has been marked as private.
-
November 25, 2018 at 7:39 am #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 -
November 26, 2018 at 4:05 am #27020This reply has been marked as private.
-
November 26, 2018 at 8:50 am #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
-
-
AuthorPosts
You must be logged in to reply to this topic.