WooCommerce – doesn’t show product when using woocommerce.php [closed]

I found the answer – might be obscure, but still might help someone: Apparently the custom navigation template messed up / overwrote the “$posts” array, so I just saved the original, and restored it after including the navigation: <?php $saved_posts = $posts; get_template_part(‘tpl-nav’); $posts = $saved_posts; ?> Just added to to the top of the … Read more

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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)