• Resolved srozenbaum

    (@srozenbaum)


    Hello,

    Looking to see if it is possible to imbed a link into an option description on a product page?

    For example, one add-on option on a specific product page is actually a product that you can purchase separately on our website as well (only more expensive if purchased separately). We have many people asking “is this product the same as you sell separately?”

    I want the customer to be able to actually click on the option description (and be able to link an URL) so the customer can see what this option actually is before they check the checkbox button.

    Is there a way to do so?

    Thank you

    • This topic was modified 4 years, 6 months ago by srozenbaum.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    You can use HTML input in PPOM pro.

    Thread Starter srozenbaum

    (@srozenbaum)

    Is that the option described below on your website?

    19- HTML Content
    It’s not an input, just to add some contents/text or HTML.

    What would be the customer HTML or code I would need to enter into the HTML field to add a link?

    If this will work and you can explain, I am interested in purchasing the PRO version.

    Thank you.

    Yes, it is not an input, admin will have to provide HTML in this and yes link can also be added.

    The PPOM Pro plugin does offer some added convenience but it is an awfully long route to take just to insert some custom HTML. Why not just use JavaScript and add an anchor tag around the description text with an anchor tag?

    
    add_action('wp_footer',function(){ ?>
    <script type="text/javascript">
    $ = jQuery.noConflict();
    $('.ppom-input-data_name > label[for="data_name"]').html(
    	'<a href="//yoursite/shop/product-name/">'+$('.ppom-input-data_name > label[for="data_name"]').html()+
    	'</a><br><small>This option is also sold as a separate product on our website.<br>Click the link above to view the individual product.</small>'
    );</script><?php });
    

    Replace all four (4) instances of data_name with the actual data name of the add-on you are trying to link. Replace //yoursite/shop/product-name/ with the link to the product page you want them to click through to.

    Add the code above to the wp-content/themes/yourtheme/functions.php file.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding a link to option description’ is closed to new replies.