Tagged: x
-
AuthorPosts
-
July 20, 2016 at 3:56 pm #1095886
LiquidPrintOneParticipantI am trying to override woocommerce composite product image settings. I am trying to change which images size is used with composite products. Currently it is using the thumbnail of the “Catalog Images” but I want it to use a “Single product Image” as that is a quare image and the ctalog images need to be rectangles, I have tried to use the image.php (/wp-content/plugins/woocommerce-composite-products/templates/composited-product/image.php) and the component-options.php (/wp-content/plugins/woocommerce-composite-products/templates/single-product/component-options.php)…
According to the instructions at the top of both docs:
Override this template by copying it to image.php yourtheme/woocommerce/composited-product/image.php component-options.php yourtheme/woocommerce/single-product/component-options.phpSo I tried that for each one separately and at the same time using the following locations:
image.php /wp-content/themes/x-child/woocommerce/composited-product/image.php component-options.php /wp-content/themes/x-child/woocommerce/single-product/component-options.phpWithin the files themselves I am just changing ‘shop_catalog’ to ‘shop_thumbnail’ or ‘shop_single’ but neither option seems to be working. Am I using the wrong location? I am changing the wrong thing in the file?
July 20, 2016 at 3:57 pm #1095890
LiquidPrintOneParticipantThis reply has been marked as private.July 20, 2016 at 8:30 pm #1096238
NicoModeratorHi There,
Thanks for writing in.
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
July 21, 2016 at 7:54 am #1096957
LiquidPrintOneParticipantThis reply has been marked as private.July 21, 2016 at 10:34 am #1097175
DarshanaModeratorThis reply has been marked as private.July 21, 2016 at 10:46 am #1097186
LiquidPrintOneParticipantThis reply has been marked as private.July 21, 2016 at 5:55 pm #1097788
RadModeratorHi there,
What you need to change is in this file, wp-content\themes\x\framework\functions\global\plugins\woocommerce.php
And this code,
function x_woocommerce_shop_product_thumbnails() { GLOBAL $product; $id = get_the_ID(); $thumb = 'entry'; $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, $thumb ); if ( ! empty( $rating ) ) { echo '<div class="star-rating-container aggregate">' . $rating . '</div>'; } echo '</a>'; echo "</div>"; }and change this line
$thumb = 'entry';to
$thumb = 'shop_catalog';or$thumb = 'shop_single';Hope this helps.
July 22, 2016 at 8:17 am #1098578
LiquidPrintOneParticipantThanks I will give that a try! Just to make sure I am doing this right… For my child theme would i put it in:
/wp-content/themes/x-child/framework/views/global/plugins/woocommerce.phpThanks!
July 22, 2016 at 8:47 am #1098609
JoaoModeratorHi There,
That seems to be correct.
Please let us know how it goes.
Joao
July 25, 2016 at 2:24 pm #1102364
LiquidPrintOneParticipantIt does not seem to work there “/wp-content/themes/x-child/framework/views/global/plugins/woocommerce.php” nothing happens… any other suggestions? Also just to make sure you are looking at the right image on that page, it is the composite product thumbnails that are currently rectangles on that page that I am trying to change into the ‘shop_catalog’ image. Like the “Prym1 White Out (Pattern Pack)” image and the others below it. NOT the main woocommerce thumbnail.
Thanks.
July 27, 2016 at 1:14 am #1104655
LelyModeratorHi There,
Try adding this code instead on your functions.php file:
// Declare function to remove the X hook during initialization function remove_X_action() { remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); } // Register the action that will remove the X hook during initialization add_action('init','remove_X_action'); // Declare the new custom function function custom_woocommerce_shop_product_thumbnails() { GLOBAL $product; $id = get_the_ID(); $thumb = 'entry'; $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, $thumb ); if ( ! empty( $rating ) ) { echo '<div class="star-rating-container aggregate">' . $rating . '</div>'; } echo '</a>'; echo "</div>"; } // Register new action now add_action( 'woocommerce_before_shop_loop_item_title', 'custom_woocommerce_shop_product_thumbnails', 10 );Then feel free to update this line:
$thumb = 'entry';from that code.Hope this helps.
July 27, 2016 at 9:28 am #1105209
LiquidPrintOneParticipantUnfortunately that did not seem to work, It did not make a difference. I left the change up so you can see. I also tried changing $thumb = ‘entry’; to $thumb = ‘shop_single’; and $thumb = ‘shop_catalog’; with no changes.
July 27, 2016 at 4:15 pm #1105927
RadModeratorHi there,
Please try this one,
function x_woocommerce_shop_product_thumbnails_v2() { GLOBAL $product; $id = get_the_ID(); $thumb = 'shop_single'; $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, $thumb ); if ( ! empty( $rating ) ) { echo '<div class="star-rating-container aggregate">' . $rating . '</div>'; } echo '</a>'; echo "</div>"; } add_action('init', 'change_x_woo_hooks', 99999); function change_x_woo_hooks () { 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_product_thumbnails_v2', 10 ); }Then clear your cache before testing.
Thanks!
July 28, 2016 at 8:14 am #1107033
LiquidPrintOneParticipantYea, that is not doing anything either. I have it in my functions.php if you want to take a look. Maybe i am not doing something right?
Thanks!
July 28, 2016 at 4:18 pm #1107709
RadModeratorHi there,
Sorry for the confusion, but seems the customization isn’t related to the issue. The available options section are from
WooCommerce Composite Products plugin. You should contact the plugin author, their implementation is different from our theme and it’s not connected.Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1095886 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
