Woocommerce Wordpress plugin not showing quantity on cart page - wordpress

Strange issue this. When I 'add to cart' it is set to redirect straight to the cart contents page to push sales however when it then loads the cart contents page the qty box is empty however if I view source at this point, the qty is there in the code. If I just click go to checkout leaving it blank (on the assumption that it is simply not displaying but is actually seeing the qty) it tells me cart is empty.
Even stranger, if I refresh the page whilst looking at the 'blank qty cart page', the qty appears for a milisecond then disappears.
It took me a while to work out shipping methods but got there in the end so this is the only issue left to sort. I asked on the wordpress forums but getting no response so if anyone could help that'd be great. I would guess it is a css issue but really just not sure.
html of qty button in 'blank' state:
<td class="product-quantity">
<div class="quantity"><input type="number" name="cart[8c5f6ecd29a0eb234459190ca51c16dd] [qty]" step="1" min="" max="" value="2" size="4" title="Qty" class="input-text qty text" maxlength="12" /></div>
</td>
corresponding css (as far as I can see, the woocommerce.css file itself is quite big but I don't want to post all of it here)
.woocommerce td.product-quantity,.woocommerce-page td.product-quantity {
min-width:80px;
color:#fff;
}
Thanks in advance

if you change your theme to the default, it works right ?
see here:
http://wordpress.org/support/topic/plugin-woocommerce-product-quantity-not-showing-on-cart-page

Related

WooCoommerce after page loads removes my modifications on mini-cart

How do I modify something on the minicart without WooCommerce removing it? When page is still loading I can see my text on minicart, but after a second, when the page complete loads, it gets removed.
This is the code that I use to display the minicart in the header. Everything that comes with this function will reset after a while
<div class="widget_shopping_cart_content">
<?php woocommerce_mini_cart(); ?>
</div>
I am trying to append a few things for each item product but I would also need to do it for subtotal and maybe some other things. If I try to use this filter (which by itself shows single product price and quantity in the cart) then my appended HTML shows for a split of second and then disappears.
add_filter('woocommerce_widget_cart_item_quantity', 'ms_woocommerce_widget_cart_item_quantity', 999, 3);
function ms_woocommerce_widget_cart_item_quantity($html_price, $cart_item, $cart_item_key)
{
return $html_price . ' <div>Something</div>';
}
If I add some HTML code in the template cart/mini-cart.php, same thing happens. It will just reset itself to original state after page loads. Same thing happens if I modify directly that template directly in the WooCommerce plugin folder for testing it out, so I don't know where does it pull original HTML from?
I understand that WooCommerce updates fragments but shouldn't it update minicart with my modifications included? Either from mini-cart.php template or with above filter.

How to make a woocommerce order notes in checkout to be a datepicker

I am trying to customize a woocommerce checkout page, I need to change an order notes box in checkout page from textbox to datepicker, I need a help on it
Why do you want to make the order notes a datepicker? That's a text area. It would be wrong to mess up the existing input field type & change it to a datepicker.
Instead it would be better to add a datepicker field separately either via a code snippet or via a plugin. Below code can help you add a datepicker on the WooCommerce checkout page.
add_action( 'woocommerce_after_checkout_billing_form', 'display_extra_fields_after_billing_address' , 10, 1 );
function display_extra_fields_after_billing_address () {
_e( "Delivery Date: ", "add_extra_fields");
?>
<br>
<input type="text" name="add_delivery_date" class="add_delivery_date" placeholder="Delivery Date">
<?php
}
The above code is taken from this article, which includes options to add the datepicker at other places on the checkout page: https://www.tychesoftwares.com/how-to-add-custom-fields-on-woocommerce-checkout-page/
Also you can use this free plugin: https://wordpress.org/plugins/order-delivery-date-for-woocommerce/

How do I show the current page title or label?

How to show the current page title or label?
I have tried with below code -
<data:blog.searchLabel/>
Display the label when you are on URL search label only. I need a code that displays HOMEPAGE when you are on homepage URL and shows Label of posts When you are on blogger posts !!
I couldn't do that so I called another div that display the tags but its super bad since it gets doubled when I call it for no reason.
$(function(){
$('.label-head a').clone().appendTo('.repheader');
});
<div class='tm-menu'>
<div class='body-row repheader'><data:blog.searchLabel/></div>
<div class=label-head>
</div>
I solved the problem by myself.
I found two divs so I deleted one of them.
I found blogger tag that display the page title, here is a link which you might find helpful.

Wordpress E-mail before displaying content

So, I have a lot of posts with custom content. Some of this content is hidden, for example prices. I want the prices to be visible after the user submits an e-mailaddress. But it has to be remembered via cookies.
I first tried to make user registrations with e-mailaddress only, but that's not what I want and is not very safe.
Then I wanted to try Email Before Download plugin, but that's not gonna work either. That gives me 1 link or 1 text per contactform (it uses contactform 7).
Is there a plugin for this?
Edit Maybe it's a better idea to use Sessions. I now have:
<input type="email" placeholder="E-mailadres" name="email" />
Then I made a session:
<?php
if(isset($_POST['email'])){
$_SESSION['user_email_set'] = true;
}
if(isset($_SESSION['user_email_set']) && $_SESSION['user_email_set']){
echo "Sessions made :)";
}
?>
But, when I refresh the page or go to another page, the sessions is lost. What did I do wrong?

Adding Span Tag In WordPress Default Comment Content Form Using JQuery

Be lucky day, ;-), Today, I have difficulties in adding span tag in wordpress default comment content form by using jquery. Now, I added my span tag in wordpress comment content form (textarea) by using jquery. It didn't work and didn't show it, But, when I inspected with firebug, it can be visible in firebug!
<textarea aria-required="true" rows="8" cols="45" name="comment" id="comment"><span>Custom Span</span></textarea>
I understand, If I add only text using jquery, it can work and display, and then, if I edit the core code of wordpress, it can make it work, but, I don't wanna touch the core codes! So, Is there anyways to insert span tag(whatever tag) to put in wordpress default comment content form (textarea)

Resources