I keep encountering this issue and I’ve seen it addressed here before, but there was never an answer to it. So I have trouble with some products where the “product data – simple product” drop down menu is greyed out and unresponsive. For example right now I want to translate an already-existing product into english. The ‘product data’ on the french side works perfectly, I can drop-down and select ‘variable product’. But on the new side, that is greyed out.
There have been no new plugins installed in the past month and there’s no new update for Woocommerce right now. This issue has been driving me crazy. How can I solve it?
Thanks
Eri
But if I’m working on variable product. It kills the page, then I have to click “wait” and then about 30 seconds later the product updates, saves draft or publishes.
I have a 6cpu, 16gb ram with 100gb storage. Siteground has put my memory limits on wordpress at max limit.
What can I do to fix this issue and find the problem?
]]>I have a variable product with 2 attributs (print and dimension)
I have one size on my dimensions attribut and one type of print in my prints attribut
Here my problem the price never show up in the product page when i select my attributs
Any suggestions ?
Thanks
]]>Here is the code:
add_action( 'woocommerce_after_add_to_cart_button', 'add_custom_addtocart_and_checkout' );
function add_custom_addtocart_and_checkout() {
global $product;
$addtocart_url = wc_get_checkout_url().'?add-to-cart='.$product->get_id();
$button_class = 'single_add_to_cart_button button alt custom-checkout-btn';
$button_text = __("Buy & Checkout", "woocommerce");
if( $product->is_type( 'simple' )) :
?>
<script>
jQuery(function($) {
var url = '<?php echo $addtocart_url; ?>',
qty = 'input.qty',
button = 'a.custom-checkout-btn';
// On input/change quantity event
$(qty).on('input change', function() {
$(button).attr('href', url + '&quantity=' + $(this).val() );
});
});
</script>
<?php
elseif( $product->is_type( 'variable' ) ) :
$addtocart_url = wc_get_checkout_url().'?add-to-cart=';
?>
<script>
jQuery(function($) {
var url = '<?php echo $addtocart_url; ?>',
vid = 'input[name="variation_id"]',
pid = 'input[name="product_id"]',
qty = 'input.qty',
button = 'a.custom-checkout-btn';
// Once DOM is loaded
setTimeout( function(){
if( $(vid).val() != '' ){
$(button).attr('href', url + $(vid).val() + '&quantity=' + $(qty).val() );
}
}, 300 );
// On input/change quantity event
$(qty).on('input change', function() {
if( $(vid).val() != '' ){
$(button).attr('href', url + $(vid).val() + '&quantity=' + $(this).val() );
}
});
// On select attribute field change event
$('.variations_form').on('change blur', 'table.variations select', function() {
if( $(vid).val() != '' ){
$(button).attr('href', url + $(vid).val() + '&quantity=' + $(qty).val() );
}
});
});
</script>
<?php
endif;
echo '<a href="'.$addtocart_url.'" class="'.$button_class.'">'.$button_text.'</a>';
}
Now, the problem is whenever I am clicking on the Buy Now button with the default variations set in the Product editor, the code is not working.
The Buy Now URL in this case becomes …/?addtocart=0&quantity=n
Any solutions?
]]>To explain; When adding a variable product, say t-shirts in three different sizes and colors. Then we have six variations, and they all get an unique ID when in the product page / Productdata / Variables. Here the ID is set with an # when looking at them in wp-admin.
]]>I’ve noticed Woocommerce has changed one of my products from a variable product to a simple product. The issue is it won’t allow me to select ‘variable product’ to change back. Please could someone advise? In fact I’m trying to add some more new products and it won’t allow me to make these products variable.
All help much appreciated.
Thanks
Stacey
]]>Link = https://www.thepersonalizationco.com/shop/amazing-stars-tote-bag/
]]>