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 theround
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 theround
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.
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?.