Woocommerce shipping options not changing checkout total

I am working with woocommerce at the moment, I have created a child theme off of storefront, and I notice that when I change the shipping option to once that has a price the total order price does not change, and Javascript error is thrown. I have not changed any of the parent theme for this process so I am not sure why it would be throwing an error?

The error is as follows,

enter image description here

If I just use storefront it works fine, so there must be a conflict in my child theme but I am not sure where to start?

Reload part of checkout on changed shipping method

So I added the following action to add extra content about ‘local pickup’ to the checkout page.

add_action( 'woocommerce_review_order_before_payment', 'my_custom_action', 20 ); 

When I change the shipping method I want to ‘reload’ the action to hide/show the content in case the shipping method is local pickup.

I’m not an expert on hooks or wordpress ajax… can’t figure this thing out

Change WooCommerce shipping text if certain products are in order

I have a client who sells several large products that require custom shipping. I need to be able to display custom text throughout WooCommerce if any of those items are in the cart and if any of those items are in the completed order.

Currently the following works perfectly on the cart and checkout pages, but I need the custom text to also appear on the completed order page, the Edit Order page in admin, and all associated emails going to both the customer and the admin:

    function sww_wc_free_shipping_label( $  label, $  method ) {      $  product_id = array(2122,2123,2124);      foreach ($  product_id as $  product_id => $  product) {             $  product_cart_id = WC()->cart->generate_cart_id( $  product );            $  in_cart = WC()->cart->find_product_in_cart( $  product_cart_id );              if($  in_cart) {                 $  label = 'Special shipping required. We will contact you with the final cost.';                 break;             }         }      return $  label; } add_filter( 'woocommerce_cart_shipping_method_full_label', 'sww_wc_free_shipping_label', 10, 2 ); 

The following does seem to find the product in the cart, but I’m not sure how to get the custom shipping text we need:

