magento 1.9 – Error individual price when maximum Qty Allowed in Shopping Cart are exceced

I set max qty allowed in the shopping cart to 3 products but when I add more than 3 products to cart, the individual prices reduce.
Example product priced at 15 when you add more that 3 the price shows as 5 each.

I don’t have any tier price or cart promotion there, any solution?

magento2.3 – How to update the cart from observer

I have some conditions on my store based on the customer billing address.

When someone saves their address, I would like to update the items in their cart (and minicart) to ensure correct prices are shown.

I have an observer on customer_address_save_after, but I’m not sure of the best way to ‘refresh’ the cart from here. Any help much appreciated.

Magento2 mini cart counter not getting updated

Magento2 I am programmatiacally removing cart items.

$quoteItems = $this->checkoutSession->getQuote()->getItemsCollection();
            foreach($quoteItems as $item)
            {
                $cart->removeItem($item->getId())->save(); 
            }

My issue is mini cart counter is not getting updated

It just gets reduced by 1. Lets say if I have 3 items it will get reduced by 1 & change to 2.

I have already tried

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Customer:etc/sections.xsd">
    <action name="inquiry/index/save">
        <section name="cart"/>
    </action>
</config>

And this

var sections = ('cart');
customerData.reload(sections, true);

cart – Magento2: How to separate quote?

Like, I have 5 items in my Cart.

It means there is 1 row in quote table. Which contains parent ID.

And, 5 rows in quote_item which describe all 5 items.

I want separate 3 items from these 5 in another custom quote and need a separate quote for these 3 items.

Expected result:

I want 2 quotes,

1 have 2 items AND 3 items will assign to the newly created quote.

Help would be appreciated.

css – Trying to style Woocommerce sidebar Cart Widget

I have looked at length to find CSS that will change the background color, border radius and product info text color. I think this may not be a “mini cart”. The price of the item, subtotal and View Cart / Checkout buttons follow the styling Ive done to the cart. I have successfully changed my product text color on my actual Cart page. So frustrating! Help is much appreciated.

php – Changing the Shopping cart Table order / VAT disappeared

I want to change the column order in the Shopping cart table.
I want to exchange the Posititions of the Sum and VAT Column so that the Sum is the Last position.
I guest the right php Template is the cart.php. Also the VAT name disappeared somehow in my column. I have VAT activated in all of my plugins and settings but it wont show :S
I would be really thankful if the Pros out there could help me 🙂

enter image description here

    <?php
/**
 * Cart Page
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/cart/cart.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see     https://docs.woocommerce.com/document/template-structure/
 * @package WooCommerce/Templates
 * @version 3.8.0
 */

defined( 'ABSPATH' ) || exit;

do_action( 'woocommerce_before_cart' ); ?>

