Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1076351

    I have tried to move the product price in a simpel product overview, created with the product grid, to the top-right corner.
    After searching quite a lot I found another thread with a code that I should add to the functions.php of my child theme, but it still doesn’t work.
    I’m referring to: https://kriesi.at/support/topic/change-the-position-of-a-div-in-the-woocommerce-product-grid/

    I used the code:

    // Price Position start adjustment
    function add_custom_price_pos(){
    ?>
    <script>
    jQuery(window).load(function(){
        jQuery('span.amount').each(function() {
            var movePrice = jQuery(this);
            movePrice.prev().append( movePrice.html() );
            jQuery(this).parents('.inner_product').find('.thumbnail_container').append('<span class="price">'+'<span class="amount">'+movePrice.html()+'</span>'+'</span>');
            console.log('Price is  :' + movePrice.html());   
        });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_price_pos');

    What should I do to solve this?

    #1076401

    Never mind, I’ve got it solved by using:

    // custom script
    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script>
    (function($){
    	function h() {
    	$('#top .product').each(function() {
    		var price = $(this).find('.price'),
    			thumb = $(this).find('.thumbnail_container');
    
    		price.appendTo(thumb);
    	});
    	}
    
    	h();
    })(jQuery);
    </script>
    <?php
    }
    #1076727

    Hi,

    Great, I’m glad you found a solution and thanks for sharing. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.