douruduan8812 2018-07-10 01:56
浏览 74

产品列表 - 产品标题正在切割 - Avada主题,wordpress

i have problem that i didn't find how to solve it. I am using Woocommerace (v3.3.3) in Advada template, in a category page I have all the products, its look with the source code that its do manipulation on Post product and rebuild it like a list with the product. The problem is that the name of the product is getting cut and I want it to be fully length

This is how look 1 product in the list:

<li class="post-12366 product type-product status-publish has-post-thumbnail product_cat-all product_cat-new product-grid-view instock sale shipping-taxable purchasable product-type-simple">
    <a href="url" class="product-images" aria-label="Enhancing Romantic Desire">

    <span class="onsale">Sale!</span>

<div class="featured-image">
        <img width="500" height="500" src="image">            <div class="cart-loading"><i class="fusion-icon-spinner"></i></div>
    </div>
</a>
<div class="br_alabel br_alabel_label br_alabel_type_text br_alabel_right" style="top:-10px;right:0px;"><span style="height: 50px;width: 50px;background-color:#245673;color:#ffffff;border-radius:50px;line-height:50px;">New!</span></div><div class="product-details">
    <div class="product-details-container">
<h3 class="product-title">
    <a href="https://url/product/enhancing-romantic-desire/">
        Enhancing Romantic Des  </a>
</h3>
<div class="fusion-price-rating">

    <span class="price"><del><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>150.00</span></del> <ins><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>575.00</span></ins></span>
        </div>
        <div class="fusion-content-sep"></div>
    </div>
</div>

                <div class="product-buttons">
            <div class="product-buttons-container clearfix">
    <a href="/product-category/all/?add-to-cart=12366" data-quantity="1" class="button product_type_simple add_to_cart_button ajax_add_to_cart" data-product_id="12366" data-product_sku="" aria-label="Add “Enhancing Romantic Desire” to your cart" rel="nofollow">Add to cart</a><a href="url" class="show_details_button">
    Details</a>
    </div>
</div>
</li>

So under class product-title we can see the the title cut, i tried to add function to change the name with :

add_action('woocommerce_shop_loop_item_title','full_title',10);

but its only add before the title and didn't replace it. i tried also to find which page is the source but didn't find it.

I think that there is function that cut the title length, i tried to find but no any result...

Any suggestion please?

Thanks for the help

</div>
  • 写回答

1条回答 默认 最新

  • douyong1285 2018-07-10 05:45
    关注

    Try something like this. You can register your own function here

    function remove_avada_woocommerce_edits() {
    
        global $avada_woocommerce;
        remove_action( 'woocommerce_shop_loop_item_title', array( $avada_woocommerce, 'product_title' ), 10 );
    
    }
    
    add_action('init','remove_avada_woocommerce_edits');
    
    评论

报告相同问题?

悬赏问题

  • ¥20 关于php中URL传递GET全局变量的问题
  • ¥15 怎么改成循环输入删除(语言-c语言)
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧
  • ¥15 图示五个参数的模型校正是用什么方法做出来的。如何建立其他模型
  • ¥100 描述一下元器件的基本功能,pcba板的基本原理
  • ¥15 STM32无法向设备写入固件