<form class="woocommerce-cart-form" action="<?php echo esc_url( wc_get_cart_url() ); ?>" method="post">
    <?php do_action( 'woocommerce_before_cart_table' ); ?>

    <table class="shop_table shop_table_responsive cart woocommerce-cart-form__contents" cellspacing="0">
        <thead>
            <tr>
                <th class="product-remove">&nbsp;</th>
                <th class="product-thumbnail">&nbsp;</th>
                <th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
                <th class="product-price"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th>
                <th class="product-quantity"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th>
                <th class="product-subtotal"><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th>
            </tr>
        </thead>
        <tbody>
            <?php do_action( 'woocommerce_before_cart_contents' ); ?>

            <?php
            foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
                $_product   = apply_filters( 'woocommerce_cart_item_product', $cart_item('data'), $cart_item, $cart_item_key );
                $product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item('product_id'), $cart_item, $cart_item_key );

                if ( $_product && $_product->exists() && $cart_item('quantity') > 0 && apply_filters( 'woocommerce_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
                    $product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->get_permalink( $cart_item ) : '', $cart_item, $cart_item_key );
                    ?>
                    <tr class="woocommerce-cart-form__cart-item <?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">

                        <td class="product-remove">
                            <?php
                                echo apply_filters( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
                                    'woocommerce_cart_item_remove_link',
                                    sprintf(
                                        '<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">&times;</a>',
                                        esc_url( wc_get_cart_remove_url( $cart_item_key ) ),
                                        esc_html__( 'Remove this item', 'woocommerce' ),
                                        esc_attr( $product_id ),
                                        esc_attr( $_product->get_sku() )
                                    ),
                                    $cart_item_key
                                );
                            ?>
                        </td>

                        <td class="product-thumbnail">
                        <?php
                        $thumbnail = apply_filters( 'woocommerce_cart_item_thumbnail', $_product->get_image(), $cart_item, $cart_item_key );

                        if ( ! $product_permalink ) {
                            echo $thumbnail; // PHPCS: XSS ok.
                        } else {
                            printf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $thumbnail ); // PHPCS: XSS ok.
                        }
                        ?>
                        </td>

                        <td class="product-name" data-title="<?php esc_attr_e( 'Product', 'woocommerce' ); ?>">
                        <?php
                        if ( ! $product_permalink ) {
                            echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) . '&nbsp;' );
                        } else {
                            echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $_product->get_name() ), $cart_item, $cart_item_key ) );
                        }

                        do_action( 'woocommerce_after_cart_item_name', $cart_item, $cart_item_key );

                        // Meta data.
                        echo wc_get_formatted_cart_item_data( $cart_item ); // PHPCS: XSS ok.

                        // Backorder notification.
                        if ( $_product->backorders_require_notification() && $_product->is_on_backorder( $cart_item('quantity') ) ) {
                            echo wp_kses_post( apply_filters( 'woocommerce_cart_item_backorder_notification', '<p class="backorder_notification">' . esc_html__( 'Available on backorder', 'woocommerce' ) . '</p>', $product_id ) );
                        }
                        ?>
                        </td>

                        <td class="product-price" data-title="<?php esc_attr_e( 'Price', 'woocommerce' ); ?>">
                            <?php
                                echo apply_filters( 'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); // PHPCS: XSS ok.
                            ?>
                        </td>

                        <td class="product-quantity" data-title="<?php esc_attr_e( 'Quantity', 'woocommerce' ); ?>">
                        <?php
                        if ( $_product->is_sold_individually() ) {
                            $product_quantity = sprintf( '1 <input type="hidden" name="cart(%s)(qty)" value="1" />', $cart_item_key );
                        } else {
                            $product_quantity = woocommerce_quantity_input(
                                array(
                                    'input_name'   => "cart({$cart_item_key})(qty)",
                                    'input_value'  => $cart_item('quantity'),
                                    'max_value'    => $_product->get_max_purchase_quantity(),
                                    'min_value'    => '0',
                                    'product_name' => $_product->get_name(),
                                ),
                                $_product,
                                false
                            );
                        }

                        echo apply_filters( 'woocommerce_cart_item_quantity', $product_quantity, $cart_item_key, $cart_item ); // PHPCS: XSS ok.
                        ?>
                        </td>

                        <td class="product-subtotal" data-title="<?php esc_attr_e( 'Subtotal', 'woocommerce' ); ?>">
                            <?php
                                echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item('quantity') ), $cart_item, $cart_item_key ); // PHPCS: XSS ok.
                            ?>
                        </td>
                    </tr>
                    <?php
                }
            }
            ?>

            <?php do_action( 'woocommerce_cart_contents' ); ?>

            <tr>
                <td colspan="6" class="actions">

                    <?php if ( wc_coupons_enabled() ) { ?>
                        <div class="coupon">
                            <label for="coupon_code"><?php esc_html_e( 'Coupon:', 'woocommerce' ); ?></label> <input type="text" name="coupon_code" class="input-text" id="coupon_code" value="" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" /> <button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?></button>
                            <?php do_action( 'woocommerce_cart_coupon' ); ?>
                        </div>
                    <?php } ?>

                    <button type="submit" class="button" name="update_cart" value="<?php esc_attr_e( 'Update cart', 'woocommerce' ); ?>"><?php esc_html_e( 'Update cart', 'woocommerce' ); ?></button>

                    <?php do_action( 'woocommerce_cart_actions' ); ?>

                    <?php wp_nonce_field( 'woocommerce-cart', 'woocommerce-cart-nonce' ); ?>
                </td>
            </tr>

            <?php do_action( 'woocommerce_after_cart_contents' ); ?>
        </tbody>
    </table>
    <?php do_action( 'woocommerce_after_cart_table' ); ?>
