Ido Angel
In den letzten 30 Tagen erstellte Support-Threads: 0
Lieblings-Forenthemen
This user has no favorite topics.
Forum Topics Created
| Status | Thema | Supporter | Stimmen | Artikel | Aktualität |
|---|---|---|---|---|---|
|
Filter products by the ones which are currently in the cart
Gestartet von: Ido Angel
in: Toolset Professional Support
Problem: The user wanted to display a view of products according to the ones which are currently in the cart on the checkout page. Although not possible using native Toolset tools, custom PHP code can be used to achieve this. Solution: - Utilize WooCommerce hooks to get the list of products currently in the cart. function wpc_elementor_shortcode( $atts ) {
// Get full cart object
$items = WC()->cart->get_cart();
// Initialize array to store product IDs
$product_ids = array();
// Loop through cart items
foreach( $items as $item => $values ) {
// Load product object
$product = wc_get_product( $values['data']->get_id() );
// Access product data using product object
$product_id = $product->get_id();
// Add product ID to array
$product_ids[] = $product_id;
}
// Join product IDs into comma-separated string
$product_ids_string = implode( ', ', $product_ids );
// Output comma-separated list of product IDs
echo $product_ids_string;
}
add_shortcode( 'my_elementor_php_output', 'wpc_elementor_shortcode');
- Use the shortcode [my_elementor_php_output] to output the comma-separated list of product IDs currently in the cart. Relevant Documentation: WooCommerce - Get Products in Cart: https://wpdavies.dev/woocommerce-get-products-in-cart/ Toolset - Adding Custom Code: https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/ PHP Implode function: https://www.php.net/manual/en/function.implode.php |
|
2 | 5 | vor 2 years, 10 months | |
|
relevanssi prevents from ordering by custom field
Gestartet von: Ido Angel in: Toolset Professional Support |
|
3 | 5 | vor 3 years, 4 months | |
|
taxonomy shows up only for a random post…
Gestartet von: Ido Angel in: Toolset Professional Support |
1 | 2 | vor 3 years, 4 months | ||
|
wpv-post-next-link not working properly
Gestartet von: Ido Angel in: Toolset Professional Support |
|
3 | 9 | vor 3 years, 5 months | |
|
Infinite scroll created duplicate entries
Gestartet von: Ido Angel in: Toolset Professional Support |
|
2 | 5 | vor 3 years, 7 months | |
|
display taxonomy's parent in taxonomy view
Gestartet von: Ido Angel in: Toolset Professional Support |
|
2 | 5 | vor 4 years |