Questions tagged [cart]

An internet cart, also known as an online shopping cart, is a virtual tool used to make purchases on the web. For inquiries regarding CART (Classification and Regression Trees), please utilize the [cart-analysis] tag or determine if the subject matter would be better suited for Cross Validated or Data Science Newtab Q&A.

Substitute a specific character in the titles of WooCommerce cart item variations with a pipe symbol

Is there a way to remove comma separation from the product attribute on my checkout page? For example: Blue Black Raw Denim - 37, Slimfit 37 is attributed as the product size, and slimfit is the model of the product. I would like to either remove the co ...

Only the data from the first row will be accepted by jQuery, no other data will be

Encountering a problem with jquery. I have a dynamically created <table>. foreach ($_cards as $_card){ $tabOdd = ""; $statusInd = ""; $counter++; if ($counter % 2 != 0){ $tabOdd = "style='background-color:#eee' ...

Having trouble with adding a product to your cart after using the add_filter() function in woocommerce_add_to_cart_validation

In my current scenario, a non-logged-in user is restricted to adding only one product to their cart. I have implemented a filter on woocommerce_add_to_cart_validation that seems to be working correctly with $woocommerce->cart->cart_contents_count&g ...

Can the items in the shopping cart be transferred from a guest to a logged-in

I implemented the shopping cart package from https://github.com/darryldecode/laravelshoppingcart Currently, my authentication system only requires a username without a password The issue I am facing relates to sessions As a guest user, the session code a ...

Customize WooCommerce Cart Price by Passing Dynamic Price Variables to Custom Price Hook

I've been struggling to pass a dynamically generated custom price stored in a variable to a hooked function within the woocommerce_before_calculate_totals hook in the cart. Unfortunately, my current setup doesn't seem to be working as expected. ...

"Automatically adjust the product quantity in your WooCommerce cart with a simple code snippet

I'm working on a function that hooks into the woocommerce_before_calculate_totals event to apply a discount on a specific product when a particular coupon is used. To prevent abuse, I want to ensure that the quantity of the discounted item remains at ...

Get rid of the add to cart message and modify the button that says "add to cart" on Woocommerce

How can I modify the shopping cart page to remove the "has been added to your cart" text and replace the quantity and add to cart button with a custom button (my image)? Here is an example of what I am trying to achieve: This is the current state of the p ...

What is the method for including a message within the Ajax success function?

This is my HTML <div class="top-item-grid-body" id="item-grid-${entry.entryNumber}"></div> This is my Ajax $.ajax({ type:'GET', data:"", url: 'cart/delete?cartEntryNumber='+entryN ...

"Encountering an issue with CodeIgniter where the cart feature

Having just started with CI, I am currently working on developing an e-commerce website. However, I am facing challenges when it comes to adding products to the cart. Below, you can find the code for both the Jscript and controller that I have been using. ...

Automate the removal of a designated shipping method in WooCommerce through programming

I need a solution to hide UPS shipping options on the cart and checkout pages when the total weight of items in the cart exceeds 150lbs. Here is my proposed code snippet: function disable_ups_shipping_over_onefifty($available_methods){ global $ ...

``Why does Ajax continuously update the same session cart instead of adding a new element to it in PHP and MySQL?

Need some assistance with a shopping cart feature I'm working on. When adding items to the cart using an ajax request, it updates the cart instead of appending new elements. The old value is replaced. Here's the code snippet: function addPro ...

Determine if Products are Currently in Cart in WooCommerce

Recently, I came across a helpful code snippet on this website Here is a function that can be used to check if a specific product is already in the cart: function checkProductInCart($product_id) { global $woocommerce; fo ...