Questions tagged [cart]

A web cart or online shopping cart is a web app used to shop online. **For questions related to CART -- Classification and Regression Trees -- use the tag [cart-analysis], or consider whether the topic is more appropriate for Cross Validated or Data Science Stack Exchange**

3190 questions
6
votes
2 answers

Restricting cart items to be from the same product category in WooCommerce

I am using the code below to remove other WooCommerce product category items from the cart when there is an item with a special product category 'cat_x' added in cart and display some different custom notices. The code came from this thread and just…
6
votes
1 answer

Want to build a decision tree when i have 4 categories in my dependent variable

I want to build a decision tree but I have 4 categories(1,2,3,4) in my dependent variable. How can I build? I am familiar with rpart package which can be used for binary dependent variable. I think if we have more categories then we need to build…
Sanchit Aluna
  • 455
  • 2
  • 6
  • 20
6
votes
1 answer

Remove add to cart button for a specific user role in WooCommerce

In my virtual store using the Divi theme along with woocommerce I have the two groups of users: end users and my resellers, in the case of my end client would need only appear the “buy” button. Already for my resellers only the “add to order” button…
6
votes
1 answer

Woocommerce add to cart ajax and mini-cart

I need to re-populate mini-cart when product added via ajax add to cart. I manage to update cart quantity with filter woocommerce_add_to_cart_fragments like this: add_filter( 'woocommerce_add_to_cart_fragments', function($fragments) { …
RomkaLTU
  • 3,683
  • 8
  • 40
  • 63
6
votes
3 answers

Allow checkout only when a product of a mandatory category is in cart

I'd like to stop any customer advancing to the checkout if they do not have a particular product category in their basket. I would also like to tell them with an error message that they need to add a certain product. I've found some code but cannot…
Mike Devitt
  • 115
  • 1
  • 6
6
votes
1 answer

How to pass custom variable in cart?

I am using Opencart 2.0.1.1. There is hidden text field on product page that I want to post on cart page. I am following this tutorial but getting Undefined index issue. I have done the following…
Triyugi Narayan Mani
  • 3,039
  • 8
  • 36
  • 56
6
votes
2 answers

Rails: Updating quantities in shopping cart

Ruby newbie here. I'm going through Agile Web Development With Rails. In chapter 11 it challenges you to add a 'decrease quantity' button to items in the shopping cart. I went ahead and tried to implement an increase link as well. The problem is…
tdog
  • 147
  • 2
  • 10
6
votes
1 answer

Updating cart count on pressing of back button after deletion

I have two activities, one is UserActivity and other one is CartActivity I am showing a list of products in UserActivity. On click of a button AddtoCart I am adding the products to the cart. I am facing this problem: When I add click the button…
gautamprajapati
  • 2,055
  • 5
  • 16
  • 31
6
votes
3 answers

WooCommerce - Getting total products count in the cart - not their quantity

I have total cart quantity but I need count of products available in the cart. I donot want to show total quantity but want to show total products/orders in the cart. Please help!
6
votes
1 answer

Which is the best shopping cart for Laravel 5?

I want to build online store with Laravel 5. The framework is new to me. So the question is Which is the best shopping cart for Laravel 5?
yanko-belov
  • 503
  • 2
  • 6
  • 15
6
votes
0 answers

PHP Shopping cart - Categories page not working as wanted

I have 2 tables products and categories (CatParentId 0 is the parent category). What I am trying to achieve is when a user clicks on the parent category, it should fetch the products listed in that category as well as it's child category products…
Saiyan Prince
  • 3,930
  • 4
  • 28
  • 71
6
votes
3 answers

Create a new Prestashop cart in custom php

In Prestashop, I've created a custom form where I show a list with all products and the user can fill the corresponding quantities. By submitting the form, I clear the cart and fill it with the new values and finally redirect to the checkout…
6
votes
5 answers

Magento override controller

I would like to do the above. Ive overridden many files in the past...block, model, helper....but this one eludes me. Can anyone see what im doing wrong here: (ive edited this code...to include some of the recomendations now...) Heres my folder…
ShaunTheSheep
  • 271
  • 1
  • 10
  • 26
5
votes
2 answers

Magento, getSubtotal and getGrandTotal always return zero

I have a weird problem. I have developed a module which adds a line to totals according to some value in database. But in my module model (which is inherited from Mage_Sales_Model_Quote_Address_Total_Abstract) when I…
UnfoX
  • 135
  • 1
  • 12
5
votes
1 answer

Woocommerce WC()->cart->set_cart_contents() not working

I have a custom pricing WP page with pricing table. There I get 3 parameters, namely, $product_id, $quantity, $total_price. I've created the products as normal WC products, gave each an initial price, description...etc, and obtained the IDs. Then…
TDEgypt
  • 85
  • 1
  • 9