cart

Magento Upgrade 1.7 > 1.9 DB Issue

浪尽此生 提交于 2019-12-11 07:39:32
问题 I upgraded Magento 1.7 to 1.9 and after upgrade the add-to-cart doesn't work anymore. It is not connected to the form_key! Why i think it is a database issue: I used clean magento 1.9 with clean database and created one product, add-to-cart works fine. I connected this magento with the database i upgraded and add-to-cart didn't work. So clean Magento with "old" database doesn't work on add-to-cart. Has anyone an idea how to solve this? I don't really want to use a clean database and move data

Price in Cart is not correct Magento 1.8

半腔热情 提交于 2019-12-11 06:46:29
问题 Today I've run into a new problem and can´t find a solution. I've added some simple products and configurable products via MagMI. Everything is fine. Products are shown in the front-end as I want it. But following happens: simple product 1 has a price of 49€, simple product 2 has a price of 90€. Both are part of the same configurable product which has a price of 49€. Now, in cart, the single-price of both simples is 49€. (If I print out $_item->getSku() I get the right skus of the simple

Redirect to home if the cart is empty in Woocommerce

谁说胖子不能爱 提交于 2019-12-11 06:38:09
问题 I am looking for and can not find anywhere as I can redirect the empty woocommerce cart to the homepage. I only find redirects that go to the store. This is what I find, but I do not need to redirect to the home: add_action("template_redirect", 'redirection_function'); function redirection_function(){ global $woocommerce; if( is_cart() && WC()->cart->cart_contents_count == 0){ wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'shop' ) ) ); } } Context link: if cart is empty, the cart

WooCommerce modify cart totals programmatically

独自空忆成欢 提交于 2019-12-11 06:09:29
问题 I'm trying to change the cart totals with code but I don't know how. I have managed to change the price for each item in the cart using the filter woocommerce_cart_item_price . Is there such a filter for the cart totals(see arrow in picture)? This is the code for each individual item: add_filter( 'woocommerce_cart_item_price', 'func_change_product_price_cart', 10, 3 ); function func_change_product_price_cart($price, $cart_item, $cart_item_key){ if ( isset($cart_item['tau_lengde']) ) { if ( WC

Deposit based on a percentage of total cart amount

天大地大妈咪最大 提交于 2019-12-11 06:08:22
问题 I've taken this code from another post and basically from my understanding, this code is trying to force the cart price to change to a fixed amount of $40 and charge it as a booking fee. What I want to do is force the cart amount to be 20% of what the total would be based on adding up all the products in the cart. My site is for reservations , so I only want to charge a deposit and then have them pay when they use their reservation. Here is the code from this post: Woocommerce cart deposit

Back to cart button on checkout page

巧了我就是萌 提交于 2019-12-11 06:07:04
问题 Is there any solution to display a "back to shopping cart" button on the WooCommerce checkout page? Actually there is only a complete order button, but we need a back button, if a user want to correct his order. Thanks. 回答1: Yes it's possible to display a custom notice with a "Back to Cart" button on checkout page. Here is that custom hooked function in woocommerce_before_checkout_form action hook: add_action( 'woocommerce_before_checkout_form', 'return_to_cart_notice_button' ); function

Discount based on cart items count and product categories

☆樱花仙子☆ 提交于 2019-12-11 05:59:39
问题 I am trying to add a custom cart discount based on a minimal cart item count and categories. I have take the code from this answer: Cart discount based on cart item count and only for items that are not in sale I have made some changes to it and this is my code: add_action('woocommerce_cart_calculate_fees' , 'my_custom_discount', 10, 1); function my_custom_discount( $cart_object ){ if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; // Only when there is 4 or more items in cart if( $cart

Display product custom fields in cart next to each item name in Woocommerce

无人久伴 提交于 2019-12-11 05:26:33
问题 I have a store where each product has different delivery date. I have this date stored in a custom field called shpng using ACF. What I'm trying to achieve is to display appropriate field next to each product in cart. What I tried so far is that I tested approximately 10 solutions listed on SOF (example) and on the other sites, but none of them seems to work. I know how to display this data, I just don't know how to display it for each product below product title. I'm looking for someone to

Custom cart item price when applying coupon for a category in Woocommerce

妖精的绣舞 提交于 2019-12-11 05:08:46
问题 We have some products in shop , and we are giving some coupons to customer . product -> ABC price 10 coupon code is 'newcp' discount 20%; so when people add the product to cart price will be 10 . Then they apply coupon then original product price shown as 10 and calculate 20% from that and at the end the total will be 8 But now we need to change this as per specific condition When people apply product coupon newbc 1)if coupon is newcp , then change order_item_price as order_item_price +3 [

Auto apply or remove a coupon in Woocommerce cart for a specific product id

▼魔方 西西 提交于 2019-12-11 04:29:23
问题 I am applying automatically a coupon when there is a product id 1362 in the cart, but when someone adds another product and delete the 1362 the coupon stays applied, how to prevent this by removing the coupon if there is no 1362 product id in the cart with Woocommerce ? I know we can restrict coupon to a product but i don't want this, i want my coupon to be applied to all products cart only if there is the product with id 1362 in this cart. add_action( 'woocommerce_before_cart', 'bbloomer