Tagged: x
-
AuthorPosts
-
September 16, 2016 at 7:45 am #1178117
kiovicParticipantI’ve searched and found the answer to this topic before but for some reason my child theme breaks and results in a fatal error if I try to put in the functions.php code for product picture sizes on Woocommerce settings. Some topics I am referring too:
https://community.theme.co/forums/topic/woocommerce-product-sizes-in-x-theme/
https://community.theme.co/forums/topic/woocommerce-product-image-sizes-missing/
I have tried these solutions (installed child theme and paste code in functions.php) but result in a functions.php error that forces me to contact support.
Thank you for your consideration and hope to hear from you soon, I will post private login credentials for reference.
P.S You guys have a great product and service!
September 16, 2016 at 7:46 am #1178123
kiovicParticipantThis reply has been marked as private.September 16, 2016 at 2:15 pm #1178558
DarshanaModeratorHi there,
Please provide us with your FTP credentials to check your functions.php file.
Thanks!
September 16, 2016 at 2:56 pm #1178620
kiovicParticipantThis reply has been marked as private.September 17, 2016 at 12:54 am #1179054
RadModeratorHi there,
Please implement the code again and provide the error you’re getting. Right now, I’m not sure which one and how you implemented them. Then I’ll guide you about the solution bit by bit 🙂
Thanks!
September 19, 2016 at 5:27 pm #1182204
kiovicParticipantHello,
I implemented this code
function enable_product_settings() { remove_filter( 'woocommerce_product_settings', 'x_woocommerce_remove_plugin_settings' ); } add_filter('admin_init', 'enable_product_settings', 20 ); add_action('init', 'default_woocommerce_thumbnails', 99 ); function default_woocommerce_thumbnails() { remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail_v2', 99 ); } function x_woocommerce_shop_thumbnail_v2() { GLOBAL $product; $stack = x_get_stack(); $stack_thumb = 'shop_catalog'; $stack_shop_thumb = $stack_thumb; $id = get_the_ID(); $rating = $product->get_rating_html(); woocommerce_show_product_sale_flash(); echo '<div class="entry-featured">'; echo '<a href="' . get_the_permalink() . '">'; echo get_the_post_thumbnail( $id , $stack_shop_thumb ); if ( ! empty( $rating ) ) { echo '<div class="star-rating-container aggregate">' . $rating . '</div>'; } echo '</a>'; echo "</div>"; }This resulted in blurry and out-scaled images even after using the regeneration thumbnail tool and saving the settings in the product image option. You can see the shop page at brignolskincare.com/shop
Please advise thank you!
September 20, 2016 at 1:31 am #1182702
LelyModeratorHi There,
Please add the following CSS on Appearance > Customize > Custom > Edit Global CSS:
.woocommerce li.product .entry-featured img { min-width: initial; }Hope this helps.
September 20, 2016 at 7:57 am #1183081
kiovicParticipantI implemented your latest code to the CSS
It did help but still has a repeat image on the shop page.
Please advise.
Thank you for your help and patience.
September 20, 2016 at 8:07 pm #1183997
LelyModeratorHi There,
From your code above, please check this part:
function default_woocommerce_thumbnails() { remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail_v2', 99 ); }Update to this:
function default_woocommerce_thumbnails() { remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_product_thumbnails', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail_v2', 99 ); }Hope this helps.
September 27, 2016 at 11:10 am #1192518
kiovicParticipantI replaced and implemented the code above but resulted in the following error:
Parse error: syntax error, unexpected ‘default_woocommerce_thumbnails’ (T_STRING), expecting ‘(‘ in /home/content/p3nexnas06_data02/05/3580505/html/wp-content/themes/x-child/functions.php on line 52
Please consider that resulting in these errors are spending a lot of time fixing them because I can no longer access the wordpress dashboard.
Please advise.
September 27, 2016 at 9:28 pm #1193316
LelyModeratorHi There,
I have logged in to your site via FTP. This part is incorrect
add_filter('init', function default_woocommerce_thumbnails() { remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_product_thumbnails', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail_v2', 99 ); }It should be like this:
function default_woocommerce_thumbnails() { remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_product_thumbnails', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail_v2', 99 ); }I made the update and the error is gone and your site is back now.
Hope this helps.September 28, 2016 at 11:35 am #1194193
kiovicParticipantThank you, that omitted the duplicate photo. However the sizes do not change in the shop/collections page after I change them in the woocommerce product display settings.
Thank you,
September 28, 2016 at 5:11 pm #1194734
RadModeratorHi there,
Try regenerating your thumbnails. Like using Force regenerate thumbnails plugin. Woocoomerce recommend it on every change you made for image sizes.
Thanks!
September 29, 2016 at 12:48 pm #1196063
kiovicParticipantHello,
I have installed the regenerate thumbnails and regenerated the thumbnails, however still resulted in no change to the product pictures in the shop page.
September 29, 2016 at 5:16 pm #1196415
RadModeratorHi there,
I updated your code to this
function x_woocommerce_shop_thumbnail2() { GLOBAL $product; $stack = x_get_stack(); $stack_thumb = 'shop_catalog'; $stack_shop_thumb = $stack_thumb; $id = get_the_ID(); $rating = $product->get_rating_html(); woocommerce_show_product_sale_flash(); echo '<div class="entry-featured">'; echo '<a href="' . get_the_permalink() . '">'; echo get_the_post_thumbnail( $id , $stack_shop_thumb ); if ( ! empty( $rating ) ) { echo '<div class="star-rating-container aggregate ">' . $rating . '</div>'; } echo '</a>'; echo "</div>"; } function default_woocommerce_media_setting() { remove_filter( 'woocommerce_product_settings', 'x_woocommerce_remove_plugin_settings' ); remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_product_thumbnails', 10 ); add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_thumbnail2', 10 ); } add_filter('init', 'default_woocommerce_media_setting', 99999);Should be working now.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1178117 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
