cart

Woocommerce Change shipping method title on checkout based on shipping class selected

懵懂的女人 提交于 2021-02-19 06:52:04
问题 I want to change the shipping method title displayed in the checkout of my store based on the shipping class the product has. e.g. Shipping method title is currently Flat Rate and I have 2 products: If product A is being purchased I need it to have "Fragile shipping" If product B is being purchased I need it to have "Standard shipping" Sadly I have to do my shipping using classes so alternative methods won't work. Any help would be appreciated. 回答1: The following code will rename your

swift data not transferred from UIBarButtonItem to another viewcontroller

核能气质少年 提交于 2021-02-17 06:52:27
问题 This is an extension of an earlier question:- ios Swift Items do not get added to cart The original issue is resolved. Now I have a supplementary hitch:- The issue is in CartViewController - When I click on "Checkout(2)" rightBarButtonItem in the ProductViewController, it shows error in CartviewController's "numberOfRowsInSection" function - Kindly see image & codes below:- class ProductViewController - import UIKit class ProductViewController: UIViewController, UITableViewDataSource,

Add a product add-on field to specific products on WooCommerce

一个人想着一个人 提交于 2021-02-17 03:22:57
问题 I need to change the code to not display text area on all of my WooCommerce products but only 2, this is on my WordPress child theme under functions.php file. I have changed $product_id to $product_id = 2130 (my specific product id) , not sure if I'm supposed to change all the $product_id or $_POST for this code to display on only 2 products It is for a specific product or products that gets personalized with a name. I have tried changing the code $product_id to numerous other extensions to

Save and load shopping cart with LocalStorage

懵懂的女人 提交于 2021-02-16 21:26:19
问题 I have the following code: inames = []; iqtyp = []; iprice = []; function bestel() { inames.push(document.getElementById('artikel').innerHTML); iqtyp.push(parseInt(document.getElementById('hoeveel').value)); iprice.push(parseInt(document.getElementById('prijs').innerHTML)); displayCart(); } function displayCart() { cartdata = '<table><tr><th>Product Name</th><th>Quantity</th><th>Price</th><th>Total</th></tr>'; total = 0; for (i = 0; i < inames.length; i++) { total += iqtyp[i] * iprice[i];

Get selected item and its count

岁酱吖の 提交于 2021-02-16 15:13:12
问题 I am trying to make a shopping cart app like this site but using reactjs . index.js : (Sending each product to product component ) {products.length > 0 ? products.map((product) => ( <Product key={product.id} product={product} /> )) : ""} components/product.js : <div> {product?.price} <h3> {product.name ? product.name : ""} </h3> <div dangerouslySetInnerHTML={{ __html: product?.description }} /> </div> Also I have the ADD button UI switch code and that will look like, Before clicking add

Woocomerce Remove a specific cart items when adding to cart another specific items

余生颓废 提交于 2021-02-13 05:47:26
问题 Provided solution here Remove a specific cart item when adding to cart a specific product in Woocommerce works perfect for one product id. Is any way to do this for multiple id's? 回答1: Update 2 : The following code will work for multiple product IDs: add_action( 'woocommerce_add_to_cart', 'check_product_added_to_cart', 10, 6 ); function check_product_added_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { // Set HERE your targeted product ID $target

Woocomerce Remove a specific cart items when adding to cart another specific items

て烟熏妆下的殇ゞ 提交于 2021-02-13 05:44:00
问题 Provided solution here Remove a specific cart item when adding to cart a specific product in Woocommerce works perfect for one product id. Is any way to do this for multiple id's? 回答1: Update 2 : The following code will work for multiple product IDs: add_action( 'woocommerce_add_to_cart', 'check_product_added_to_cart', 10, 6 ); function check_product_added_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { // Set HERE your targeted product ID $target

Woocomerce Remove a specific cart items when adding to cart another specific items

穿精又带淫゛_ 提交于 2021-02-13 05:43:29
问题 Provided solution here Remove a specific cart item when adding to cart a specific product in Woocommerce works perfect for one product id. Is any way to do this for multiple id's? 回答1: Update 2 : The following code will work for multiple product IDs: add_action( 'woocommerce_add_to_cart', 'check_product_added_to_cart', 10, 6 ); function check_product_added_to_cart($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) { // Set HERE your targeted product ID $target

WooCommerce progressive quantity discount for specific product categories

烂漫一生 提交于 2021-02-10 15:56:51
问题 I was researching a method to give a progressive discount if you have more than 1 product in the cart. I found this thread and actually using this code: //Discount by Qty Product add_action( 'woocommerce_before_calculate_totals', 'quantity_based_pricing', 9999 ); function quantity_based_pricing( $cart ) { global $product; if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) return; // Define discount rules and thresholds and

WooCommerce progressive quantity discount for specific product categories

余生长醉 提交于 2021-02-10 15:54:07
问题 I was researching a method to give a progressive discount if you have more than 1 product in the cart. I found this thread and actually using this code: //Discount by Qty Product add_action( 'woocommerce_before_calculate_totals', 'quantity_based_pricing', 9999 ); function quantity_based_pricing( $cart ) { global $product; if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 ) return; // Define discount rules and thresholds and