cart

Cart products dissapear on refresh page Prestashop

淺唱寂寞╮ 提交于 2019-12-07 07:42:26
since some weeks I have a problem with my Prestashop 1.4.0.12 When I add a product to cart, ajax works correctly and add the product very well. But, if I change page, or sometimes adding a product, the cart change deleting all products on refresh a new page. Sometimes I can move within some pages, but dissapears the products of the cart and later if I have a new cart returns to the old cart. Anybody knows about it? I think that the problem is on id_guest but I need to know if anyone have some solution Thanks! The problem is on Domain Name, that site have 3 domains, and there are a function on

Accessing shipping cost in Magento's cart and/or checkout

拥有回忆 提交于 2019-12-07 06:14:06
问题 Please note, this question is regarding the shipping cost, not price. There is an important difference, i.e. what $$ charge the shipping method incurs for the store owner, as opposed to what is $$ charge is paid by the customer. The shipping_tablerate database table includes a cost field, which is populated in the Mage_Shipping_Model_Carrier_Tablerate object during the collectRates method. However, that field is not accessible anywhere else in the stack, e.g. from a quote's address. I need to

Conditional add fees to cart

99封情书 提交于 2019-12-07 02:54:48
问题 We have a website that sells computer parts, There's a section in this website called "Assemble your PC" that allows users to choose parts( mainboard - cpu - ram ,etc. ) and pay the price and get their assembled product, everything works just fine, but it needs an option to add an "assembly fee" to cart. This fee should be added only if user goes trough the "Assemble your PC" wizard process. I'm using this code but it adds it to all carts , i mean it's not conditional. public function

How to find out product id from “woocommerce_cart_item_removed” hook?

天大地大妈咪最大 提交于 2019-12-07 00:47:26
I have code add_action( 'woocommerce_cart_item_removed', 'after_remove_product_from_cart' ); function after_remove_product_from_cart($removed_cart_item_key, $instance) { $product_id = $removed_cart_item_key['product_id']; } I want to find out a way to get product id or actual product object itself using $removed_cart_item_key. How do you do it? I cannot find any references, thanks. should be something like this... add_action( 'woocommerce_cart_item_removed', 'after_remove_product_from_cart', 10, 2 ); function after_remove_product_from_cart($removed_cart_item_key, $cart) { $line_item = $cart-

Disable WooCommerce Payment methods if cart item quantity limit is reached

百般思念 提交于 2019-12-06 15:20:41
Is there a way or filter to disable selective payment methods if cart quantity increase more than "X number of items" example "15"? I know we can limit max number of quantity before adding to cart but I want to disable some payment methods only. Thanks You can use a custom function hooked in woocommerce_available_payment_gateways filter hook. You will have to set inside it your quantity limit and your payment methods slugs. Here is that code: add_filter('woocommerce_available_payment_gateways', 'unsetting_payment_gateway', 10, 1); function unsetting_payment_gateway( $available_gateways ) { //

Remove duplicated shipping packages using a shipping class in Woocommerce

五迷三道 提交于 2019-12-06 14:39:59
The products in my website are handled by one of that 2 shipping plugins: Printful Integration for WooCommerce and Printify for WooCommerce Shipping . when there is mixed items from each shipping plugin. Those plugins split each one the shipping package in two when there is mixed items (which is a a conflict and a problem) . So I have added a shipping class 'printful' (which id is 548 ) to the products that are handled by the Printful plugin , and tried to adjust Hide shipping method for specific shipping classes in woocommerce answer code by @LoicTheAzec (cheers), to only remove the shipping

Change Cart total using Hooks in Woocommerce 3.2+

对着背影说爱祢 提交于 2019-12-06 14:35:36
I want to add 300 to order total on woocommerce checkout page but woocommerce_calculate_totals hook doesn't do the job... If I use var_dump($total), I see the correct result - int(number), but the total amount in order table is not changing. add_action( 'woocommerce_calculate_totals', 'action_cart_calculate_totals', 10, 1 ); function action_cart_calculate_totals( $cart_object) { if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; if ( !WC()->cart->is_empty() ): $total = $cart_object->cart_contents_total += 300; var_dump($total); endif; } Since Woocommerce 3.2, the hook woocommerce_calculate

How to clear all produts from cart in PrestaShop

对着背影说爱祢 提交于 2019-12-06 11:42:00
问题 I am using PrestaShop version 1.5.4.1 Currently, my cart has separate delete buttons for each product. How can I remove all the products in one action? I just need to empty the cart in one click. I have used this code in ordercontroller and call the function from themes/defaulte/shoopin-cart.tpl public function emptybag() { $products = $this->getProducts(); foreach ($products as $product) { $this->deleteProduct($product->id); } } 回答1: Many things : $this->getProducts() won't work in the order

Paypal Express Checkout: Mixed Recurring and Non-Recurring Items

血红的双手。 提交于 2019-12-06 11:12:46
问题 I am working on our company cart which contains products that people can either subscribe to or just buy outright. The problem is that it should require customers to add both types in a single order. Question: It is possible to to tell Paypal to charge selected items as subscription and the others as one-time payments? Thanks in advance. 回答1: According to the advanced features documentation page 47/48, this is possible by calling SetExpressCheckout with the recurring products as

Hide “remove item” from cart for a specific product in WooCommerce

扶醉桌前 提交于 2019-12-06 10:52:09
I'm using woocommerce for my website, I want to hide "remove this item/product" for one particular item, can you please tell me how can I do so. I would greatly appreciate any help towards this. Updated (for multiple product Ids in an array) Here is the correct way to disable/remove the "Remove this item" button, for a specific product ID (that you should define) in the code below: add_filter('woocommerce_cart_item_remove_link', 'customized_cart_item_remove_link', 20, 2 ); function customized_cart_item_remove_link( $button_link, $cart_item_key ){ //SET HERE your specific products IDs $targeted