shop page cutomization
-
i want to show price in left side in the same row button that says sold or buy(it is changed by filters) sold is out of stock products also want to change sold to red color and buy green color text.
any help appreciated
my home page is shop page of woocommerce
thank uThe page I need help with: [log in to see the link]
-
Hi there 👋
This can be fixed with some custom CSS. Under Customize > Additional CSS, you can add the following code:
Â/*Align buy/sold product string with price*/ .product a.button.product_type_simple { position: absolute !important; bottom: 0 !important; right: 0 !important; } /*Change buy text color to green*/ .product a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart { color: green!important; } /*Change sold text color to red*/ .product a.button.product_type_simple { color: red !important; }Here is a screenshot of how it will look:
https://www.screencast.com/t/0cHPBvF63
Â
If you’d like to learn more about CSS, I highly recommend using the free tutorials at w3schools. Here, you can find the basics of selectors (how to target the right element on the page), and properties (how to change the element on the page).Cheers!
work perfectly thank u, but price doesn’t go left side it remains middle
Oh, I see!
In this case, please use the following code instead:
/*Align buy/sold product string with price*/ .product a.button.product_type_simple { position: absolute !important; bottom: 0 !important; right: 0 !important; } /*Change buy text color to green*/ .product a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart { color: green!important; } /*Change sold text color to red*/ .product a.button.product_type_simple { color: red !important; } /*Align product price to the lef*/ .product span.price { text-align: left !important; }This is how it should look now:
https://www.screencast.com/t/UwPaa76Ws
Cheers! 🙂
following code
.product
.woocommerce-Price-amount{
position: absolute !important;
left: 0 !important;
}
doing nice job but also affect single product pageoh sorry didn’t see your previous reply thank u
hi in android chrome browser it go beyond image please look
https://drive.google.com/file/d/1L4euPlXqW_1I1UgfVCpjzjCb2ITiwR9N/view?usp=sharingFor the mobile, we could keep the same layout as before (as you originally had it) with the price above the purchase button and both aligned to the middle. And for larger screen devices(tablets, desktops, etc), we use the new layout. Does that sound like a plan?
Kindly let me know!
yes that is the best way in my case
Great! For this, please use the folling code instead:
@media screen and (min-width: 768px) { /*Align buy/sold product string with price*/ .product a.button.product_type_simple { position: absolute !important; bottom: 0 !important; right: 0 !important; } /*Change buy text color to green*/ .product a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart { color: green!important; } /*Change sold text color to red*/ .product a.button.product_type_simple { color: red !important; } /*Align product price to the lef*/ .product span.price { text-align: left !important; } }Cheers 🙂
thanks worked perfectly
Happy to help 😃
Great! I’m going to mark this as resolved – if you have any further questions, you can start a new thread.
Cheers.
thanks for your highly helpful time 🙂
The topic ‘shop page cutomization’ is closed to new replies.