-
AuthorPosts
-
May 11, 2016 at 10:48 pm #631008
Hello,
I think the topic title says enough about my problem.
When a product is out of stock, i want the shop page to show the “out of stock” text and disable the button.When a product is out of stock now, the button changes from background color and redirect to the product page. On the product page is the “out of stock” button. This button should be on the shop-page.
So: the button “Add to cart” on the shop-page has to change to the “Out of stock” button on the product-page and should not do anything when you click on it.
Shop-page: http://instituut-spijksma.nl/product-categorie/venray/
Product-page: http://instituut-spijksma.nl/Cursus/petrus-banden/I hope you guys can help me out!
Best regards, Robin
- This topic was modified 8 years, 6 months ago by loyalmedia.
May 13, 2016 at 10:27 am #631962Hey loyalmedia,
Thank you for using Enfold.
Add this in the Quick CSS field:
#top .outofstock .ajax_add_to_cart { text-indent: -9999px; } #top .outofstock .ajax_add_to_cart:before { content: 'Out of Stock'; display: block; position: absolute; color: #ffffff; width: 100%; height: 30px; z-index: 10000; top: 10px; left: 0; text-align: center; font-size: 15px; line-height: 30px; text-indent: 0; }
Best regards,
IsmaelMay 13, 2016 at 10:41 am #631969Hi Ismael,
Thanks for your reply. But it doesn’t work well.
I’f added a code now and the button isn’t clickable anymore, and the button is red. The only thing now is that the text in the button is still the same as the text in the other buttons.Is it possible to add a custom text in the button, when the product is out of stock?
- This reply was modified 8 years, 6 months ago by loyalmedia.
May 14, 2016 at 12:18 am #632254Hi,
In the below code please replace “New text” with your own text and add this at the very end of your themes / child themes functions.php file:
// Change "Out of stock" text function custom_excerpt(){ ?> <script> jQuery(window).load(function(){ jQuery('.single-product-summary').each(function() { jQuery(".out-of-stock").text("New Text"); }); }); </script> <?php } add_action('wp_head', 'custom_excerpt');
In case you have any issues please let us know the exact text you like to replace.
Best regards,
Vinay- This reply was modified 8 years, 6 months ago by Vinay.
May 14, 2016 at 10:27 am #632322Thanks for your reply Vinay!
I’f placed the code ad the very end of the functions.php of the child-theme but nothing happened…
The text must be: “Deze groep is vol.”May 14, 2016 at 3:29 pm #632360Hi,
If you are not using a child theme please paste the code in functions.php after the line
if(isset($avia_config['use_child_theme_functions_only'])) return;
If that don’t solve the issue go ahead and post us your login credentials (in the “private data” field), so we can take a look at your backend.
Login credentials include:
- the URL to the login screen
- a valid username (with full administration capabilities)
- as well as a password for that username
- Please confirm if “Deze groep is vol” should be replaced with “Out of stock” ?
Best regards,
Vinay- This reply was modified 8 years, 6 months ago by Vinay.
-
AuthorPosts
- You must be logged in to reply to this topic.