Title: brzeda's Replies | WordPress.org

---

# brzeda

  [  ](https://wordpress.org/support/users/brzeda/)

 *   [Profile](https://wordpress.org/support/users/brzeda/)
 *   [Topics Started](https://wordpress.org/support/users/brzeda/topics/)
 *   [Replies Created](https://wordpress.org/support/users/brzeda/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/brzeda/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/brzeda/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/brzeda/engagements/)
 *   [Favorites](https://wordpress.org/support/users/brzeda/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/users/brzeda/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/brzeda/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17352157)
 * Okey, but that is simple product. Could you show me variable ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17350649)
 * same with FOX currency switcher
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17350641)
 * But I have another problem with curcy now.
    1. Everything works fine with default currency. Prices on shop and single page 
       are correct and after adding to cart also they are the same.
    2. When switching to EUR product prices on shop page and single product page are
       correct, but when adding to cart then they are different. That is only when 
       dynamic rule with discount is set. As below:
       [https://drive.google.com/file/d/1kdyVCuoRXq-aiEdFUFJQ0v-SfqXce0bQ/view?usp=sharing](https://drive.google.com/file/d/1kdyVCuoRXq-aiEdFUFJQ0v-SfqXce0bQ/view?usp=sharing)
 * We are using CURCY currency switcher. 
   any idea?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17350544)
 * I have changed that code of your plugin from:
 * 2663 line
 * return round( apply_filters(‘b2bking_final_discounted_price’, $smallest_discounted_price,
   $current_product_id), $decimals );
   to:return round( apply_filters(‘b2bking_final_discounted_price’,
   $smallest_discounted_price, $current_product_id), (int)$decimals );That warning
   we were encountering indicates that the second parameter of the `round` function,
   which is `$decimals`, is expected to be an integer, but it is currently a string.
   To resolve this issue, you need to ensure that `$decimals` is converted to an
   integer before passing it to the `round` function.By adding `(int)` before `$
   decimals`, you explicitly cast it to an integer. This resolve the problem.
 * You can update the plugin 🙂 We have store using savoy theme.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17350457)
 * I’ve made some change and that helped :
 * return round( apply_filters(‘b2bking_final_discounted_price’, $smallest_discounted_price,
   $current_product_id), (int)$decimals );
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17350361)
 * **Warning**: round() expects parameter 2 to be int, string given in 
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17350311)
 * Now I see the error: **public_html/wp-content/plugins/b2bking-the-ultimate-woocommerce-
   b2b-plugin-4.9.10/public/class-b2bking-dynamic-rules.php** on line **2663**
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17347681)
 * Doesn’t matter if its set for registers users or b2b users always its discounted
   100 % instead of 40%. Its 40% for cart total. Using Savoy theme but on twenty
   also occurs.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[B2BKing — Ultimate WooCommerce B2B and Wholesale Plugin — Wholesale Prices, Bulk Order Form & More] Discount apply as 100% and products price is 0 usd](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/discount-apply-as-100-and-products-price-is-0-usd/#post-17347578)
 * [https://freeimage.host/i/JY8G5CJ](https://freeimage.host/i/JY8G5CJ)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH WooCommerce Product Add-Ons] Product options insert to customer note.](https://wordpress.org/support/topic/product-options-insert-to-customer-note/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/product-options-insert-to-customer-note/#post-17196441)
 * Or maybe give me a guide what is that data in red frame? Is it product meta or
   variation or option programmatically ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YITH WooCommerce Product Add-Ons] Product options insert to customer note.](https://wordpress.org/support/topic/product-options-insert-to-customer-note/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/product-options-insert-to-customer-note/#post-17194999)
 * I mannaged to make a code:
 *     ```wp-block-code
       add_action( 'woocommerce_new_order', 'products_in_customer_notes', 10, 2 );
   
       function products_in_customer_notes( $order_id, $order ) {
   
           // Verify it's a WC Order
           if ( is_a( $order, 'WC_Order' ) ) {
               $customer_note = $order->get_customer_note();
   
                 foreach ( $order->get_items() as $item_id => $item ) {
                     $product_name = $item->get_name();
                     $quantity = $item->get_quantity();
                     $customer_note .= "<br>";
                     $customer_note .= $quantity . 'x ' . $product_name;
                 }
   
               // Add the note
               $order->set_customer_note($customer_note);
   
               // Save the data
               $order->save();
           }
       }
       ```
   
 * It works but still Yith Product options doesn’t copy in there. Only product.
 * Any idea?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Omnibus — show the lowest price] Pomoc w umieszczeniu w quickview motywu](https://wordpress.org/support/topic/pomoc-w-umieszczeniu-w-quickview-motywu/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/pomoc-w-umieszczeniu-w-quickview-motywu/#post-16407199)
 * Podałbyś mail ?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Omnibus — show the lowest price] Pomoc w umieszczeniu w quickview motywu](https://wordpress.org/support/topic/pomoc-w-umieszczeniu-w-quickview-motywu/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/pomoc-w-umieszczeniu-w-quickview-motywu/#post-16405709)
 *     ```wp-block-code
       <?php
       /**
        * WooCommerce Quick View template hooks.
        *
        * @package Razzi
        */
   
       namespace Razzi\WooCommerce\Modules;
       use Razzi\Helper;
   
       if ( ! defined( 'ABSPATH' ) ) {
       	exit; // Exit if accessed directly.
       }
   
       /**
        * Class of Product Quick View
        */
       class Quick_View {
       	/**
       	 * Instance
       	 *
       	 * @var $instance
       	 */
       	protected static $instance = null;
   
       	/**
       	 * Initiator
       	 *
       	 * @since 1.0.0
       	 * @return object
       	 */
       	public static function instance() {
       		if ( is_null( self::$instance ) ) {
       			self::$instance = new self();
       		}
   
       		return self::$instance;
       	}
   
       	/**
       	 * Instantiate the object.
       	 *
       	 * @since 1.0.0
       	 *
       	 * @return void
       	 */
       	public function __construct() {
       		// Quick view modal.
       		add_action( 'wc_ajax_product_quick_view', array( $this, 'quick_view' ) );
   
       		add_action( 'razzi_woocommerce_product_quickview_thumbnail', 'woocommerce_show_product_images', 10 );
       		add_action( 'razzi_woocommerce_product_quickview_thumbnail', array(
       			$this,
       			'product_quick_view_more_info_button'
       		) );
   
       		add_action( 'razzi_woocommerce_product_quickview_summary', 'woocommerce_template_single_rating', 10 );
       		add_action( 'razzi_woocommerce_product_quickview_summary', 'woocommerce_template_single_title', 20 );
       		add_action( 'razzi_woocommerce_product_quickview_summary', array(
       			$this,
       			'open_price_box_wrapper'
       		), 30 );
   
       		if ( apply_filters( 'razzi_product_show_price', true ) ) {
       			add_action( 'razzi_woocommerce_product_quickview_summary', 'woocommerce_template_single_price', 40 );
       		}
   
       		add_action( 'razzi_woocommerce_product_quickview_summary', array(
       			\Razzi\WooCommerce\Helper::instance(),
       			'product_availability'
       		), 50 );
       		add_action( 'razzi_woocommerce_product_quickview_summary', array(
       			$this,
       			'close_price_box_wrapper'
       		), 60 );
       		add_action( 'razzi_woocommerce_product_quickview_summary', 'woocommerce_template_single_excerpt', 70 );
       		add_action( 'razzi_woocommerce_product_quickview_summary', 'woocommerce_template_single_add_to_cart', 80 );
       		add_action( 'razzi_woocommerce_product_quickview_summary', 'woocommerce_template_single_meta', 90 );
   
       		add_action( 'wp_footer', array( $this, 'quick_view_modal' ), 40 );
       	}
   
       	/**
       	 * Open button wrapper
            *
       	 * @since 1.0.0
       	 *
       	 * @return void
       	 */
       	public function open_price_box_wrapper() {
       		echo '<div class="summary-price-box">';
       	}
   
       	/**
       	 * Close button wrapper
            *
       	 * @since 1.0.0
       	 *
       	 * @return void
       	 */
       	public function close_price_box_wrapper() {
       		echo '</div>';
       	}
   
       	/**
       	 * Product quick view template.
       	 *
       	 * @since 1.0.0
       	 *
       	 * @return void
       	 */
       	public function quick_view() {
       		if ( empty( $_POST['product_id'] ) ) {
       			wp_send_json_error( esc_html__( 'No product.', 'razzi' ) );
       			exit;
       		}
   
       		$post_object = get_post( $_POST['product_id'] );
       		if ( ! $post_object || ! in_array( $post_object->post_type, array(
       				'product',
       				'product_variation',
       				true
       			) ) ) {
       			wp_send_json_error( esc_html__( 'Invalid product.', 'razzi' ) );
       			exit;
       		}
       		$GLOBALS['post'] = $post_object;
       		wc_setup_product_data( $post_object );
       		ob_start();
       		wc_get_template( 'content-product-quickview.php', array(
       			'post_object' => $post_object,
       		) );
       		wp_reset_postdata();
       		wc_setup_product_data( $GLOBALS['post'] );
       		$output = ob_get_clean();
   
       		wp_send_json_success( $output );
       		exit;
       	}
   
       	/**
       	 * Quick view modal.
            *
       	 * @since 1.0.0
       	 *
       	 * @return void
       	 */
       	public function quick_view_modal() {
       		if( Helper::is_cartflows_template() ) {
       			return;
       		}
       		$featured_icons = (array) Helper::get_option( 'product_loop_featured_icons' );
       		if ( ! in_array( 'qview', $featured_icons ) ) {
       			return;
       		}
       		?>
               <div id="quick-view-modal" class="quick-view-modal rz-modal single-product">
                   <div class="off-modal-layer"></div>
                   <div class="modal-content container woocommerce">
                       <div class="button-close active">
       					<?php echo \Razzi\Icon::get_svg( 'close' ) ?>
                       </div>
                       <div class="product"></div>
                   </div>
                   <div class="razzi-posts__loading">
                       <div class="razzi-loading"></div>
                   </div>
               </div>
       		<?php
       	}
   
       	/**
       	 * Quick view more info button
       	 *
       	 * @since 1.0.0
       	 *
       	 * @return void
       	 */
       	public function product_quick_view_more_info_button() {
       		printf(
       			'<a href="%s" class="product-more-infor">
       				<span class="product-more-infor__text">%s</span>%s
       			</a>',
       			is_customize_preview() ? '#' : esc_url( get_permalink() ),
       			apply_filters( 'product_quick_view_more_infor_text', esc_html__( 'More Product Info', 'razzi' ) ),
       			\Razzi\Icon::get_svg( 'infor', '', 'shop' )
       		);
       	}
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Omnibus — show the lowest price] Ilość w magazynie](https://wordpress.org/support/topic/ilosc-w-magazynie/)
 *  Thread Starter [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/ilosc-w-magazynie/#post-16355461)
 * Dzięki, udało się to wynieść wyżej. Dokodowana reszta.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Omnibus — show the lowest price] Nie jest źle, ale wtyczka podaje błędną cenę – ważne :)](https://wordpress.org/support/topic/nie-jest-zle-ale-wtyczka-podaje-bledna-cene-wazne/)
 *  [brzeda](https://wordpress.org/support/users/brzeda/)
 * (@brzeda)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/nie-jest-zle-ale-wtyczka-podaje-bledna-cene-wazne/#post-16355453)
 * Jednak nie działa to do końca dobrze.
 * Mechanizm powinien porównywać ceny regularne i promocyjne. W chwili gdy uruchamiasz
   promocję dla wybranego produktu, mechanizm sprawdza za ile najtaniej Twój klient
   mógł kupić ten produkt w ciągu ostatnich 30 dni przed obniżką. Jeśli produkt 
   nie był w promocji, będzie to **cena regularna**. Jeśli produkt był w promocji
   kilka razy, to wybrana będzie **najniższa cena z tego okresu**.
 * Przykładowo w sytuacji, gdy cena regularna 20 dni temu wynosiła 40 zł a w momencie
   uruchomienia promocji wynosi 60 zł i obniżasz ją na 50 zł to, jako najniższa 
   cena z okresu 30 dni, wyświetli się 40 zł.
 * Jeśli produkt nie był przeceniony w ostatnich 30 dniach to najniższą ceną przed
   obniżką powinna być cena regularna bo ta była najniższą ceną przed promocją.
 *  [https://prnt.sc/63_kLhAnyVmH](https://prnt.sc/63_kLhAnyVmH)
 * Aby spełnić wymogi określone w art. 6a, podmiot gospodarczy ogłaszający obniżkę
   ceny musi podać **najniższą cenę pobieraną za dany towar w okresie co najmniej
   ostatnich 30 dni przed zastosowaniem obniżki ceny**.
 * Więc zakładając, że masz produkt który nie miał żadnej obniżki w ostatnich 30
   dniach, a jego cena wynosi 60 zł – postanawiamy obniżyć jego cenę o 20 zł. To
   najniższą ceną pobieraną za ten towar **w okresie co najmniej ostatnich 30 dni
   przed zastosowaniem obniżki ceny** będzie 60 zł.
    -  This reply was modified 3 years, 5 months ago by [brzeda](https://wordpress.org/support/users/brzeda/).
    -  This reply was modified 3 years, 5 months ago by [brzeda](https://wordpress.org/support/users/brzeda/).
    -  This reply was modified 3 years, 5 months ago by [brzeda](https://wordpress.org/support/users/brzeda/).
    -  This reply was modified 3 years, 5 months ago by [brzeda](https://wordpress.org/support/users/brzeda/).

Viewing 15 replies - 1 through 15 (of 26 total)

1 [2](https://wordpress.org/support/users/brzeda/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/brzeda/replies/page/2/?output_format=md)