add_action( ‘woocommerce_after_checkout_shipping_form’, ‘ts_after_checkout_shipping_form’, 10 );
function ts_after_checkout_shipping_form(){
echo ‘<h3>בימי שישי לא נוכל להתחייב לשעה ספציפית, נשמח לעדכן כשעה לפני הגעה אליכם :)</h3>’;
}
register_nav_menus( [ ‘menu-2’ => __( ‘Footer’, ‘hello-elementor’ ) ] );
}
$hook_result = apply_filters_deprecated( ‘elementor_hello_theme_add_theme_support’, [ true ], ‘2.0’, ‘hello_elementor_add_theme_support’ );
if ( apply_filters( ‘hello_elementor_add_theme_support’, $hook_result ) ) {
add_theme_support( ‘post-thumbnails’ );
add_theme_support( ‘automatic-feed-links’ );
add_theme_support( ‘title-tag’ );
add_theme_support(
‘html5’,
[
‘search-form’,
‘comment-form’,
‘comment-list’,
‘gallery’,
‘caption’,
‘script’,
‘style’,
]
);
add_theme_support(
‘custom-logo’,
[
‘height’ => 100,
‘width’ => 350,
‘flex-height’ => true,
‘flex-width’ => true,
]
);
/*
* Editor Style.
*/
add_editor_style( ‘classic-editor.css’ );
/*
* Gutenberg wide images.
*/
add_theme_support( ‘align-wide’ );
/*
* WooCommerce.
*/
$hook_result = apply_filters_deprecated( ‘elementor_hello_theme_add_woocommerce_support’, [ true ], ‘2.0’, ‘hello_elementor_add_woocommerce_support’ );
if ( apply_filters( ‘hello_elementor_add_woocommerce_support’, $hook_result ) ) {
// WooCommerce in general.
add_theme_support( ‘woocommerce’ );
// Enabling WooCommerce product gallery features (are off by default since WC 3.0.0).
// zoom.
add_theme_support( ‘wc-product-gallery-zoom’ );
// lightbox.
add_theme_support( ‘wc-product-gallery-lightbox’ );
// swipe.
add_theme_support( ‘wc-product-gallery-slider’ );
}
}
}
}
add_action( ‘after_setup_theme’, ‘hello_elementor_setup’ );
function hello_maybe_update_theme_version_in_db() {
$theme_version_option_name = ‘hello_theme_version’;
// The theme version saved in the database.
$hello_theme_db_version = get_option( $theme_version_option_name );
// If the ‘hello_theme_version’ option does not exist in the DB, or the version needs to be updated, do the update.
if ( ! $hello_theme_db_version || version_compare( $hello_theme_db_version, HELLO_ELEMENTOR_VERSION, ‘<‘ ) ) { update_option( $theme_version_option_name, HELLO_ELEMENTOR_VERSION ); } } if ( ! function_exists( ‘hello_elementor_scripts_styles’ ) ) { /** * Theme Scripts & Styles. * * @return void */ function hello_elementor_scripts_styles() { $enqueue_basic_style = apply_filters_deprecated( ‘elementor_hello_theme_enqueue_style’, [ true ], ‘2.0’, ‘hello_elementor_enqueue_style’ ); $min_suffix = defined( ‘SCRIPT_DEBUG’ ) && SCRIPT_DEBUG ? ” : ‘.min’; if ( apply_filters( ‘hello_elementor_enqueue_style’, $enqueue_basic_style ) ) { wp_enqueue_style( ‘hello-elementor’, get_template_directory_uri() . ‘/style’ . $min_suffix . ‘.css’, [], HELLO_ELEMENTOR_VERSION ); } if ( apply_filters( ‘hello_elementor_enqueue_theme_style’, true ) ) { wp_enqueue_style( ‘hello-elementor-theme-style’, get_template_directory_uri() . ‘/theme’ . $min_suffix . ‘.css’, [], HELLO_ELEMENTOR_VERSION ); } } } add_action( ‘wp_enqueue_scripts’, ‘hello_elementor_scripts_styles’ ); if ( ! function_exists( ‘hello_elementor_register_elementor_locations’ ) ) { /** * Register Elementor Locations. * * @param ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager $elementor_theme_manager theme manager. * * @return void */ function hello_elementor_register_elementor_locations( $elementor_theme_manager ) { $hook_result = apply_filters_deprecated( ‘elementor_hello_theme_register_elementor_locations’, [ true ], ‘2.0’, ‘hello_elementor_register_elementor_locations’ ); if ( apply_filters( ‘hello_elementor_register_elementor_locations’, $hook_result ) ) { $elementor_theme_manager->register_all_core_location();
}
}
}
add_action( ‘elementor/theme/register_locations’, ‘hello_elementor_register_elementor_locations’ );
if ( ! function_exists( ‘hello_elementor_content_width’ ) ) {
/**
* Set default content width.
*
* @return void
*/
function hello_elementor_content_width() {
$GLOBALS[‘content_width’] = apply_filters( ‘hello_elementor_content_width’, 800 );
}
}
add_action( ‘after_setup_theme’, ‘hello_elementor_content_width’, 0 );
if ( is_admin() ) {
require get_template_directory() . ‘/includes/admin-functions.php’;
}
/**
* If Elementor is installed and active, we can load the Elementor-specific Settings & Features
*/
// Allow active/inactive via the Experiments
require get_template_directory() . ‘/includes/elementor-functions.php’;
/**
* Include customizer registration functions
*/
add_action(‘init’, function() {
// yes, this is a PHP 5.3 closure, deal with it
if (!isset($_COOKIE[‘my_cookie’])) {
setcookie(‘my_cookie’, ‘some default value’, strtotime(‘+1 day’));
}
});
if ( ! function_exists( ‘hello_elementor_check_hide_title’ ) ) {
/**
* Check hide title.
*
* @param bool $val default value.
*
* @return bool
*/
function hello_elementor_check_hide_title( $val ) {
if ( defined( ‘ELEMENTOR_VERSION’ ) ) {
$current_doc = Elementor\Plugin::instance()->documents->get( get_the_ID() );
if ( $current_doc && ‘yes’ === $current_doc->get_settings( ‘hide_title’ ) ) {
$val = false;
}
}
return $val;
}
}
add_filter( ‘hello_elementor_page_title’, ‘hello_elementor_check_hide_title’ );
/**
* Wrapper function to deal with backwards compatibility.
*/
if ( ! function_exists( ‘hello_elementor_body_open’ ) ) {
function hello_elementor_body_open() {
if ( function_exists( ‘wp_body_open’ ) ) {
wp_body_open();
} else {
do_action( ‘wp_body_open’ );
}
}
}
add_filter(‘woocommerce_shop_loop_item_title’, ‘custom_added_to_cart_message’);
function custom_added_to_cart_message()
{
global $product;
echo ‘
‘;
echo ‘
‘;
}
add_action(‘woocommerce_checkout_update_order_meta’, ‘custom_checkout_field_update_order_meta’);
function custom_checkout_field_update_order_meta($order_id)
{
if (!empty($_POST[‘custom_field_name’])) {
update_post_meta($order_id, ‘custom_field_name’,sanitize_text_field($_POST[‘custom_field_name’]));
}
}
add_action( ‘wp_footer’, ‘cart_update_script’, 999 );
function cart_update_script() {
if (is_checkout()) :
?>
$cart_url = wc_get_cart_url(); // Set Cart URL
$string = ‘‘;
if ( $cart_count > 0 ) {
$string =$string . ‘
‘;
}
$string = $string . ‘
‘;
return $string;
}
function displayPriceProduct( $atts ) {
$atts = shortcode_atts( array(
‘id’ => null,
), $atts, ‘bartag’ );
$html = ”;
if( intval( $atts[‘id’] ) > 0 && function_exists( ‘wc_get_product’ ) ){
$product = wc_get_product( $atts[‘id’] );
return ( $product = wc_get_product( $atts[‘id’] ) ) ? “₪” . wc_get_price_including_tax( $product ) : false;
}
return $html;
}
add_shortcode( ‘woocommerce_product_price’, ‘displayPriceProduct’ );
add_filter( ‘default_checkout_billing_country’, ‘__return_null’ );
add_filter( ‘default_checkout_shipping_country’, ‘__return_null’ );
add_filter( ‘default_checkout_billing_state’, ‘__return_null’ );
add_filter( ‘default_checkout_shipping_state’, ‘__return_null’ );
// —————————————–
// 4. Display custom input field value @ Cart
add_filter( ‘woocommerce_get_item_data’, ‘ njengah_product_add_on_display_cart’, 10, 2 );
function njengah_product_add_on_display_cart( $data, $cart_item ) {
if ( isset( $cart_item[‘custom_text_add_on’] ) ){
$data[] = array(
‘name’ => ‘הערות להזמנה’,
‘value’ => sanitize_text_field( $cart_item[‘custom_text_add_on’] )
);
}
return $data;
}
// —————————————–
// 5. Save custom input field value into order item meta
add_action( ‘woocommerce_add_order_item_meta’, ‘ njengah_product_add_on_order_item_meta’, 10, 2 );
function njengah_product_add_on_order_item_meta( $item_id, $values ) {
if ( ! empty( $values[‘custom_text_add_on’] ) ) {
wc_add_order_item_meta( $item_id, ‘Custom Text Add-On’, $values[‘custom_text_add_on’], true );
}
}
// —————————————–
// 6. Display custom input field value into order table
add_filter( ‘woocommerce_order_item_product’, ‘ njengah_product_add_on_display_order’, 10, 2 );
function njengah_product_add_on_display_order( $cart_item, $order_item ){
if( isset( $order_item[‘custom_text_add_on’] ) ){
$cart_item[‘custom_text_add_on’] = $order_item[‘custom_text_add_on’];
}
return $cart_item;
}
// —————————————–
// 7. Display custom input field value into order emails
add_filter( ‘woocommerce_email_order_meta_fields’, ‘ njengah_product_add_on_display_emails’ );
function njengah_product_add_on_display_emails( $fields ) {
$fields[‘custom_text_add_on’] = ‘הערות להזמנה’;
return $fields;
}
add_filter( ‘woocommerce_package_rates’, ‘product_category_hide_shipping_methods’, 90, 2 );
function product_category_hide_shipping_methods( $rates, $package ){
// HERE set your product categories in the array (IDs, slugs or names)
$categories = array( ‘no-shipping’);
$found = false;
// Loop through each cart item Checking for the defined product categories
foreach( $package[‘contents’] as $cart_item ) {
if ( has_term( $categories, ‘product_cat’, $cart_item[‘product_id’] ) ){
$found = true;
break;
}
}
$rates_arr = array();
if ( $found ) {
foreach($rates as $rate_id => $rate) {
if (‘local_pickup’ === $rate->method_id) {
$rates_arr[ $rate_id ] = $rate;
}
}
}
return !empty( $rates_arr ) ? $rates_arr : $rates;
}
function jp_exclude_categories_from_related( $categories ) {
// Define your category IDs you’d like to have excluded.
$exclude_cats = array( 54 );
foreach( $categories as $index => $cat ){
if( in_array( $cat, $exclude_cats ) ){
unset( $categories[ $index ] );
}
}
return $categories;
}
add_filter( ‘woocommerce_get_related_product_cat_terms’, ‘jp_exclude_categories_from_related’ );
add_action( ‘woocommerce_email_after_order_table’, ‘my_custom_checkout_field_display_admin_order_meta’, 10, 1 );
add_action( ‘woocommerce_admin_order_data_after_billing_address’, ‘my_custom_checkout_field_display_admin_order_meta’, 10, 1 );
function my_custom_checkout_field_display_admin_order_meta($order){
echo ‘
‘);
}
function Shippingnotice(){
$retrived_group_input_value = WC()->customer->get_billing_postcode();
$str = ”;
if ($retrived_group_input_value){
$str = ‘
‘;
echo substr( $product->post->post_excerpt, 0, 800);
echo ‘
‘;
}
add_action( ‘woocommerce_before_shop_loop_item_title’, ‘addHoverImageToProducts’, 15 );
function addHoverImageToProducts() {
global $product;
$attachment_ids = $product->get_gallery_image_ids();
$count = 0;
foreach( $attachment_ids as $attachment_id ) {
$count++;
//make sure you’re on the Shop Page and that you only get the first image
?>
/>
?>
/>
}
function is_in_cart() {
$categories = array(‘Special delivery’);
$has_category = false;
// Loop through cart items
foreach ( WC()->cart->get_cart() as $cart_item ) {
// Check for product categories
if ( has_term( $categories, ‘product_cat’, $cart_item[‘product_id’] ) ) {
return true;
}
}
return false;
}
add_filter( ‘woocommerce_checkout_fields’, ‘xa_remove_billing_checkout_fields’ );
function xa_remove_billing_checkout_fields( $fields ) {
unset($fields[‘shipping’][‘shipping_postcode’]);
unset($fields[‘billing’][‘billing_address_2’]);
unset($fields[‘shipping’][‘shipping_address_2’]);
unset($fields[‘shipping’][‘shipping_country’]);
unset($fields[‘billing’][‘billing_country’]);
$fields[‘billing’][‘billing_first_name’][‘required’] = false;
$fields[‘billing’][‘billing_postcode’][‘required’] = false;
$fields[‘billing’][‘billing_address_1’][‘required’] = false;
$fields[‘billing_first_name’][‘required’] = false;
$fields[‘billing_address_1’][‘required’] = false;
return $fields;
}
add_action( ‘woocommerce_before_checkout_billing_form’, ‘btncheckout’ );
function btncheckout( $checkout) {
$retrived_group_input_value = WC()->customer->get_billing_postcode();
if ( $retrived_group_input_value ==’איסוף עצמי’){
}else {
echo’
‘;
}
?>
), $attr );
$Product = get_field(‘יום ותאריך’, $args[‘id’]);
$str = “”;
if ($Product) {
$str = $str. ‘
‘. $Product .’
‘;
}
return $str;
}
add_shortcode(‘datedate’, ‘datedate’);
function bbloomer_redirect_checkout_add_cart( $url ) {
$param = $_REQUEST[‘add-to-cart’];
$glue = (strpos($_SERVER[‘REQUEST_URI’], ‘?’) !== false) ? ‘&’ : ‘?’;
$url = $_SERVER[‘REQUEST_URI’].$glue.’cart=1′;
return $url;
}
add_filter( ‘woocommerce_add_to_cart_redirect’, ‘bbloomer_redirect_checkout_add_cart’ );
add_filter( ‘woocommerce_cart_item_permalink’, ‘__return_null’ );
add_action(‘woocommerce_before_order_notes’, ‘custom_checkout_field’);
function custom_checkout_field($checkout)
{
global $woocommerce;
$items = $woocommerce->cart->get_cart();
$categories = array( ‘no-shipping’);
$found = false;
// Loop through each cart item Checking for the defined product categories
foreach( $items as $item => $values ) {
if ( has_term( $categories, ‘product_cat’, $values[‘product_id’] ) ){
$found = true;
break;
}
}
if ( $found ) {
echo ‘
‘;
}
echo ‘
הזמנות מעכשיו לעכשיו ניתן להתקשר לקייקרי טלפון. 077-4540065
הערות\ברכה
‘; woocommerce_form_field(‘custom_field_name’, array( ‘type’ => ‘text’, ‘class’ => array( ‘my-field-class form-row-wide’ ) , ‘label’ => __(‘ברכה למישהו\מישהי?’), ‘placeholder’ => __(”) , ) , $checkout->get_value(‘custom_field_name’)); echo ‘הערות להזמנה: ‘ . get_post_meta( $order->id, ‘custom_field_name’, true ) . ‘
‘; } function remove_image_zoom_support_webtalkhub() { remove_theme_support( ‘wc-product-gallery-zoom’ ); remove_theme_support( ‘wc-product-gallery-lightbox’ ); } add_action( ‘wp’, ‘remove_image_zoom_support_webtalkhub’, 100 ); add_action( ‘woocommerce_before_checkout_form’, ‘wp_kama_woocommerce_before_cart_table_action’ ); add_action( ‘woocommerce_before_cart’, ‘wp_kama_woocommerce_before_cart_table_action’ ); function wp_kama_woocommerce_before_cart_table_action(){ $categories = array(‘Special delivery’); $has_category = false; // Loop through cart items foreach ( WC()->cart->get_cart() as $cart_item ) { // Check for product categories if ( has_term( $categories, ‘product_cat’, $cart_item[‘product_id’] ) ) { $has_category = true; break; } } // Testing output (display a notice) if ( $has_category ) { } else{ echo ‘ ‘; } echo ‘‘; } add_action( ‘woocommerce_proceed_to_checkout’, ‘shippingmessage’ ); function shippingmessage(){ echo do_shortcode(‘העוגות שלנו נשלחות ברכב בקירור ישירות מהקייקרי באלנבי 31, ת”א
רשימת הערים למשלוחים:
אבן יהודה, בצרה, בני ציון, ארסוף, שפיים, קדימה צורן, תל מונד,הוד השרון, הרצליה, רעננה, כפר סבא,נתניה, כפר יונה, רמת השרון, פתח תקווה, ראש העין, יהוד מונוסון, קרית אונו, סביון, אור יהודה, שוהם, רחובות, נס ציונה, ראשון לציון, חולון, בת ים, הוד השרון, הרצליה, גבעתיים, רמת גן, בני ברק, תל אביב.
לא מצאתם את הכתובת שלכם ברשימת המשלוחים שלנו?
אל תהססו ליצור איתנו קשר ואנחנו נעשה מה שנוכל כדי להגיע
מוצרי הכלים של ברוסטה קופנהגן
נשלחים עם חברת שליחויות. מחיר משלוח 45ש”ח, זמן הספקה עד 5 ימי עסקים.
‘ . $retrived_group_input_value.’ עדכון כתובת
‘;
}
return $str;
}
add_shortcode (‘Shippingnotice’, ‘Shippingnotice’ );
add_action( ‘template_redirect’, ‘redirect_to_specific_page’ );
function redirect_to_specific_page() {
$retrived_group_input_value = WC()->customer->get_billing_postcode();
if ( is_product() && has_term( 60 , ‘product_cat’ ) && (!$retrived_group_input_value) ) {
wp_redirect( ‘/shipping-calculation/’, 301 );
exit;
}
}