Shortcode in WooCommerce
If you want to have a new custom shortcode in WooCommerce, you can add the codes in wp-content\plug-ins\woocommerce\includes\class-wc-shortcode.php. That will works, however, that is not the best practice. Because if some one updated the woocomerce plug-ins, then your custom code will be overwritten. I suggest you write your plug-in, Then using:
Code
add_shortcode( 'list_products', 'list_products' ); | |
function list_products( $atts ) { | |
.... | |
} |
Then you can have your own shortcode, then you can use global $woocommerce_loop; , that global variable to retrieve the data from woocommerce.
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 61 feedbacks awaiting moderation...
Form is loading...