WPIntell

Source evidence

Shortcode for custom list

Flexible Wishlist for WooCommerce – Ecommerce Wishlist & Save for later · support · 2024-06-12T08:48:00+00:00

mixedsentiment
lowseverity
0.68relevance
2replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 31 rows with source links

9.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
matppp resolved
Hi, is there any shortcode to display Wishlist button in custom list? For example, I have ACF Post Object and I want to add Wishlist button after Add to cart. <?php $items = get_field('items'); if( $items ): echo '<ul class="products products-slide-mobile c-100">'; foreach( $items as $product_id ): $product = wc_get_product( $product_id ); if( $product ): echo '<li class="product" data-aos="fade-up" data-aos-duration="1100">'; echo '<a href="' . get_permalink( $product->get_id() ) . '">'; echo wp_get_attachment_image( $product->get_image_id(), 'medium_large' ); echo '</a>'; if ($product->is_on_sale()) { echo '<span class="onsale">' . __('Sale!', 'woocommerce') . '</span>'; } echo '<h2 class="woocommerce-loop-product__title"><a href="' . get_permalink( $product->get_id() ) . '">' . $product->get_name() . '</a></h2>'; echo '<span class="price">' . $product->get_price_html() . '</span>'; echo woocommerce_template_loop_add_to_cart(); HOW TO ADD HERE WISHLIST BUTTON? echo '</li>'; endif; endforeach; echo '</ul>'; endif; ?> Hi matppp Thank you for feedback. This could work. You would need to have the same HTML in the code as there is for the button. You can check in templates/shop-loop/add-to-cart-left.php but the minimum HTML for such a button to work is: <a href="#add-to-wishlist" class="fw-button fw-button--before fw-button--active" data-product-id="echo esc_attr( $product->get_id() ); ?>"><span class="fw-button-icon></span></a> If you apply this code, it should work. Feel free to contact me if you have more questions. Hi matppp As we haven’t got any replies, I’m marking this topic as resolved for now.

Comments

2 shown
rzepsen 2024-06-12T12:29:00+00:00

Hi matppp Thank you for feedback. This could work. You would need to have the same HTML in the code as there is for the button. You can check in templates/shop-loop/add-to-cart-left.php but the minimum HTML for such a button to work is: <a href="#add-to-wishlist" class="fw-button fw-button--before fw-button--active" data-product-id="echo esc_attr( $product->get_id() ); ?>"><span class="fw-button-icon></span></a> If you apply this code, it should work. Feel free to contact me if you have more questions.

rzepsen 2024-06-20T13:06:00+00:00

Hi matppp As we haven’t got any replies, I’m marking this topic as resolved for now.