</form>

<?php do_action( 'woocommerce_before_cart_collaterals' ); ?>

<div class="cart-collaterals">
    <?php
        /**
         * Cart collaterals hook.
         *
         * @hooked woocommerce_cross_sell_display
         * @hooked woocommerce_cart_totals - 10
         */
        do_action( 'woocommerce_cart_collaterals' );
    ?>
</div>

<?php do_action( 'woocommerce_after_cart' ); ?>

How to add product short discription in mini cart magento 2?

First of all I’ve found mini cart phtml and tried paste code from the product page template but it didn’t help.

This method also doesn’t work for me:
Show short description under product title on mini cart

Does anybody know how to do that?

java – Trying to click a specific ‘Add to cart’ button from product list.But webdriver clicks ‘Add to cart’ button of very next product

   **//This my testng class**

public class EcommerceTest
{
public static WebDriver driver;

      @Test

      public void addtoCartTest() throws InterruptedException
      {
          driver.get("https://rahulshettyacademy.com/seleniumPractise/");
          driver.manage().window().maximize();
          EkartPage1 oekart = new EkartPage1(driver);
          oekart.AddtoCart();

      }
      @BeforeTest
      public void beforeTest() {
          System.setProperty("webdriver.chrome.driver", "E:\selenium\chromedriver_win32\chromedriver.exe");
          driver = new ChromeDriver();
          driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
      }

      @AfterTest
      public void afterTest() {
          //driver.close();
      }
}

/**/This my page object class**
public class EkartPage1 
{
    WebDriver driver;
    WebDriverWait wait;
    @FindBy(xpath = "//button(contains(text(),'ADDED'))")
    WebElement addedBtn;

