Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_Datetime_Now() {
- $tz_object = new DateTimeZone('Europe/Prague');
- //date_default_timezone_set('Brazil/East');
- $datetime = new DateTime();
- $datetime->setTimezone($tz_object);
- return $datetime->format('d.m.Y');
- }
- $date = get_Datetime_Now();
- foreach (WC()->cart->get_cart() as $cart_item_key => $cart_item) {
- $_product = apply_filters('woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key);
- $product_id = apply_filters('woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key);
- $plus = $_product->get_shipping_class();
- $date = strtotime($date);
- $date = strtotime("+$plus weekdays", $date);
- $dodani = date('d. m. Y', $date);
- if ($_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters('woocommerce_cart_item_visible', true, $cart_item, $cart_item_key)) {
- echo "Produkt " . $_product->get_title() . ' musíme doručit do ' . $product->get_shipping_class() . ' dnů (do ' . $dodani . ')';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement