Home › Forums › Basel support forum › Price and quantity wrap
Price and quantity wrap
- This topic has 5 replies, 2 voices, and was last updated 7 years ago by Artem Temos.
-
AuthorPosts
-
March 13, 2017 at 1:34 pm #10790
TessParticipantHi
My client wants me to add a price swap plus quantity on products as per the website link below
What is the correct css code to do this? Can this be done in the theme product settings?
Below is code taken from the website link
.basel-hover-alt.product-type-external .btn-add, .basel-hover-alt.product-type-external .price, .basel-hover-alt.product-type-external .wrapp-swap, .basel-hover-alt.product-type-grouped .btn-add, .basel-hover-alt.product-type-grouped .price, .basel-hover-alt.product-type-grouped .wrapp-swap, .basel-hover-alt.purchasable .btn-add, .basel-hover-alt.purchasable .price, .basel-hover-alt.purchasable .wrapp-swap
Attachments:
You must be logged in to view attached files.March 13, 2017 at 2:30 pm #10792
Artem TemosKeymasterHello,
Thank you for choosing our theme and contacting us.
Actually, it can’t be done with CSS code only. Here is an article that should help you https://docs.woocommerce.com/document/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/
Kind Regards
XTemos StudioNovember 27, 2017 at 11:56 am #25743
TessParticipantHi Artem. This code worked for a while, but since the theme update, the item does not add to the cart. Please help – it is for the same client as per previous enquiry.
.add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘quantity_inputs_for_woocommerce_loop_add_to_cart_link’, 10, 2 );
function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
if ( $product && $product->is_type( ‘simple’ ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
$html = ‘<form action=”‘ . esc_url( $product->add_to_cart_url() ) . ‘” class=”cart” method=”post” enctype=”multipart/form-data”>’;
$html .= woocommerce_quantity_input( array(), $product, false );
$html .= ‘<button type=”submit” class=”button alt”>’ . esc_html( $product->add_to_cart_text() ) . ‘</button>’;
$html .= ‘</form>’;
}
return $html;
}November 27, 2017 at 12:13 pm #25744
Artem TemosKeymasterHello,
Did you check how it works with default WordPress theme? Is this issue related to our Basel theme?
Regards
November 27, 2017 at 12:29 pm #25756
TessParticipantThe code is in the Basel Child theme, as per before. My question is: Is the error due to theme upgrade? I need to get it to work.
November 27, 2017 at 12:30 pm #25757
Artem TemosKeymasterWe don’t know since this code is not a part of our theme and you have added it by your own. But the code may be not working with the latest version of the WooCommerce plugin. Anyway, it can’t be caused by our theme. And you can check it adding this code to default WordPress theme.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register