/** * Theme functions and definitions. * * For additional information on potential customization options, * read the developers' documentation: * * https://developers.elementor.com/docs/hello-elementor-theme/ * * @package HelloElementorChild */ if (! defined('ABSPATH')) { exit; // Exit if accessed directly. } define('HELLO_ELEMENTOR_CHILD_VERSION', '2.0.0'); /** * Load child theme scripts & styles. * * @return void */ function hello_elementor_child_scripts_styles() { wp_enqueue_style( 'hello-elementor-child-style', get_stylesheet_directory_uri() . '/style.css', [ 'hello-elementor-theme-style', ], HELLO_ELEMENTOR_CHILD_VERSION ); } add_action('wp_enqueue_scripts', 'hello_elementor_child_scripts_styles', 20); // New actions to split up cart totals and cross sell on cart page add_action('hproc_woocommerce_cart_totals', 'woocommerce_cart_totals', 10); add_action('hproc_woocommerce_cart_cross_sell', 'woocommerce_cross_sell_display'); add_action('acf/init', 'set_acf_settings'); function set_acf_settings() { acf_update_setting('enable_shortcode', true); } function custom_short_description_shortcode() { global $post; $short_description = get_the_excerpt($post->ID); $max_length = 40; // Maximalt antal tecken if (strlen($short_description) > $max_length) { $short_description = substr($short_description, 0, $max_length) . '...'; } return '
' . $short_description . '
'; } add_shortcode('short_description', 'custom_short_description_shortcode'); // // Helpers // function hproc_dump($value) { echo "
";
	print_r($value);
	echo "
"; } /* Lägger till is_reseller och is_company i get order rest api svaret */ add_filter('woocommerce_rest_prepare_shop_order_object', 'hproc_wc_rest_api_extend_order_lineitems_data', 10, 3); function hproc_wc_rest_api_extend_order_lineitems_data($response, $object, $request) { if (empty($response->data)) { return $response; } /* Plockar ut order data från svaret */ $order_data = $response->get_data(); /* Hämta user objektet via ID. customer_id finns på order objektet */ $user = get_user_by("id", $order_data["customer_id"]); /* Är user objektet tomt skickar vi false */ if (empty($user)) { $order_data["is_reseller"] = false; $order_data["is_company"] = false; $order_data["user_email"] = ""; } else { /* Plocka ut alla roller från user objektet */ $roles = $user->roles; /* Om rollerna är tom skickar vi false */ if (empty($roles) || count($roles) <= 0) { $order_data["is_reseller"] = false; $order_data["is_company"] = false; } else { $isReseller = false; $isCompany = false; /* $user->roles är en array även om man bara kan sätta 1 roll. Gör en foreach om detta ändras framöver. */ foreach ($roles as $role) { /* Om rollen börjar med b2b hanterar vi denna som ÅF roll och sätter $isReseller till true */ if (substr_compare($role, "b2b", 0, 3, true) === 0) { $isReseller = true; $isCompany = true; } if ($role == "company") { $isCompany = true; } } $order_data["is_reseller"] = $isReseller; $order_data["is_company"] = $isCompany; } $order_data["user_email"] = $user->user_email; } /* Sätter momsklass i API svaret */ $taxLines = $order_data["tax_lines"]; if (!empty($taxLines)) { $taxLinesIsUpdated = false; foreach ($taxLines as &$taxLine) { $taxLabel = $taxLine["label"]; if (empty($taxLabel)) { continue; } $taxLabelArray = explode(",", $taxLabel); if (empty($taxLabelArray) || count($taxLabelArray) != 2) { continue; } $taxCode = $taxLabelArray[1]; if (empty($taxCode) && $taxCode != 0) { continue; } $taxLine["pyramid_tax_code"] = $taxCode; if (!$taxLinesIsUpdated) { $taxLinesIsUpdated = true; } } if ($taxLinesIsUpdated) { $order_data["tax_lines"] = $taxLines; } } $lineItems = $order_data["line_items"]; if (!empty($lineItems)) { $lineItemsIsUpdated = false; foreach ($lineItems as &$lineItem) { $lineTaxItems = $lineItem["taxes"]; if (!empty($lineTaxItems)) { foreach ($lineTaxItems as &$lineTaxItem) { $lineTaxItem["pyramid_tax_code"] = searchPyramidTaxCodeById($lineTaxItem["id"], $order_data["tax_lines"]); if (!$lineItemsIsUpdated) { $lineItemsIsUpdated = true; } } } else { /** * Om vi inte har några taxlines är produkten momsfri. Vi måste endå skicka med pyramid_tax_code. * Utifrån fraktsätt (instance id) kan vi sätta rätt momskod. * */ $shippingLines = $order_data["shipping_lines"]; if (!empty($shippingLines)) { /** * Finns ingen logik för fler leveranssätt. Tar första i array'en. * */ $shippingLine = $shippingLines[0]; if (!empty($shippingLine)) { $shippingInstanceId = $shippingLine["instance_id"]; /** * Svenska instance_id */ $swedishShippingIds = ["20", "27", "28", "4", "10"]; /** * EU instance id */ $euShippingIds = ["29", "30", "21"]; /** * EXPORT instance id */ $exportShippingIds = ["31", "32", "22"]; $pyramidTaxCode = null; if (in_array($shippingInstanceId, $swedishShippingIds)) { $pyramidTaxCode = "4"; } else if (in_array($shippingInstanceId, $euShippingIds)) { $pyramidTaxCode = "9"; } else if (in_array($shippingInstanceId, $exportShippingIds)) { $pyramidTaxCode = "0"; } $lineTaxItems = [ [ "pyramid_tax_code" => $pyramidTaxCode ] ]; if (!$lineItemsIsUpdated) { $lineItemsIsUpdated = true; } } } } $lineItem["taxes"] = $lineTaxItems; } if ($lineItemsIsUpdated) { $order_data["line_items"] = $lineItems; } } $response->data = $order_data; return $response; } function searchPyramidTaxCodeById($id, $array) { foreach ($array as $key => $val) { if ($val['rate_id'] === $id) { return $val['pyramid_tax_code']; } } return null; } /** * Ändra valuta symbol */ add_filter('woocommerce_currency_symbol', 'hproc_currency_symbol', 10, 2); function hproc_currency_symbol($currency_symbol, $currency) { switch ($currency) { case "SEK": $currency_symbol = "SEK"; break; case "EUR": $currency_symbol = "EUR"; break; case "NOK": $currency_symbol = "NOK"; break; case "DKK": $currency_symbol = "DKK"; break; } return $currency_symbol; } /** * Visa SKU i cart och checkout */ add_filter('woocommerce_cart_item_name', 'hproc_sku_cart_page', 99, 3); function hproc_sku_cart_page($item_name, $cart_item, $cart_item_key) { // The WC_Product object $product = $cart_item['data']; // Get the SKU $sku = $product->get_sku(); // When sku doesn't exist if (empty($sku)) return $item_name; // Add the sku $item_name .= '
' . __("SKU: ", "woocommerce") . $sku . ''; return $item_name; } /** * Skicka ett mail om ÅF ändrar billing eller shipping informationen. * https://stackoverflow.com/questions/31270846/send-notification-email-when-customer-changes-address-woocommerce */ add_action('woocommerce_customer_save_address', 'hproc_email_customer_address_change'); function hproc_email_customer_address_change() { $body = ''; $to = 'jessica.brixeby@gysinge.com'; //address that will receive this email //$to = 'patrick.andersson@100procent.com'; //address that will receive this email //$to = 'mattias@100procent.com'; //address that will receive this email $subject = 'En av återförsäljarna har uppdaterat sin adress.'; $sendNotification = false; $curr_user = wp_get_current_user(); if ($curr_user) { /** * Check if the user is retailer */ foreach ($curr_user->roles as $role) { if (substr_compare($role, "b2b", 0, 3, true) === 0 /*|| $role === "administrator"*/) { $sendNotification = true; break; } } if ($sendNotification) { $user_id = $curr_user->ID; $curr_username = $curr_user->data->user_login; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= '
Konto
Användarnamn: ' . $curr_username . '
Orgaisationsnummer: ' . get_field('field_67b5b586a2d06', 'user_' . $user_id) . '
 
Faktureringsadress
Förnamn: ' . get_user_meta($user_id, 'billing_first_name', true) . '
Efternamn: ' . get_user_meta($user_id, 'billing_last_name', true) . '
Företag: ' . get_user_meta($user_id, 'billing_company', true) . '
Adress 1: ' . get_user_meta($user_id, 'billing_address_1', true) . '
Adress 2: ' . get_user_meta($user_id, 'billing_address_2', true) . '
Stad: ' . get_user_meta($user_id, 'billing_city', true) . '
Postnummer: ' . get_user_meta($user_id, 'billing_postcode', true) . '
Land: ' . get_user_meta($user_id, 'billing_country', true) . '
Telefon: ' . get_user_meta($user_id, 'billing_phone', true) . '
Email: ' . get_user_meta($user_id, 'billing_email', true) . '
 
Leveransadress
Förnamn: ' . get_user_meta($user_id, 'shipping_first_name', true) . '
Efternamn: ' . get_user_meta($user_id, 'shipping_last_name', true) . '
Företag: ' . get_user_meta($user_id, 'shipping_company', true) . '
Adress 1: ' . get_user_meta($user_id, 'shipping_address_1', true) . '
Adress 2: ' . get_user_meta($user_id, 'shipping_address_2', true) . '
Stad: ' . get_user_meta($user_id, 'shipping_city', true) . '
Postnummer: ' . get_user_meta($user_id, 'shipping_postcode', true) . '
Land: ' . get_user_meta($user_id, 'shipping_country', true) . '
'; //set content type as HTML $headers = array('Content-Type: text/html; charset=UTF-8;'); //send email if (wp_mail($to, $subject, $body, $headers)) { //echo 'email sent'; } else { //echo 'email NOT sent'; } //exit(); } } } // Enables search on headline of articles add_filter('dgwt/wcas/indexer/post_types', function ($post_types) { $post_types[] = [ 'post_type' => 'article', 'labels' => [ 'name' => 'Textartiklar', ], ]; return $post_types; }); //Enables search within the discription add_filter('dgwt/wcas/indexer/post_source_query/article/description', '__return_true'); //Showing CPT image in search result add_filter('dgwt/wcas/search_results/article/show_image', '__return_true'); // Display custom post types on the search result page add_action('woocommerce_no_products_found', function () { if (! \DgoraWcas\Helpers::isProductSearchPage()) { return; } echo do_shortcode('[fibosearch_posts_results post_type="article" layout=grid show_image]'); }); add_action('woocommerce_before_shop_loop', function () { if (! \DgoraWcas\Helpers::isProductSearchPage()) { return; } echo do_shortcode('[fibosearch_posts_results post_type="article" layout=grid show_image]'); }); ?> Hinge – Gysinge https://www.gysinge.com/en/ Gysinge - Centrum för byggnadsvård Fri, 28 Feb 2025 15:38:47 +0000 en-US hourly 1 https://wordpress.org/?v=7.1.4 https://www.gysinge.com/wp-content/uploads/2024/06/Gysinge-ikon-1-64x64.png Hinge – Gysinge https://www.gysinge.com/en/ 32 32 Hinge 85x74x2,5 right with cone https://www.gysinge.com/en/produkt/hinge-85x74x25-right-with-cone/ https://www.gysinge.com/en/produkt/hinge-85x74x25-right-with-cone/#respond Wed, 18 Dec 2024 09:21:22 +0000 https://www.gysinge.com/produkt/hinge-85x74x25-right-with-cone/ Solid chair hinge with cone, right. Suitable for windows, cabinet and wardrobe doors.

Untreated iron. Screw not included.

Thickness 2.5 mm, height excl. studs 86 mm, width unfolded 74 mm.

Model: Right

Suitable screw: Screw 16

TIP! Here’s how to find out if you need right or left hinges – Close and check!

A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-85x74x25-right-with-cone/feed/ 0
Hinge 66x60x2 left with cone https://www.gysinge.com/en/produkt/hinge-66x60x2-left-with-cone/ https://www.gysinge.com/en/produkt/hinge-66x60x2-left-with-cone/#respond Wed, 18 Dec 2024 09:14:13 +0000 https://www.gysinge.com/produkt/hinge-66x60x2-left-with-cone/ Solid chair hinge with cone, left. Suitable for windows, cabinet and wardrobe doors.

Model from around 1860 to the middle of the 20th century. Typical cone-shaped spigots. Available in both left and right versions. High quality.

Height excl. knobs 66 mm, width unfolded 60 mm, Thickness 2 mm. Untreated iron.

Model: Left

Suitable screw: Screw 13

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-66x60x2-left-with-cone/feed/ 0
Hinge 74x60x2 left with cone https://www.gysinge.com/en/produkt/hinge-74x60x2-left-with-cone/ https://www.gysinge.com/en/produkt/hinge-74x60x2-left-with-cone/#respond Mon, 25 Nov 2024 20:48:50 +0000 https://www.gysinge.com/produkt/hinge-74x60x2-left-with-cone/ Solid chair hinge with cone, left. Suitable for windows, cabinet and wardrobe doors.

Model from around 1860 to the middle of the 20th century. Typical cone-shaped spigots. Available in both left and right versions. High quality.

Height excl. knobs 74 mm, width unfolded 60 mm, Thickness 2 mm. Untreated iron.

Model: Left

Suitable screw: Screw 13

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-74x60x2-left-with-cone/feed/ 0
Hinge 74x60x2 right with cone https://www.gysinge.com/en/produkt/hinge-74x60x2-right-with-cone/ https://www.gysinge.com/en/produkt/hinge-74x60x2-right-with-cone/#respond Mon, 25 Nov 2024 20:48:49 +0000 https://www.gysinge.com/produkt/hinge-74x60x2-right-with-cone/ Solid chair hinge with cone, right. Suitable for windows, cabinet and wardrobe doors.

Model from around 1860 to the middle of the 20th century. Typical cone-shaped spigots. Available in both left and right versions. High quality.

Height excl. knobs 74 mm, width unfolded 60 mm, Thickness 2 mm. Untreated iron.

Model: Right

Suitable screw: Screw 13

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-74x60x2-right-with-cone/feed/ 0
Hinge 85x74x2.5 left with cone https://www.gysinge.com/en/produkt/hinge-85x74x2-5-left-with-cone/ https://www.gysinge.com/en/produkt/hinge-85x74x2-5-left-with-cone/#respond Mon, 25 Nov 2024 20:48:49 +0000 https://www.gysinge.com/produkt/hinge-85x74x2-5-left-with-cone/ Solid chair hinge with cone, left. Suitable for windows, cabinet and wardrobe doors.

Model from around 1860 to the middle of the 20th century. Typical cone-shaped spigots. Available in both left and right versions. High quality.

Height excl. knobs 85 mm, width unfolded 74 mm, Thickness 2.5 mm. Untreated iron.

Model: Left

Suitable screw: Screw 16

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-85x74x2-5-left-with-cone/feed/ 0
Hinge 98x106x2.5 left with acorn https://www.gysinge.com/en/produkt/hinge-98x106x2-5-left-with-acorn/ https://www.gysinge.com/en/produkt/hinge-98x106x2-5-left-with-acorn/#respond Mon, 25 Nov 2024 20:48:48 +0000 https://www.gysinge.com/produkt/hinge-98x106x2-5-left-with-acorn/ Solid chair hinge with acorn, left. Suitable for cabinet and wardrobe doors.

Model from around 1880-1920s. Acorn-shaped spigots typical of the period. Available in both left and right versions. High quality.

Height excl. knobs 98 mm, width unfolded 106 mm, thickness 2.5 mm. Untreated iron.

Model: Left

Suitable screw: Screw 16

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-98x106x2-5-left-with-acorn/feed/ 0
Hinge 98x86x2,5 left with ball https://www.gysinge.com/en/produkt/hinge-98x86x25-left-with-ball/ https://www.gysinge.com/en/produkt/hinge-98x86x25-left-with-ball/#respond Mon, 25 Nov 2024 20:48:48 +0000 https://www.gysinge.com/produkt/hinge-98x86x25-left-with-ball/ Solid chair hinge with ball, left. Suitable for cabinet and wardrobe doors.

Model from around 1880-1920s. Ball-shaped spigots typical of the period. Available in both left and right versions. High quality.

Height excluding knobs 98 mm, width unfolded 86 mm, thickness 2.5 mm. Untreated iron.

Model: Left

Suitable screw: Screw 13

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-98x86x25-left-with-ball/feed/ 0
Hinge 110x102x3 right with cone https://www.gysinge.com/en/produkt/hinge-110x102x3-right-with-cone/ https://www.gysinge.com/en/produkt/hinge-110x102x3-right-with-cone/#respond Mon, 25 Nov 2024 20:48:47 +0000 https://www.gysinge.com/produkt/hinge-110x102x3-right-with-cone/ Solid chair hinge with cone, right. Suitable for cabinet and wardrobe doors.

Model from around 1860 to the middle of the 20th century. Typical cone-shaped spigots. Available in both left and right versions. High quality.

Height excl. knobs 110 mm, width unfolded 102 mm, Thickness 3 mm. Untreated iron.

Model: Right

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the right is right-hinged.

]]>
https://www.gysinge.com/en/produkt/hinge-110x102x3-right-with-cone/feed/ 0
Hinge 110x102x3 left with cone https://www.gysinge.com/en/produkt/hinge-110x102x3-left-with-cone/ https://www.gysinge.com/en/produkt/hinge-110x102x3-left-with-cone/#respond Mon, 25 Nov 2024 20:48:46 +0000 https://www.gysinge.com/produkt/hinge-110x102x3-left-with-cone/ Solid chair hinge with cone, left. Suitable for cabinet and wardrobe doors.

