Support

Account

Forum Replies Created

  • Hi Elliot,

    I took another look at the default value set up. It works perfectly without touching the acf when you add a new product and I only had a few products set up so I just had to update those few. Thanks for all your help!

  • Hi Elliot,

    Apologies! I don’t have any php knowledge. I was trying to follow some examples I found online, but obviously got it all wrong.
    I’ll take a look at the documentation now.
    Thanks for all your help!

    Is this the code you speak of to render acf data:
    <div id="requestsample"><?php the_field('request_sample'); ?></div>

  • This is the code that I need to load
    <div id="requestsample"><a class="fancybox button" href="#contact_form_pop">Request a Sample</a><div class="fancybox-hidden" style="display: none;"><div class="hentry" id="contact_form_pop" style="width: 600px; height: 500px; overflow-x: hidden"><?php echo do_shortcode( '[contact-form-7 id="269" title="Request Sample"]' ); ?></div></div></div>

    There’s also a shortcode from another plugin in there… will that affect things?

    I’ve also tried using things like:

    <?php if ( is_product_category() ) {
    if ( is_product_category( 'coving' ) ) {
    echo '<div id="requestsample"><a class="fancybox button" href="#contact_form_pop">Request a Sample</a><div class="fancybox-hidden" style="display: none;"><div class="hentry" id="contact_form_pop" style="width: 600px; height: 500px; overflow-x: hidden"><?php echo do_shortcode( '[contact-form-7 id="269" title="Request Sample"]' ); ?></div></div></div>';
    } elseif ( is_product_category( 'skirting-boards' ) ) {
    echo '<div id="requestsample"><a class="fancybox button" href="#contact_form_pop">Request a Sample</a><div class="fancybox-hidden" style="display: none;"><div class="hentry" id="contact_form_pop" style="width: 600px; height: 500px; overflow-x: hidden"><?php echo do_shortcode( '[contact-form-7 id="269" title="Request Sample"]' ); ?></div></div></div>';
    } elseif ( is_product_category( 'dado-rails' ) ) {
    echo '<div id="requestsample"><a class="fancybox button" href="#contact_form_pop">Request a Sample</a><div class="fancybox-hidden" style="display: none;"><div class="hentry" id="contact_form_pop" style="width: 600px; height: 500px; overflow-x: hidden"><?php echo do_shortcode( '[contact-form-7 id="269" title="Request Sample"]' ); ?></div></div></div>';
    } elseif ( is_product_category( 'indirect-lighting-by-orac' ) ) {
    echo '<div id="requestsample"><a class="fancybox button" href="#contact_form_pop">Request a Sample</a><div class="fancybox-hidden" style="display: none;"><div class="hentry" id="contact_form_pop" style="width: 600px; height: 500px; overflow-x: hidden"><?php echo do_shortcode( '[contact-form-7 id="269" title="Request Sample"]' ); ?></div></div></div>';
    } else {
    echo ' ';
    }
    
    }?>

    But it doesn’t work 🙁
    I don’t have any other code to load the acf… I’ve just set everything up within the plugin. Thanks for all your help!

  • Hi Elliot,

    Thanks for your reply!
    Would this be possible to do manually? I’ve been trying to get this to work for so long now, and thought I’d cracked it using the acf plugin.

    Basically I need to show a piece of code on certain woocommerce category pages, but I can’t use the conditional statement is_product_cat within the single product page template.

    If you could advise me on the manual code I would need to add, in order to show a custom field, maybe I could rework it so that it resolves my issue?

    Any help would be greatly appreciated!

Viewing 4 posts - 1 through 4 (of 4 total)