cart

WooCommerce - Adding shipping fee for free user plan

会有一股神秘感。 提交于 2019-12-02 04:29:00
问题 I am using WooCommerce and with Paid Memberships Pro free plugin. On the web site we have 2 plans (a free plan and a paid plan): Free users can buy 1 item each month, Paid users can buy 4 items each months. Now I don't know how to simply calculate shipping on checkout page with code like: if (pmpro_hasMembershipLevel('2')) { // Paid plan //free shipping (0$) } else { //add shipping 4$ to checkout } No shipping class, No region zone is affect shipping price. I have tried to set Shipping

CART algorithm of matlab 'fitctree' takes account on the attributes order why ?

这一生的挚爱 提交于 2019-12-02 04:23:15
问题 here is an example mentionning that fitctree of matlab takes into account the features order ! why ? load ionosphere % Contains X and Y variables Mdl = fitctree(X,Y) view(Mdl,'mode','graph'); X1=fliplr(X); Mdl1 = fitctree(X1,Y) view(Mdl1,'mode','graph'); Not the same model, thus not the same classification accuracy despite dealing with the same features ? 回答1: In your example, X contains 34 predictors. The predictors contain no names and fitctree just refers to them by their column numbers x1

Only one currently added product into Woocommerce cart?

家住魔仙堡 提交于 2019-12-02 03:55:25
I would like Woocommerce to only allow 1 product in the cart. If a product is already in the cart and another one is added then it should remove the previous one. I found this code on net: /** * When an item is added to the cart, remove other products */ function custom_maybe_empty_cart( $valid, $product_id, $quantity ) { if( ! empty ( WC()->cart->get_cart() ) && $valid ){ WC()->cart->empty_cart(); wc_add_notice( 'Only allowed 1 item in cart, please remove previous item.', 'error' ); // here instead popup notice need to remove prevous added product } return $valid; } add_filter( 'woocommerce

Display cart item count in Woocommerce cart widget

时光毁灭记忆、已成空白 提交于 2019-12-02 03:25:23
I am trying to display the count of the items in the cart at the bottom or top of the Woocommerce cart widget. It seems that by default behaviour the cart widget does not do this when in the sidebar. I have researched SO and found the following answer , but it has a slightly different goal of adding individual subtotals. I have tried modifying it, by passing in WC()->cart->get_cart_contents_count() instead of WC()->cart->get_cart() to see if I can get the cart item count, but it's not displaying...any suggestions? Example of what I am trying to do: Code I have modified from the approved answer

Cart discount for a product category based on quantity calculations

假装没事ソ 提交于 2019-12-02 02:14:11
I wan to add a function to woocommerce that will calculate a 10% discount when 12-23 items from one category is added to the cart. Then if 24 - 47 items of the category are added it would be a 15% discount. Last if 48+ items from this category are added it would be a 20% discount. actual code example would be awesome as I am new to woocommerce LoicTheAztec Updated — Corrected code mistakes and added enhancements in the outputted discount text Here is the function hooked in woocommerce_cart_calculate_fees hook that is going to make the discount for that particular category (or subcategory too)

how to make opencart multi-store share same cart over multiple TLDs?

牧云@^-^@ 提交于 2019-12-02 02:05:44
问题 I have the following scenario: domain1.com - store1 - opencart 1.5.6 installed domain2.com - store2 domain3.com - store3 I managed to install all 3 stores on different domains and all of them are using the same opencart install (store1). So far all seems to work properly. What I need is when the user is on domain1.com , adds product1 in his cart, then navigates to store2 (domain2.com) and adds product2 in his cart - now he should have both product1 from shop1 and product2 from shop2 in his

WooCommerce - Adding shipping fee for free user plan

久未见 提交于 2019-12-02 01:37:55
I am using WooCommerce and with Paid Memberships Pro free plugin . On the web site we have 2 plans (a free plan and a paid plan): Free users can buy 1 item each month, Paid users can buy 4 items each months. Now I don't know how to simply calculate shipping on checkout page with code like: if (pmpro_hasMembershipLevel('2')) { // Paid plan //free shipping (0$) } else { //add shipping 4$ to checkout } No shipping class, No region zone is affect shipping price. I have tried to set Shipping options, but I can’t get rid of it. How can I achieve this? Thanks. LoicTheAztec Since WooCommerce 2.6+,

how to make opencart multi-store share same cart over multiple TLDs?

你离开我真会死。 提交于 2019-12-02 01:33:09
I have the following scenario: domain1.com - store1 - opencart 1.5.6 installed domain2.com - store2 domain3.com - store3 I managed to install all 3 stores on different domains and all of them are using the same opencart install (store1). So far all seems to work properly. What I need is when the user is on domain1.com , adds product1 in his cart, then navigates to store2 (domain2.com) and adds product2 in his cart - now he should have both product1 from shop1 and product2 from shop2 in his cart. In other words, all stores should behave like one, if the user is logged in into store1 then he

Hide specifics Flat Rates when Free Shipping is available in WooCommerce 3

我只是一个虾纸丫 提交于 2019-12-02 00:39:40
In WooCommerce 3, I have these shipping options (settings): Free Shipping: free_shipping:1 - Minimum order amount is set at $50 . Normal Shipping flat_rate:3 - Amount $5 . Express Shipping flat_rate:5 - Amount $10 . I would like Express Shipping option to be always available (shown). But when Free shipping is available (meaning that the customer has more than $50 in the cart) I would like to hide Normal Shipping only. So when Free shipping is NOT available (and hidden), the available shipping rates will be Normal Shipping and Express Shipping. Is that possible? How can I get this on

Dynamic price calculation based on custom field in Woocommerce

☆樱花仙子☆ 提交于 2019-12-02 00:10:41
问题 In Woocommerce on each product page there is a Text Box, which allows users to enter their own custom text. This text is then applied to the product, with the customer being charged on a per letter basis. I have managed to get everything working, apart from the Maths Logic. When a visitor enters x amount of letters, the current Maths logic correctly calculates the Product Price + Cost of Custom Letters and outputs this sum to the Basket Widget. Where I am running into problems, is when the