brzeda
Forum Replies Created
-
Okey, but that is simple product. Could you show me variable ?
same with FOX currency switcher
But I have another problem with curcy now.
- Everything works fine with default currency. Prices on shop and single page are correct and after adding to cart also they are the same.
- 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
We are using CURCY currency switcher.
any idea?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 theroundfunction, which is$decimals, is expected to be an integer, but it is currently a string. To resolve this issue, you need to ensure that$decimalsis converted to an integer before passing it to theroundfunction.
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.
I’ve made some change and that helped :
return round( apply_filters(‘b2bking_final_discounted_price’, $smallest_discounted_price, $current_product_id), (int)$decimals );
Warning: round() expects parameter 2 to be int, string given in
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
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
In reply to: [YITH WooCommerce Product Add-Ons] Product options insert to customer note.Or maybe give me a guide what is that data in red frame? Is it product meta or variation or option programmatically ?
Forum: Plugins
In reply to: [YITH WooCommerce Product Add-Ons] Product options insert to customer note.I mannaged to make a 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
In reply to: [Omnibus — show the lowest price] Pomoc w umieszczeniu w quickview motywuPodałbyś mail ?
Forum: Plugins
In reply to: [Omnibus — show the lowest price] Pomoc w umieszczeniu w quickview motywu<?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
In reply to: [Omnibus — show the lowest price] Ilość w magazynieDzięki, udało się to wynieść wyżej. Dokodowana reszta.
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ą.
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ł.