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
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
]]>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!
]]>