Forum Replies Created

Viewing 15 replies - 1 through 15 (of 94 total)
  • works for me. thanks guys!
    tested pro version with business account and free version with personal account.

    following for updates on the issue! πŸ˜€

    Thread Starter teleanu

    (@teleanu)

    nevermind, was needed to add linked products (stupid me).

    <3 Ashe

    Thread Starter teleanu

    (@teleanu)

    i.yith-wcwl-icon {
        font-weight: bold;
    }

    this fixed my issue!

    I think I have some issues with the heart turning grey after I add a product into the wishlist on the shop gallery (the heart that is on the photo). After I add a product to the wishlist, the heart it stays the same… with the outline heart.

    For sure there is some css from the theme or other plugins. is there a way to overwrite the css for that specific action (if I have a product in the wishlist the heart to be full grey)?

    in the shop gallery (not single product)
    Thx

    Thread Starter teleanu

    (@teleanu)

    Thank you WP Royal for the answer, but I made it myself.
    Was needed to add only this

    name="post_type" value="product"

    If this was a big deal for the supporting team…
    Have a good one!

    Thread Starter teleanu

    (@teleanu)

    @alessio91 I sent you a msg on slack. Check your PM! thx

    Thread Starter teleanu

    (@teleanu)

    https://i.imgur.com/Iog4dOR.png

    Click on those products where it says SELECT OPTIONS. On those products I have applied YITH WooCommerce Product Add-Ons. And when un click on SELECT OPTIONS check the browser wheel and u will see that will NOT start loading right away like it does on products that don’t have “YITH WooCommerce Product Add-Ons” options.

    Thread Starter teleanu

    (@teleanu)

    https://michisor.ro/test

    [redacted]

    the site is in “under construction” mode.
    Go to that address to access it and then u can browse the site as a normal user would do.

    Go and click on a normal product (ADAUGA IN COS meaning ADD TO CART) and then go and click on SELECT OPTIONS and check the loading wheel from browser tab to see that will start later after ur click.

    Thread Starter teleanu

    (@teleanu)

    Hey Alessio.

    I know that this is not something that already exists and I know is not a quick thing. I was woundering maybe you guys will take this in consideration and added it in the plugin in the future or “near” future πŸ˜€

    thx

    Thread Starter teleanu

    (@teleanu)

    I changed this is_ajax with wp_doing_ajax in plugin-name/includes/class-yith-wapo-cart.php

    
    // Disable add_to_cart_button class on shop page.
    			if ( wp_doing_ajax() && ! isset( $_REQUEST['yith_wapo_is_single'] )
    

    insted of

    
    // Disable add_to_cart_button class on shop page.
    			if ( is_ajax() && ! isset( $_REQUEST['yith_wapo_is_single'] )
    

    And seams to work. I don’t get the error anymore. But still… This is a fast patch on my side. An update to your side is needed too.

    Thank you!

    Thread Starter teleanu

    (@teleanu)

    Thank you… it worked.

    But I change it a little bit by removing

    if( $template_type == 'invoice')

    Now it looks like this because I wanted it on the slip too:

    /**
     * Show CNP number on the invoice
     */
    add_action( 'wpo_wcpdf_after_billing_address', function($template_type, $order){
    	{
    		if ( $billing_cnp  = $order->get_meta( '_billing_cnp' ) ){
    			echo '<div>CNP: ' . $billing_cnp  . '</div>';
    		}
    	}
    }, 10, 2 );

    I checked and haven’t saw any error after that modification. The CNP is added under the billing address as wanted, both on invoice & packing slip. Don’t know if that is the way to do it, but worked. If u have any idea of adding on both, please share. thank you for helping me with the initial code.

    Thread Starter teleanu

    (@teleanu)

    I’v added it after the order data

    I tried adding it after billing address, but for some reason it doesn’t work.
    If you guys have a solution for that would be awesome… If not, I’m ok with it after the order date too.

    Code used:

    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_billing_cnp', 10, 2 );
    function wpo_wcpdf_billing_cnp( $template_type, $order ) {
    	// if order is empty, bail
    	if ( empty($order) ) { return; }	
    
    	?>      
    	<tr class="billing-cnp">
    		<th>CNP: </th>
    		<td><?php echo $order->get_meta('_billing_cnp'); ?></td>
    	</tr>
    	<?php
    }
    Thread Starter teleanu

    (@teleanu)

    the script in action
    https://i.imgur.com/whiVurL.gif

    • This reply was modified 4 months, 2 weeks ago by teleanu.
    Thread Starter teleanu

    (@teleanu)

    resolved!

    What i’v modified:
    – the heart is separated from the count
    – the count has it’s own style
    – the count doesn’t show if there are 0 products in the list
    (check the .gif from my last comment to see how it looks and works)

    functions.php (in child theme – never work on the main theme files)

    /**
     * @snippet       Display WISHLIST Count in Menu
     */
    
    if ( defined( 'YITH_WCWL' ) && ! function_exists( 'yith_wcwl_get_items_count' ) ) {
      function yith_wcwl_get_items_count() {
        ob_start();
        ?>
          <a href="<?php echo esc_url( YITH_WCWL()->get_wishlist_url() ); ?>">
            <span class="yith-wcwl-icon">
            </span>
            <span class="yith-wcwl-items-count">
              <?php $c = yith_wcwl_count_all_products(); if($c != 0) {echo esc_html($c);} ?>
            </span>
          </a>    <?php
        return ob_get_clean();
      }
    
      add_shortcode( 'yith_wcwl_items_count', 'yith_wcwl_get_items_count' );
    }
    
    if ( defined( 'YITH_WCWL' ) && ! function_exists( 'yith_wcwl_ajax_update_count' ) ) {
      function yith_wcwl_ajax_update_count() {
        wp_send_json( array(
          'count' => yith_wcwl_count_all_products()
        ) );
      }
    
      add_action( 'wp_ajax_yith_wcwl_update_wishlist_count', 'yith_wcwl_ajax_update_count' );
      add_action( 'wp_ajax_nopriv_yith_wcwl_update_wishlist_count', 'yith_wcwl_ajax_update_count' );
    }
    
    if ( defined( 'YITH_WCWL' ) && ! function_exists( 'yith_wcwl_enqueue_custom_script' ) ) {
      function yith_wcwl_enqueue_custom_script() {
        wp_add_inline_script(
          'jquery-yith-wcwl',
          "
            jQuery( function( $ ) {
              $( document ).on( 'added_to_wishlist removed_from_wishlist', function() {
                $.get( yith_wcwl_l10n.ajax_url, {
                  action: 'yith_wcwl_update_wishlist_count'
                }, function( data ) {
                  $('.yith-wcwl-items-count').html(data.count == 0 ? '' : data.count);
                } );
              } );
            } );
          "
        );
      }
    
      add_action( 'wp_enqueue_scripts', 'yith_wcwl_enqueue_custom_script', 20 );
    }

    main-navigation.php (in child theme – never work on the main theme files)

    
    <div class="main-nav-wishlist">
    
    <?php echo do_shortcode("[yith_wcwl_items_count]"); ?>
    </div>
    

    style.css (in child theme – never work on the main theme files)

    .yith-wcwl-icon:before {
        font-family: 'Font Awesome 5 Free';
        font-variant: regular;
        content: "\f004" !important;
        font-size: 16px;
    
    }
    
    .yith-wcwl-icon:hover {
        text-decoration: none;
    }
    
    .yith-wcwl-items-count {
    	position: absolute;
        	top: 15px;
       	right: 1px;
       	transform: translateY(39%) translateX(100%);
    	font-family: Arial, Helvetica, sans-serif;
    	font-weight: normal;
    	font-size: 10px;
    	line-height: 15px;
    	height: 15px;
       	width: 15px;
    	vertical-align: middle;
    	text-align: center;
        	border-radius: 50%;
        	padding: -2px;  
    }
    • This reply was modified 4 months, 2 weeks ago by teleanu.
    • This reply was modified 4 months, 2 weeks ago by teleanu.
Viewing 15 replies - 1 through 15 (of 94 total)