- This topic has 13 replies, 3 voices, and was last updated 1 year, 6 months ago by
David.
-
AuthorPosts
-
November 27, 2020 at 8:57 pm #1553969
nik9
Hello,
We want to show our product listing like cards.. like this example here. https://demos.kadencewp.com/blocks-store/product-category/clothing/tshirts/
We know that is just CSS. We are using niche theme. So the question is, in niche the „add to cart“ flys in on hover. But when we try to give the current niche boxes such a card look. It takes so much space because of the hidden „add to cart“ when no hover.
How can we adjust this?
Cheers
November 28, 2020 at 8:14 am #1555057David
StaffCustomer SupportHi there,
do you have a site setup with the card styling so i can take a look at what changes need to be made.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/November 30, 2020 at 8:48 am #1558775nik9
Hi David
There is the link with the current status. But i’m not happy with the UI and the CSS is a hack.. haha..
December 1, 2020 at 2:50 am #1560055David
StaffCustomer SupportThe Niche Hover effect uses the CSS transform translate property – which means the button, whether it be visible or not will always occupy ‘space’ on the page. So getting rid of the extra gap is tricky.
However, to make the card style effect easier and something you can then tweak you can wrap the Shop items content so you effectively have a div for the image, and a div containing all other content including the button. This PHP Snippet will do that:
add_action('woocommerce_shop_loop_item_title', 'woo_shop_loop_item_open_wrapper',9); add_action('woocommerce_after_shop_loop_item', 'woo_shop_loop_item_close_wrapper',100); function woo_shop_loop_item_open_wrapper() { echo '<div class="woo-content-wrap">'; } function woo_shop_loop_item_close_wrapper() { echo '</div>'; }
Now you can add padding and a background color to the
woo-content-wrap
element. And the Button will be included inside that.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 2, 2020 at 3:32 am #1563349nik9
Hi David, thanks.
Yes this makes it a lot easier. But to get rid of the extra gap is not possible? What about when the transformation is not from bottom to top but instead left to right?
Cheers
December 2, 2020 at 4:12 am #1563423David
StaffCustomer SupportDoesn’t matter which direction, the element still occupies the same space in the DOM.
The only way around that is to transform the other elements to fill that space. And have them ‘move’ on hover as well.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 3, 2020 at 9:35 am #1566155nik9
Maybe we can add a
margin-top: -200px
to the row space between or is that a hack? 🙂December 4, 2020 at 7:18 am #1567412nik9
I found this here.. https://kindpreneurs.com/department/accessories/
Maybe to push everything to top will work and would be look nice. What you think david?
December 4, 2020 at 12:09 pm #1567777Tom
Lead DeveloperLead DeveloperHi there,
Give this a shot:
.woo-content-wrap { padding: 15px; background: #efefef; position: relative; } .woocommerce ul.products li.product .button.add_to_cart_button { position: absolute; left: 10px; right: 10px; width: auto; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentDecember 7, 2020 at 4:51 pm #1570971nik9
Hey Tom,
Yes, this looks good. But now we have some other CSS issues.
– Now some old CSS does not work after activate the new wrap. Now it’s not possible to give the class
SellerDetailsProductThumbnail
a margin-top and margin-bottom. Why?December 8, 2020 at 2:45 am #1571344nik9
Hi Tom,
I was able to solve this via give the class
span.SellerDetailsProductThumbnail
the settingdisplay: block
.Is this a proper solution?
December 8, 2020 at 2:55 am #1571360David
StaffCustomer SupportThat simply makes the CSS more specific – which is the way to fix a specificity issue 🙂 So it looks good to me!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/December 8, 2020 at 2:56 am #1571361nik9
Hi David,
Perfect! Thanks 🙂
December 8, 2020 at 3:01 am #1571366David
StaffCustomer SupportYou’re welcome
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.