magento2.4 – Magento 2.4 product stock status not change after salable quantity become zero

I tried below scenario in Magento 2.4.0 version

Anyone please try below scenario in your Magento 2.4 version ?

I created one configurable product and its two simple child with 100 qty.

Before Order place:
I went Admin Product Grid there are two columns Quantity and Salable Quantity.
One child product has 100 Quantity and Salable Quantity are 100

After Placed order:
In Admin product grid,same child product has salable quantity is 0 and quantity column shows 100 quantity and when I went product edit page it still shows in stock status even no back orders and Manage stock set to yes and I did reindex.

Expected Result:
when product becomes zero salable quantity it should automatically change stock status out of stock

Actual Result:
when product becomes zero salable quantity it does not change stock status from in stock to out of stock

Anyone face above isuue in your Magento 2.4 version ?

plugins – Add a button next to the quantity and checkout buttons in the product page at the same row

I have quantity button and checkout button i want to add (add to cart ) button next to them
i did it by writing a function in function.php but it goes under them.

what i did:

add_action( 'woocommerce_single_product_summary', 'ajouter_au_panier', 30 );

function ajouter_au_panier() {
  global $product;
  echo '<a href="https://electrotasnime.amine-ha.info/wordpress/checkout-2/">
   <input type="button" value="Acheter Maintenant" class="single_add_to_cart_button button alt" style="border-color: #efecec;" /></a>';
}

enter image description here

magento2 – Magento 2 | Take a specific tier price based on quantity with PHP

I’m trying to figure out how to take a specific tier price if I enter a quantity in the php function.

For example, I want to have the price per 1000 pcs of a product. This is my code but I don’t know how to extract the tier price from a quantity written in php.

$tier_price = $_product->getTierPrice();

How can i do for exctract tier price of specific quantity?
Thanks

php – Would like simple product to display the quantity field and correct add to cart button

I found this useful code relating to woo commerce where it adds product variations on the shop page for a variable product.

// Display variations dropdowns on shop page for variable products
 add_filter( 'woocommerce_loop_add_to_cart_link', 'woo_display_variation_dropdown_on_shop_page' );
 
 function woo_display_variation_dropdown_on_shop_page() {
     
    global $product;

    if( $product->is_type( 'variable')) {
    
    $attribute_keys = array_keys( $product->get_attributes() );
    ?>
    
    <form class="variations_form cart" method="post" enctype='multipart/form-data' data-product_id="<?php echo absint( $product->id ); ?>" data-product_variations="<?php echo htmlspecialchars( json_encode( $product->get_available_variations() ) ) ?>">
        <?php do_action( 'woocommerce_before_variations_form' ); ?>
    
        <?php if ( empty( $product->get_available_variations() ) && false !== $product->get_available_variations() ) : ?>
            <p class="stock out-of-stock"><?php _e( 'This product is currently out of stock and unavailable.', 'woocommerce' ); ?></p>
        <?php else : ?>
            <table class="variations_shop" cellspacing="0">
                <tbody>
                  <?php foreach ( $product->get_variation_attributes() as $attribute_name => $options ) : ?>
                        <tr>
                            <td class="label"><label for="<?php echo sanitize_title( $attribute_name ); ?>"><?php echo wc_attribute_label( $attribute_name ); ?></label></td>
                            <td class="value">
                                <?php
                                    $selected = isset( $_REQUEST( 'attribute_' . sanitize_title( $attribute_name ) ) ) ? wc_clean( urldecode( $_REQUEST( 'attribute_' . sanitize_title( $attribute_name ) ) ) ) : $product->get_variation_default_attribute( $attribute_name );
                                    wc_dropdown_variation_attribute_options( array( 'options' => $options, 'attribute' => $attribute_name, 'product' => $product, 'selected' => $selected ) );
                                    echo end( $attribute_keys ) === $attribute_name ? apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . __( 'Clear', 'woocommerce' ) . '</a>' ) : '';
                                ?>
                            </td>
                        </tr>
                    <?php endforeach;?>
                </tbody>
            </table>
    
            <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
    
            <div class="single_variation_wrap">
                <?php
                    /**
                     * woocommerce_before_single_variation Hook.
                     */
                    do_action( 'woocommerce_before_single_variation' );
    
                    /**
                     * woocommerce_single_variation hook. Used to output the cart button and placeholder for variation data.
                     * @since 2.4.0
                     * @hooked woocommerce_single_variation - 10 Empty div for variation data.
                     * @hooked woocommerce_single_variation_add_to_cart_button - 20 Qty and cart button.
                     */
                    do_action( 'woocommerce_single_variation' );
    
                    /**
                     * woocommerce_after_single_variation Hook.
                     */
                    do_action( 'woocommerce_after_single_variation' );
                ?>
            </div>
    
            <?php do_action( 'woocommerce_after_add_to_cart_button' ); ?>
        <?php endif; ?>
    
        <?php do_action( 'woocommerce_after_variations_form' ); ?>
    </form>
        
    <?php } else {
        
    echo sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s">%s</a>',
            esc_url( $product->add_to_cart_url() ),
            esc_attr( isset( $quantity ) ? $quantity : 1 ),
            esc_attr( $product->id ),
            esc_attr( $product->get_sku() ),
            esc_attr( isset( $class ) ? $class : 'button' ),
            esc_html( $product->add_to_cart_text() )
        );
    
    }
     
}