Model from around 1860 to the middle of the 20th century. Typical cone-shaped spigots. Available in both left and right versions. High quality.

Height excl. knobs 110 mm, width unfolded 102 mm, Thickness 3 mm. Untreated iron.

Model: Left

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-110x102x3-left-with-cone/feed/ 0
Hinge 98x106x2,5 right with acorn https://www.gysinge.com/en/produkt/hinge-98x106x25-right-with-acorn/ https://www.gysinge.com/en/produkt/hinge-98x106x25-right-with-acorn/#respond Mon, 25 Nov 2024 20:48:46 +0000 https://www.gysinge.com/produkt/hinge-98x106x25-right-with-acorn/ Solid chair hinge with acorn, right. Suitable for cabinet and wardrobe doors.

Model from around 1880-1920s. Acorn-shaped spigots typical of the period. Available in both left and right versions. High quality.

Height excl. knobs 98 mm, width unfolded 106 mm, thickness 2.5 mm. Untreated iron.

Model: Right

Suitable screw: Screw 16

TIP! Here’s how to find out if you need right- or left-hinged hinges – Close and check! A closed door with hinges visible on the right is right-hinged. Similarly, a closed door with hinges visible on the left is left-hung.

]]>
https://www.gysinge.com/en/produkt/hinge-98x106x25-right-with-acorn/feed/ 0