Tagged: 

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1307102

    Hi

    Iis there a possibility to move the position from “in stock” (“vorrätig” in german) AFTER the price?

    Kindly Regards,
    Soltner

    #1307427

    Hey soltner,

    Thank you for the inquiry.

    We checked the product page and it looks like the stock is now located after the price. Do you require more help with this? You can use the template hooks if you want to move certain elements in the product page.

    Example:

    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
    
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 10 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 30 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 40 );
    

    Best regards,
    Ismael

    #1307457

    Hello,
    sorry but I had sent the wrong reference page – see in private content.
    I tried the hooks, but unfortunately didn’t manage to set the stock-to-stock according to the price.
    is there a possibility?

    Kindly Regards,
    Soltner

    #1307684

    Hi,

    Thank you for the update.

    Try to add this code in the functions.php file to display the stock after the price.

    add_action("woocommerce_single_product_summary", function() {
    	global $product;
    	echo wc_get_stock_html( $product ); // WPCS: XSS ok.
    }, 15);
    

    You may need to remove or hide the default “in stock” element using css.

    Best regards,
    Ismael

    #1308483

    Hi,

    great, it works!
    I try to hide the defalut “in stock” with this code:

    p.stock.in-stock {
    display: none!important;
    }

    but unfortunately both are hidden… can you please help me here too?

    Best regards,
    Soltner

    #1308571

    Hi,

    Thanks for the update. Please try this CSS instead:

    .single-product p.in-stock:nth-child(2) {
      display: none;
    }

    Best regards,
    Rikard

    #1309485

    Hi Rikard,

    sorry for my late reply… i try the css but is not working (i try also with !important!).

    Kindly regards,
    Soltner

    #1309636

    Hi,

    Thanks for the update. Please try this CSS instead:

    .single-product p.in-stock:nth-of-type(2) {
      display: none;
    }

    Best regards,
    Rikard

    #1310698

    Hi Rikard,

    sorry for the late reply again, but I only got back from vacation yesterday :-)

    Thank you for your feedback! I tried the code, but the upper “in stock” is hidden, but I would like to hide the lower one, is that also possible?
    See also screenshot in private…

    Best regards,
    Soltner

    #1310808

    Hi,

    Thanks for the update, I hope you had a good holiday :-)

    Could you provide us with admin WordPress login details in private, so that we can try to adjust the CSS for you please?

    Best regards,
    Rikard

    #1310842

    Hi,

    yes, was wonderful :-)

    See WP login details in private – thank you so much for your help!

    Best regards,
    Soltner

    #1311009

    Hi,

    Thanks for that. I couldn’t get any CSS to apply from Quick CSS or you style sheet in the child theme, but this works in the WordPress customiser. Please try it out:

    .single-product p.in-stock:nth-of-type(3) {
      display: none;
    }

    Best regards,
    Rikard

    #1311051

    Hi,

    Great :-)
    Thank you very much, big compliments to the support!

    Best regards,
    Soltner

    #1311360

    Hi,

    Great, I’m glad that we could help you out :-)

    Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1311372

    Thanks Rikard,

    you can close the topic!

    Best regards,
    Soltner

    #1311798

    Hi,

    Thanks for letting us know, I’ll go ahead and close this thread for now then. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Woocommerce change position "in stock"’ is closed to new replies.