• Resolved kwiltkrazy

    (@kwiltkrazy)


    ugh….been trying to figure this out all day. My site has been working fine for quite a while. This morning I got an email from a customer stating they could not add items to their cart. It works for me on the back end but when I logout of WP and try on the front end nothing is added to the cart. I have changed Themes to see if that was the issue and it doesn’t seem to be. I have cleared cache and contacted my hosting service. They don’t find an error on their end either. whaaaa

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • hi there
    your website facing some errors

    Fatal error: Call to undefined function is_checkout() in /*/*/*/*/plugins/gift-cards-for-woocommerce/includes/scripts.php on line 67

    fix it and I`ll try to help you out with the add to cart part

    Thread Starter kwiltkrazy

    (@kwiltkrazy)

    Thanks, I have now deleted that plugin

    Thread Starter kwiltkrazy

    (@kwiltkrazy)

    I also deactivated each plugin one by one to see if one of the plugins was the issue. Very odd that everything works as normal except for add to cart on the front end. Like I said it adds to the cart fine on the back end. Then I logout of wordpress and try to add to cart and it fails.

    • This reply was modified 6 years, 10 months ago by kwiltkrazy.

    first
    go to /wp-content/plugins/woocommerce/templates/single-product/add-to-cart
    via ftp.
    and rename variation-add-to-cart-button.php to variation-add-to-cart-button1.php
    this step just a back up file “just in case.

    and make a new .php file and name it variation-add-to-cart-button.php
    and add the next code in it

    
    <?php
    /**
     * Single variation cart button
     *
     * @see 	https://docs.woocommerce.com/document/template-structure/
     * @author  WooThemes
     * @package WooCommerce/Templates
     * @version 3.0.0
     */
    if ( ! defined( 'ABSPATH' ) ) {
    	exit;
    }
    
    global $product;
    ?>
    <div class="woocommerce-variation-add-to-cart variations_button">
    	<?php
    		/**
    		 * @since 3.0.0.
    		 */
    		do_action( 'woocommerce_before_add_to_cart_quantity' );
    
    		woocommerce_quantity_input( array(
    			'min_value'   => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
    			'max_value'   => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
    			'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( $_POST['quantity'] ) : $product->get_min_purchase_quantity(),
    		) );
    
    		/**
    		 * @since 3.0.0.
    		 */
    		do_action( 'woocommerce_after_add_to_cart_quantity' );
    	?>
    	<button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
    	<input type="hidden" name="add-to-cart" value="<?php echo absint( $product->get_id() ); ?>" />
    	<input type="hidden" name="product_id" value="<?php echo absint( $product->get_id() ); ?>" />
    	<input type="hidden" name="variation_id" class="variation_id" value="0" />
    </div>
    

    and let me know if something change.

    seems all good

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Woocommerce Cart not adding items for customer’ is closed to new replies.