I have the following code in my functions.php file, this allowed me to display images in My Account section, for the orders placed. A customer purchase an item than later I deleted (the whole product), and now the customer has an error message.
//Discplay image in order my account
// Display the product thumbnail in order view pages
add_filter( 'woocommerce_order_item_name', 'display_product_image_in_order_item', 20, 3 );
function display_product_image_in_order_item( $item_name, $item, $is_visible ) {
// Targeting view order pages only
if( is_wc_endpoint_url( 'view-order' ) ) {
$product = $item->get_product(); // Get the WC_Product object (from order item)
$product_image = $product->get_image(array( 36, 36)); // Get the product thumbnail (from product object)
$item_name = '<div class="item-thumbnail">' . $product_image . '</div>' . $item_name;
}
return $item_name;
}
//Discplay products column my account orders
add_filter( 'woocommerce_my_account_my_orders_columns', 'filter_woocommerce_my_account_my_orders_columns', 10, 1 );
function filter_woocommerce_my_account_my_orders_columns( $columns ) {
$new_column = array( 'order-number' => $columns['order-number']);
unset($columns['order-number']);
$new_column['order-thumbnails'] = '';
return array_merge($new_column, $columns);
}
add_action( 'woocommerce_my_account_my_orders_column_order-thumbnails', 'filter_woocommerce_my_account_my_orders_column_order', 10, 1 );
function filter_woocommerce_my_account_my_orders_column_order( $order ) {
// Loop through order items
foreach( $order->get_items() as $item ) {
$product = $item->get_product(); // Get the WC_Product object (from order item)
$thumbnail = $product->get_image(array( 36, 36)); // Get the product thumbnail (from product object)
if( $product->get_image_id() > 0 ) {
echo $thumbnail . ' ' ;
}
}
}
I cant restore the product anymore so I created a new one same SKU, name atrributes and I put the images in the folder /public_html/kidsandladiessv.com/wp-content/uploads/2022/05 as that is the location where the first product was refering to. This helped me to at least see the images in the email I sent to the customer, but in My account the customer is still seeing the error.
Fatal error: Uncaught Error: Call to a member function get_image() on bool in /home2/kidsandl/public_html/kidsandladiessv.com/wp-content/themes/astra-child/functions.php:91 Stack trace: #0 /home2/kidsandl/public_html/kidsandladiessv.com/wp-includes/class-wp-hook.php(307): filter_woocommerce_my_account_my_orders_column_order(Object(Automattic\WooCommerce\Admin\Overrides\Order)) #1 /home2/kidsandl/public_html/kidsandladiessv.com/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array) #2 /home2/kidsandl/public_html/kidsandladiessv.com/wp-includes/plugin.php(476): WP_Hook->do_action(Array) #3 /home2/kidsandl/public_html/kidsandladiessv.com/wp-content/plugins/woocommerce/templates/myaccount/orders.php(45): do_action('woocommerce_my_...', Object(Automattic\WooCommerce\Admin\Overrides\Order)) #4 /home2/kidsandl/public_html/kidsandladiessv.com/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home2/kidsandl...') #5 /home2/kidsandl/public_html/kidsandladiessv.com/wp-content/plugins/woocomm in /home2/kidsandl/public_html/kidsandladiessv.com/wp-content/themes/astra-child/functions.php on line 91
I dont have much technical kwnoledge but I am afraid this is not a simple reference issue, any idea if this is something I can fix?
So far only solution I found is to remove the code to add the images, but the issue is with just one customer for the deleted product
I’ve updated my YouTube settings to fit the new API 3 YouTube coding. After getting my page to link with me personal YouTube channel – I notice that some of the videos that it shows do not have the thumbnail for that video showing. Instead, I just see a grey screen with a play button on it (the standard default YouTube thumbnail I guess). If I click that video – it works fine and the video plays – but users cannot see the thumbnail which does appear correctly on YouTube.
However, other videos do indeed show their thumbnails. It seems selective. Makes no sense. Have I done something wrong? Can you help me to get to show all the thumbnails for all my videos?
Thanks!
]]>I’m currently using a different plugin for product images slider but I would like to switch to yours and use yours instead but we do need the magnify on hover.
The link goes to what we have currently (just not this plugin)
So
Is it possible to have magnify on hover while still retaining the lightbox?
Thanks so much
]]>First of all thanks for this useful plugin.
I’ve got an issue with the thumbnails size in the grid.
I select the size I’ve added through function but the thumbnail called is “full”.
So I tried to select the WordPress native sizes like “Thumbnails”, it’s working.
I also tried to select medium, it almost works: even if I change the size 300×300 to anything else, your plugin resize the image at 300.
Am using the theme TOTAL by WPExplorer if it can help.
Thank you for your support.
]]>Is it possible to do that?
If you have one thumbnail(one image/featured image), in other words not a gallery , can we hide the thumbnail and show if it’s more than 1(a gallery)
]]>If you have one thumbnail(one image/featured image), in other words not a gallery , can we hide the thumbnail and show if it’s more than 1(a gallery)
]]>The quality of my thumbails is very poor.
They are very pixelazed.
However, when I click on them I can see the pictures in a very good quality.
How can I change the quality of the thumbnails ?
Thanks !
PS : I am using the free version of Robo Galery.
PS2 : I’m french, so I apologize for my poor english level.
]]>Any idea why this might be happening?
Thanks a lot!
My goal is to have thumbnail of the featured image load along with the search results on my current wordpress installation.
Just need help to execute this properly. So that the thumbnails for each search result show with the title and excerpts. I have a child theme installed.
Here is the current search.php file. There should be something like just one line “class=” item to to bring up the thumbnails, correct?
<?php
/**
* The template for displaying Search Results pages
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<section id="primary" class="site-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentytwelve' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header>
<?php twentytwelve_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php twentytwelve_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentytwelve' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
]]>I want to know, how do I have different thumbails for facebook and twitter? Because if you share the content in facebook (at the end of every page), the thumbail looks good. But if you send it as a facebook message of tweet it, you will see that the thumbail doesn’t fit well…
My site is www.almaraices.com.ve
Thank you for your attention.
]]>