Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On sale flash code makes product image shrink to thumbnail #16

Open
eskadesign opened this issue May 5, 2017 · 1 comment
Open

On sale flash code makes product image shrink to thumbnail #16

eskadesign opened this issue May 5, 2017 · 1 comment

Comments

@eskadesign
Copy link

The only thing missing in my theme case was the "Sale" message, so I added the proper code to wooswipe.php and it worked.

But now I'm trying to get this to work after the new update of both Woocommerce 3.0.5 and your plugin. But the issue is when I add this code:

`is_on_sale() ) : ?>

<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>
`

to wooswipe.php here:

`///////////////////////
//override Woo Gallery
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
add_action( 'woocommerce_before_single_product_summary', 'wooswipe_woocommerce_show_product_thumbnails', 20 );

function wooswipe_woocommerce_show_product_thumbnails(){
global $post, $woocommerce, $product; ?>

<div id="wooswipe" class="images">
is_on_sale() ) : ?>
<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . esc_html__( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>

`
it turns the product image into a thumbnail. See screenshots

[https://cloud.githubusercontent.com/assets/17767488/25747948/a0faded0-31a9-11e7-8c14-f63612bf3c8f.jpg]

[https://cloud.githubusercontent.com/assets/17767488/25747947/a0f839c8-31a9-11e7-8703-3ad4e1119555.jpg]

@thriveweb
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant