Woocommerce Add to Cart function

You cannot integrate affiliate products into your site’s shopping cart by simply injecting an iframe into your html page. In woocommerce, when you add a product to the cart you pass a product id. The cart function then looks for the product details in your store’s product database. Since you have not imported your affiliate’s … Read more

The plugin generated xxx characters of unexpected output during activation

Anything outside the <?php ?> tags will be echoed as output since it has no conditions. The fastest way is to wrap in a function and output in the footer. add_action(‘wp_footer’,’custom_random_script’); function custom_random_script() { echo ‘<script> ……SCRIPT CONTENTS…… </script>’; } There is nothing technically wrong with outputting the script inside your existing function either, it … Read more

How to show detailed order history on woocommerce product page [closed]

The issue is that you’re showing the info for the order and not the item. You want to print the content based on the item instead, like this: echo ‘<h2>Previous Donations for this Nonprofit</h2>’; foreach (get_posts(‘post_type=shop_order&numberposts=-1&post_status=wc-completed’) as $order) { $order = new WC_Order($order->ID); foreach($order->get_items(‘line_item’) as $item) { if ($post->ID == $item[‘product_id’] || $post->ID == $item[‘variation_id’]) … Read more

is_plugin_active() not defined on active plugin, in the thumbnails.php file

You can try this, it works for me 🙂 // We need plugin.php! require_once( ABSPATH . ‘wp-admin/includes/plugin.php’ ); $plugins = get_plugins(); foreach ($plugins as $key => $value) { if ( $value[‘Name’] == ‘Aest Plugins’ ) { // <– name plugin validate if( is_plugin_active( $key ) ){ echo “plugin {$value[‘Name’]} is active”; }else{ echo “plugin {$value[‘Name’]} … Read more