Feature request: Let the Add to Cart button have tel: link type
-
Hi there,
Thank you for the great plugin! I just noticed that I am unable to use a link with the type “tel:” as the Add to Cart link. It always adds the http prefix and wraps it up in “window.click” function. I needed to modify the elex-woocommerce-catalog-mode/includes/elex-catalog-mode-admin.php, function
elex_cm_redirect_addtocart_product_page
to be able to let the link works on my product page.Perhaps an ideal would be to add the feature to use other types of hyperlinks, however, an easy solution is to change the following line:
<button id="elex_prod_btn" class="btn btn-success" style="margin-top: 10px;height: 40px;padding: 0 20px;text-wrap: nowrap" onclick=" window.open('<?php echo esc_html( $suff ) . esc_html( $url_product_page ); ?>','_self')"><?php echo esc_html( $button_text_product_page ); ?></button>
to:
<button id="elex_prod_btn" class="btn btn-success" style="margin-top: 10px;height: 40px;padding: 0 20px;text-wrap: nowrap" href="<?php echo esc_html( $url_product_page ); ?>"><?php echo esc_html( $button_text_product_page ); ?></button>
The same for the shop page too:
elex_cm_replace_add_cart_text_shop_with_url
Thank you very much for your great work.
- You must be logged in to reply to this topic.