    public EkartPage1(WebDriver driver)
    {
        wait = new WebDriverWait(driver, 30);
        PageFactory.initElements(driver, this);
        this.driver = driver;
    }
 **//This is my method to click Add to cart button**
    public void AddtoCart() throws InterruptedException /
    {
        String() additems = {"Cucumber","Beans"};
      List<WebElement> list = driver.findElements(By.cssSelector("h4.product-name")); 

      for(int i=0;i<list.size();i++)
      {
          String() productname = list.get(i).getText().split("-");
          String frmtdname = productname(0).trim();
          List itemsneeded = Arrays.asList(additems);

        if(itemsneeded.contains(frmtdname))
        {  

           List<WebElement> list2 =driver.findElements(By.xpath("//button(text() ='ADD TO CART')"));
           list2.get(i).click();
           System.out.println("One product added");

        }
      }

    }

I am trying to click on ‘Add to cart’ for the product ‘Beans.But the selenium webdriver clicks on ‘Add to cart’ button corresponding to ‘Brinjal’ which is the next immediate product.Kindly help me to resolve this issue.

usability – How to show “variants” of a product when adding to cart?

I have a list of products that the user is able to add to cart fastly so from main page the user could click just add to cart button on each product and the product will be added to the cart.

BUT each product could have some variants with which it can be added to the cart. Till now i’ve added the variants inside the modal with the product info which is opened when the user press on the product from the list, then at the bottom there is the list of variants which the user can select and then from that page add it to the cart.

So i thought to show the variants each time the user press the fast “Add to cart” button and remove the “Add to cart” and variants from the “info” modal but at this point that “Add to cart” will not be fast and as the most of the users will just not care about the variants it will affect their experience.

In the following gif you could see the main page with the list (and the blue button that is the fast “Add to Cart”) and when the product is pressed and it’s modal info is toggled with the variants and another “Add to cart” button.

enter image description here

And as you can see it’s not intuitive that the user can press each product and under all info there will be the variants…

So which would be the best way to give the user choice of adding or not the variants?

Responsive Domain and Hosting Shopping Cart – Cheapest Alternative to WHMCS – $9.99 (One Time Fee)


domainCart is a mobile responsive PHP shopping cart software for selling domain and hosting related services. Checking domain availability, whois lookup, adding domain and hosting related services to the shopping cart and completing order are all controlled from one page. It supports over 700 domain extensions, 28+ payment gateways, multi-currency with auto exchanger. It is the cheapest alternative to WHMCS and other Hosting billing systems.

All the tools you need to start a web hosting business today
domainCart comes with open source and fully customizable free responsive HTML5 web hosting template. The template can be used alone(eg. with any hosting billing script) or domainCart can be easily integrated to any other template, too.

Script Features
• Supports mobile responsive. It can be integrated to any web page layout by adding a few PHP codes.
• Works with over 700 domain extensions.
• Supports IDN (Internationalized Domain Name).
• Determines domain availability.
• Ability whois search
• Easy to include only the domain extensions you wish to sell and support.
• Any registration periods and prices allowed for each domain extension.
• Supports domain transfer.
• Option to select hosting package for each domain name.
• Providing free or discounted domain with hosting (minimum required hosting price can be determined).
• Buying a hosting with a domain can be set as mandatory.
• Minimum order amount can be set to add a product to the cart.
• Built in support for 2checkout, Paypal, Skrill, Nochex, E-Gold, Worldpay Futurepay, Ideal(ING, Rabo, ABN AMRO), Paymate, CDGCommerce, Authorize.net, Payza, OKPAY, Cashu, DIXIPAY, OneCard, CCAvenue, PayFast, Stripe, Payeer, SolidTrustPay, PerfectMoney, PayU Latam, Webmoney, Paytm, Manual(for SEPA Direct Debit, Bank Transfer or other offline payments) and Custom(Credit Card or other payments with any your own payment gateway) processing.
• Supports monthly recurring billing on Paypal, Worldpay Futurepay, CDGCommerce and Payza.
• Sends email to buyer and vendor with order details at checkout(supports SMTP authentication).
• Supports Tax.
• Supports any currency symbol or name. You can define right and left currency symbols and currency code(for default and each payment gateways separately)
• Multi-Currency support. Supports auto and manual currency exchange. It can be convert default currency to payment gateway’s currency automatically. It gets exchange rates from European Central Bank’s daily rates. Or you can define exchange rates manually for each payment gateway. All prices and currency appear as payment gateway’s on order statement emails.
• Uses one language file for easy translation.
• User defined fields for order form.
• User defined email messages.
• Blocking orders from specific email addresses.
• Supports sending SMS text alert to seller and buyer when order received(It requires Clickatell.com account).
• Supports advanced multiple coupon system. You can define any number of coupon codes offering different discounts for Domain, Hosting first and recurring payments.
• Supports Google’s reCAPTCHA v3.
• Excellent documentation and more..

Requirements
It required PHP 7+ only. It works on all servers(Linux, Windows.. etc.) whether shared/reseller or dedicated.

Demo – without template | Demo – with integrated template

>>> Buy Now <<<
(domainCart v5.47 Owned License (Includes Free Responsive HTML5 Web Hosting Template) is only $9.99 for a limited time. It is one time fee and can be used under any domain forever with no requirement to renew.