The issue I have noticed however is that I have a mismatch of add to cart buttons as you can see in the image below.

enter image description here

The variable product shows the yellow add to cart button pulled from the variation single product page, whilst the single product shows the default theme add to cart.

What I would like to be honest is the user to be able to add to cart from the shop page, not matter if the product is variable or simple, so I would like the same behaviour for both except the only difference is that the simple product will only show quantity field and the yellow add to cart button (that can be pulled from the single product page).

How can the code above be manipulated to fulfil that?

❓ASK – Where can i buy bitcoin small quantity with low fees? | Proxies-free

hey guys,
Do you know of a website where i can buy cryptos in low fees or no charges at all online here in the us

thanks

1)CEX.IO – This scores highly in all regards. It is very popular, easy to use, and a one stop shop for everything you will need on a platform. Additionally, their trading fees are low and clearly disclosed. ( https://cex.io/r/0/up120072025/0/ )

2)Coinbase – This is an obvious second runner up. It is one of the most trusted exchanges around. The only downside to Coinbase is that you are only allowed to trade a few cryptos. I believe they are offering 15 crypto currencies at the moment and their fees tend to be on the higher side, however they are still very competitively priced

8 – Quantity on cart can be only set to 1

I can add to the cart as many items as like, for example 4. When I visit the cart page, I can see 4 items in the cart.
However, I cannot proceed to the checkout as I see a message which says the value should not be greater than 1. When I inspect the quantity form element, I can see the minimum and the maximum are set to 1.

I also cannot remove items from cart unless I change the quantity to 1.

Where can I find the settings for that?

I inspected all the commerce configuration values and the settings for the commerce_cart_form view, but I didn’t find anything that could help.

I also have the Commerce Simple Stock module enabled. Maybe it interferes somehow with the quantity value.

Drupal 8 Commerce cart: quantity can be only set to 1

I can add to cart as many items as I would like to (let say 4).

After I open cart page I can see 4 items in my cart, however, I cannot proceed to checkout as I see message that the value should not be greater than 1. When I inspect quantity input I can that there are min and max attributes set to 1.

I also cannot remove items from cart unless I change quantity to 1.

Where can I find the settings for that? I inspected all the commerce config options and commerce_cart_form view, but no luck.

I also have “Commerce Simple Stock” module enabled, maybe it interferes somehow with quantity?

django – with this model structure how to calculate the total quantity for each product and view it in the product table in admin site?

Each order has one or more lineItem and each lineItem has product where its quantity is defined
How to get the total quantity for each product from all the orders?

class Product(models.Model):
    name = models.CharField(max_length=50)
    SKU = models.CharField(max_length=50)
    description = models.CharField(max_length=300)
    price = MoneyField(max_digits=19,decimal_places=4,default_currency='USD')

    def __str__(self):
        return self.name

class ProductImage(models.Model):
    product = models.ForeignKey(Product, related_name='images', on_delete=models.RESTRICT, 
                                null=True)
    image = models.ImageField()

class Order(models.Model):
    date = models.DateField(auto_now_add=True)
    user = User.name

class LineItem(models.Model):
    quantity = models.IntegerField()
    product = models.OneToOneField(
        Product,
        on_delete=models.CASCADE,
        primary_key=True,
    )
    order = models.ForeignKey(Order, on_delete=models.CASCADE)

    def __str__(self):
        return self.product.name

addtocart – Magento 2: Disable redirection to product page if requested quantity is not available on add to cart function

On catalog category page, when I add any product to cart and the requested quantity is not available, it redirects to product page and shows error message there.
Error message image on product

What I want is to display error message while staying on the same page, instead of opening the product page.