cart

How to remove the single cart item using codeigniter cart class?

萝らか妹 提交于 2019-12-04 13:55:43
I am using codeigniter cart class for my shopping cart project. I have number of items on the cart. Now I do have cart row id. Now what exactly i need to do is, need to remove the particular item from the cart not all the contents(Destroying cart). $cartcontents = $this->cart->product_options($rowid); and unseting all contents. but doesn't works out. Please do help you anybody have an idea. Thank You. $data = array( 'rowid' => '30ef30b64204a3088a26bc2e6ecf7602', 'qty' => 0 ); $this->cart->update($data); use this Use "removeCartItem" function in your controller to do this... function

Display Custom Field's Value in Woocommerce Cart & Checkout items

浪子不回头ぞ 提交于 2019-12-04 13:37:44
I have been looking for a solution for a while all over internet but couldn't find any proper solution. I am using several custom fields in my product page like, 'Minimum-Cooking-Time', 'Food-Availability' etc. So, I like to show this custom field's value in my cart and checkout page. I tried snippets in function file and editing woocommerce cart file too. I have tried several codes but they are not pulling any data from my custom fields. As you can see in the screenshot below, I want to show 'Minimum-Cooking-Time' in that black rectangular area for every product: I have used the following

Changing colors for decision tree plot created using export graphviz

自闭症网瘾萝莉.ら 提交于 2019-12-04 08:17:22
I am using scikit's regression tree function and graphviz to generate the wonderful, easy to interpret visuals of some decision trees: dot_data = tree.export_graphviz(Run.reg, out_file=None, feature_names=Xvar, filled=True, rounded=True, special_characters=True) graph = pydotplus.graph_from_dot_data(dot_data) graph.write_png('CART.png') graph.write_svg("CART.svg") This runs perfectly, but I'd like to change the color scheme if possible? The plot represents CO 2 fluxes, so I'd like to make the negative values green and positive brown. I can export as svg instead and alter everything manually,

Retrieve data from cart and send using mail

拜拜、爱过 提交于 2019-12-04 06:47:41
问题 This project is with E-Commerce. There is option to Add to Cart . When user click on add, product will be added to his cart as well and working fine. But finally when user click place order button Admin will receive Mail with products. That E-mail body should content should display like below. I tried with using foreach and echo data row by row. But its useless . Question is - I want retrieve data from cart and add to Above table Format and then it will end with mailing. How to archive this

Set programmatically product sale price and cart item prices in Woocommerce 3

半腔热情 提交于 2019-12-04 05:35:44
问题 This is the continuation of : Set product sale price programmatically in WooCommerce 3 The answer works, however once a user adds the product to cart, the old price still shows up on checkout. How to get the correct sale price on cart and checkout pages for cart items? Any help is appreciated. 回答1: The missing part to get it work for for cart and checkout pages (and also Orders and email notifications too) is a very simple trick: add_action( 'woocommerce_before_calculate_totals', 'set_cart

Woocommerce: Display Product Variation Description on Cart page

▼魔方 西西 提交于 2019-12-04 05:30:33
I'm trying to display my product variation description in my Cart. I have tried inserting this code in the cart.php template: if ( $_product->is_type( 'variation' ) ) {echo $_product->get_variation_description();} By following this documentation https://docs.woocommerce.com/document/template-structure/ But it's still not showing up. Not sure what I'm doing wrong here. Can anyone help on this? Thanks UPDATE COMPATIBILITY for WooCommerce version 3+ Since WooCommerce 3, get_variation_description() is now deprecated and replaced by the WC_Product method get_description() . To get your product item

Checkout price issue using woocommerce_product_get_price hook

依然范特西╮ 提交于 2019-12-04 04:46:31
问题 I need to double the price for every product in Woocommerce frontend. For this I used the following code: add_filter( 'woocommerce_product_get_price', 'double_price', 10, 2 ); function double_price( $price, $product ){ return $price*2; } But there is an error using this code. checkout page price is not correct. for example the product orginal price is 10. We double the price by this code . so the product price is 20 now. When i added this product to the cart then cart and checkout page price

WooCommerce: How to retain checkout info when client leaves then comes back?

匆匆过客 提交于 2019-12-04 04:17:52
Is there a simple way or a plugin to retain checkout information entered by the client after he/she leaves and comes back? This plugin retains "fields information for customers when they navigate back and forth" however it has quite a lot of recent bad reviews so I don't think I'll use that for production. Any alternative suggestion? ---- Update ---- The code below is working, but only if data is submitted! The only possible ways are javascript/jQuery form event detection on checkout fields and worpress Ajax: Using ajax connected to some session transients function (as in code below) . Using

Opencart cart across multiple stores with different subdomains

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 21:15:53
Hi have a single opencart install setup with several stores with different subdomains (all under the same domain). I want customers to be able to put items in the cart on one site, then move onto the next and put in more or even subtract, till eventually a customer checkouts out on any store. Note products might appear in one store but not another. I notice opencart does this somewhat. ie it will bring products already in the cart to the next store but only if the products appear in both stores. Further if a customer then deletes one of the items and moves back to the same store, they product

Add custom fields as cart item meta and order item meta in WooCommerce

夙愿已清 提交于 2019-12-03 20:31:31
问题 This is a plugin on how to add add cart item meta & order item meta for my WooCommerce order. Initially my code below worked well for input type=text. It returns the label for value and the inputed value. On conversion to type=checkbox the code returns label and value="on" for those that are checked. I would like to return the only value names of checked values (ignore the values unchecked). A refactor to help include more checkboxes options would be helpful to reduce written code. My code: <