- This topic is empty.
-
AuthorPosts
-
December 10, 2014 at 2:12 pm #190539
misscosmic
Participanthttp://www.lestentesdavalon.com/wp/product/tente-arthur/
A web shop. To the right “à partir: ” which I wanted there and which I got there via a PHP snippet someone handed me.
I hope to remember it was this:
[code]
// Price from// Use WC 2.0 variable price format
add_filter( ‘woocommerce_variable_sale_price_html’, ‘wc_wc20_variation_price_format’, 10, 2 );
add_filter( ‘woocommerce_variable_price_html’, ‘wc_wc20_variation_price_format’, 10, 2 );
function wc_wc20_variation_price_format( $price, $product ) {
$min_price = $product->get_variation_price( ‘min’, true );
$price = sprintf( __( ‘From: %1$s’, ‘woocommerce’ ), wc_price( $min_price ) );
return $price;
}[/code]
But now to the left in the menu is also “à partir:” but there it is not suppost to go. How to get rid, that is my question ..December 10, 2014 at 2:32 pm #190540Paulie_D
MemberIf you mean the product list on the left side, I don’t think that’s the PHP which generates the list.
The phrase
a partir
is hard coded after the link and before the price span. That being the case, it should (I think) show up in your PHP.December 11, 2014 at 5:55 am #190595misscosmic
ParticipantNo it is not the list that is generated but the images next to the list are.
It sounds (and is .. stupid) but I don’t know anymore where I put this snippet .. Could you advice me how I can find the file which contains “a partir:” .. ?December 11, 2014 at 6:03 am #190597Paulie_D
MemberThis is the structure of one of those list items which is in a
ul
with a class ofproduct_list_widget
.<li> <a href="http://www.lestentesdavalon.com/wp/product/tente-arthur/" title=" Arthur"> <img width="157" height="157" src="http://www.lestentesdavalon.com/wp/wp-content/uploads/2014/10/artus-157x157.jpg" class="attachment-shop_thumbnail wp-post-image" alt="artus"> Arthur </a> a partir: /* see here */ <span class="amount">1.700,00 €</span> </li>
So whatever PHP generates that list is also including the text.
December 11, 2014 at 6:14 am #190598misscosmic
Participantluckaly I found the snippet now .. Would it be possible to generate “a partir” only before the price, with css .. ?
December 11, 2014 at 7:21 am #190602Paulie_D
MemberThe price (
span class="amount"
)is hidden withdisplay:none
at the moment. Is there a reason for that?December 11, 2014 at 8:18 am #190604misscosmic
ParticipantI gave this a try but it did not work ..
December 11, 2014 at 8:20 am #190605misscosmic
ParticipantThis is the snippet btw:
[code]
// Price from// Use WC 2.0 variable price format
add_filter( ‘woocommerce_variable_sale_price_html’, ‘wc_wc20_variation_price_format’, 10, 2 );
add_filter( ‘woocommerce_variable_price_html’, ‘wc_wc20_variation_price_format’, 10, 2 );
function wc_wc20_variation_price_format( $price, $product ) {
$min_price = $product->get_variation_price( ‘min’, true );
$price = sprintf( __( ‘à partir: %1$s’, ‘woocommerce’ ), wc_price( $min_price ) );
return $price;
}
[/code]December 11, 2014 at 8:34 am #190606Paulie_D
MemberThat doesn’t look like the whole PHP…I think (from my limited knowledge) you’re looking for the
include statement
. -
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.