add_action( 'woocommerce_thankyou', 'name_your_function_check_order_product_id');  function name_your_function_check_order_product_id( $  order_id ){  $  custom_shipping_text = 'Special shipping required. We will contact you with the final cost.';    $  order = wc_get_order( $  order_id ); $  items = $  order->get_items();  foreach ( $  items as $  item_id => $  item ) {    $  product_id = $  item->get_variation_id() ? $  item->get_variation_id() : $  item->get_product_id();      if ( $  product_id == 2122 ||  $  product_id == 2123 || $  product_id == 2124) {         //Do something       } } } 

I’m guessing the table woocommerce_order_items needs to be updated, changing order_item_name from “Free shipping” to the custom text, but I’m not sure how to do that. Or is there a better way that I’m missing?

Get WooCommerce shipping methods programmatically

How can I retrieve the shipping methods in my WooCommerce shop? I have this on my checkout page:

my checkout page

And inside my admin it looks like this:

shipping methods in wp admin

I have tried doing:

WC()->shipping->load_shipping_methods() 

But it does not return GLS or Click and collect text / price. It returns this data: https://paste.laravel.io/0c1aff96-dbed-452c-856f-6d62b6f1f47e

Creating a Woocommerce custom shipping method as a select field

I’m working with thw WooCommerce plugin for WordPress. My main goal right now is to create a custom shipping method. So far I’ve managed to create this method and display the same in my billing form. The problem is that this shipping methods are checkbox by default and I want an extra funcionality: Display a select with a series of options as soon a I select this custom shipping method on the billing order form.

This next class handles the custom shipping method:

/**  * WC_Shipping_Pickup class.  *  * @class       WC_Shipping_Pickup  * @version     1.0.0  * @package     Shipping-for-WooCommerce/Classes  * @category    Class  * @author      Pickup Softwares  */ class WC_Shipping_Pickup extends WC_Shipping_Method {     public function __construct($  instance_id = 0)     {         $  this->id                    = 'pickup_method';         $  this->instance_id           = absint($  instance_id);         $  this->method_title          = __('Pickup');         $  this->method_description    = __('Método de envío: punto de pickup');         $  this->supports              = array(             'shipping-zones',             'instance-settings',         );          $  this->instance_form_fields = array(             'enabled' => array(                 'title'         => __('Habilitar/Deshabilitar'),                 'type'          => 'checkbox',                 'label'         => __('Habilitar este método de envío'),                 'default'       => 'yes',             ),             'title' => array(                 'title'         => __('Título'),                 'type'          => 'text',                 'description'   => __('Título que se visualizará en el formulario de facturación'),                 'default'       => __('Pickup'),                 'desc_tip'      => true             )         );          $  this->enabled              = $  this->get_option('enabled');         $  this->title                = $  this->get_option('title');          add_action('woocommerce_update_options_shipping_' . $  this->id, array( $  this, 'process_admin_options' ));     }      public function calculate_shipping($  package = array())     {         $  this->add_rate(array(             'id'    => $  this->id . $  this->instance_id,             'label' => $  this->title,             'cost'  => 0,         ));     }      /**      * Generate Select HTML.      *      * @param string $  key Field key.      * @param array  $  data Field data.      * @since  1.0.0      * @return string      */     public function generate_select_html()     {         $  token = null;         $  expire = null;         $  token = qk_login($  token, $  expire);          $  agencies = qk_agencies($  token);          $  field_key = $  this->get_field_key('_pickups');          $  options = [];         foreach ($  agencies as $  agency) {             $  options[$  agency->id] = $  agency->detalle;         }          $  defaults  = array(             'title'             => 'Pickups',             'disabled'          => false,             'class'             => '',             'css'               => '',             'placeholder'       => 'Seleccionar punto de recogida',             'type'              => 'text',             'desc_tip'          => false,             'description'       => '',             'custom_attributes' => array(),             'options'           => $  options,         );          $  data = wp_parse_args($  data, $  defaults);          ob_start(); ?>         <tr valign="top">             <th scope="row" class="titledesc">                 <label for="<?php echo esc_attr($  field_key); ?>"><?php echo wp_kses_post($  data['title']); ?> <?php echo $  this->get_tooltip_html($  data); // WPCS: XSS ok.?></label>             </th>             <td class="forminp">                 <fieldset>                     <legend class="screen-reader-text"><span><?php echo wp_kses_post($  data['title']); ?></span></legend>                     <select class="select <?php echo esc_attr($  data['class']); ?>" name="<?php echo esc_attr($  field_key); ?>" id="<?php echo esc_attr($  field_key); ?>" style="<?php echo esc_attr($  data['css']); ?>" <?php disabled($  data['disabled'], true); ?> <?php echo $  this->get_custom_attribute_html($  data); // WPCS: XSS ok.?>>                         <?php foreach ((array) $  data['options'] as $  option_key => $  option_value) : ?>                             <option value="<?php echo esc_attr($  option_key); ?>" <?php selected((string) $  option_key, esc_attr($  this->get_option($  key))); ?>><?php echo esc_attr($  option_value); ?></option>                         <?php endforeach; ?>                     </select>                     <?php echo $  this->get_description_html($  data); // WPCS: XSS ok.?>                 </fieldset>             </td>         </tr>         <?php          return ob_get_clean();     } } 

I’ve been trying to use this generate_select_html function to generate this select input but I’m actually running with my eyes closed because I don’t know if this is right way to do things. That piece of code causes an infinite loading page on the billing form so it is wrong (obviusly). Is there a way to adchieve what I want?

Lingerie Drop Shipping Online Store, Newbie Friendly, Hugh Profit Potential

Grab this chance to own 100% done for you dropship ecommerce in women supplies. Get traffic and make profit, woocommerce wordpress website with beautiful design.

Want to sale underwearshop.xyz Gorgeous & Beautiful dropshipping wordpress site selling women supplies. No monthly fee to pay ecommerce store like shopify, which will minimize your monthly cost. All products choosen base on best selling at aliexpress.com in their category and free shipping.

No Programming Skills Needed, No…

Lingerie Drop Shipping Online Store, Newbie Friendly, Hugh Profit Potential

Offer optional shipping insurance to customers with minimum order of $100

I found this question: Additional, optional fee on Woocommerce Checkout that may work for me except that I would need to use a 2.5% fee and not a flat $ rate. The 2.5% fee would be calculated for each minim order sub-total of $ 100.

Can this be done using a percentage fee and a minimum order amount?

Restrict a shipping package in woocommerce to ship to only one country

I have created shipping packages for my store to set different shipping options for different products. Now I want one shipping package to restrict only for UK, so that means if the user selects UK, it shows the shipping options and if it is any other country, then it simply shows a note there that ‘This product can’t be shipped to your country’. Right now it shows “No shipping options were found for your country.”

Here is the code for shipping packages:

function custom_split_shipping_packages_shipping_class( $  packages ) { // Reset all packages $  packages              = array(); $  regular_package_items = array(); $  tr_package_items   = array(); $  sr_package_items   = array(); $  tr_shipping_class = 'tr-box'; // Tr Shipping class slug $  sr_shipping_class = 'sr-box'; // Sr Shipping class slug foreach ( WC()->cart->get_cart() as $  item_key => $  item ) {     if ( $  item['data']->needs_shipping() ) {         if ( $  tr_shipping_class == $  item['data']->get_shipping_class() ) {             $  tr_package_items[ $  item_key ] = $  item;         } else if ( $  sr_shipping_class == $  item['data']->get_shipping_class() ) {             $  sr_package_items[ $  item_key ] = $  item;         } else {             $  regular_package_items[ $  item_key ] = $  item;         }     } } // Create shipping packages if ( $  regular_package_items ) {     $  packages[] = array(         'contents'        => $  regular_package_items,         'contents_cost'   => array_sum( wp_list_pluck( $  regular_package_items, 'line_total' ) ),         'applied_coupons' => WC()->cart->get_applied_coupons(),         'user'            => array(              'ID' => get_current_user_id(),         ),         'destination'    => array(             'country'    => WC()->customer->get_shipping_country(),             'state'      => WC()->customer->get_shipping_state(),             'postcode'   => WC()->customer->get_shipping_postcode(),             'city'       => WC()->customer->get_shipping_city(),             'address'    => WC()->customer->get_shipping_address(),             'address_2'  => WC()->customer->get_shipping_address_2()         )     ); } if ( $  tr_package_items ) {     $  packages[] = array(         'contents'        => $  tr_package_items,         'contents_cost'   => array_sum( wp_list_pluck( $  tr_package_items, 'line_total' ) ),         'applied_coupons' => WC()->cart->get_applied_coupons(),         'user'            => array(              'ID' => get_current_user_id(),         ),         'destination'    => array(             'country'    => WC()->customer->get_shipping_country(),             'state'      => WC()->customer->get_shipping_state(),             'postcode'   => WC()->customer->get_shipping_postcode(),             'city'       => WC()->customer->get_shipping_city(),             'address'    => WC()->customer->get_shipping_address(),             'address_2'  => WC()->customer->get_shipping_address_2()         )     ); } if ( $  sr_package_items ) {     $  packages[] = array(         'contents'        => $  sr_package_items,         'contents_cost'   => array_sum( wp_list_pluck( $  sr_package_items, 'line_total' ) ),         'applied_coupons' => WC()->cart->get_applied_coupons(),         'user'            => array(              'ID' => get_current_user_id(),         ),         'destination'    => array(             'country'    => WC()->customer->get_shipping_country(),             'state'      => WC()->customer->get_shipping_state(),             'postcode'   => WC()->customer->get_shipping_postcode(),             'city'       => WC()->customer->get_shipping_city(),             'address'    => WC()->customer->get_shipping_address(),             'address_2'  => WC()->customer->get_shipping_address_2()         )     ); } return $  packages;     } add_filter( 'woocommerce_cart_shipping_packages', 'custom_split_shipping_packages_shipping_class' ); 

I want shipping for sr-box to restrict to UK only.

Final-Mile Shipping Company Wants Customer Email Address – PCI Compliance Issue? (United States)

My company ships very large, very heavy products to the homes of everyday consumers (think big home renovation materials). Currently, we provide the customer’s name, shipping address, and phone number to the factory. The factory then provides that information to a freight company who will then provides it to a final-mile delivery company.

The final-mile delivery company wants us to provide the customer’s email address so they can improve the delivery time frame. Customers are significantly more likely to respond to an email than they are to a phone call. Text messaging isn’t, apparently, effective enough either, because there are still land lines in play.

We ship only to the continental United States, so we don’t fall immediately under the GDPR umbrella, but my concern is that providing this email address to other businesses in our manufacturing and delivery pipeline will have PCI compliance consequences.

It would be simple if I could just add a disclaimer into our Terms and Conditions that explains that we will give the customer’s email address to other entities for the purposes of shipping and delivery, but that information won’t be used for marketing purposes, but I’m afraid that there are implications I’m not considering.

Can anyone provide any insights about how I should approach this problem?