• Resolved reactionfun

    (@reactionfun)


    Hi everbody,

    to create a new div (with the class .custom-div-single-product-add)
    around the “cart form” in single product pages,
    i added the following code
    in the functions.php of the bridge-child:

    add_action( ‘woocommerce_before_add_to_cart_form’, ‘add_custom_content_for_specific_product2’, 25 );
    function add_custom_content_for_specific_product2() {

    // The content start below (with translatables texts)
    ?>
    <div class=”custom-div-single-product-add”>
    <!– <p><?php _e(“o”, “woocommerce”); ?></p>
    </div> –>
    <?php
    // End of content
    }
    add_action( ‘woocommerce_after_add_to_cart_form’, ‘add_custom_content_for_specific_product’, 25 );
    function add_custom_content_for_specific_product() {
    global $product;

    // The content start below (with translatables texts)
    ?>
    <!– <div class=”custom-content product-id-<?php echo $product->get_id(); ?>”>
    <p><?php _e(“c”, “woocommerce”); ?></p> –>
    </div>
    <?php
    // End of content
    }

    now there is a problem in line 16 (‘add_custom_content_for_specific_product’, 25 );).
    could it be that it is the number 25, because its doubled at the moment?!

    thanks in advance
    mazze

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    Hi there ??

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Cheers

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We’ve not seen any activity on this thread for a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding a new div in the functions.php of the bridge-child’ is closed to new replies.