Retrieve Woocommerce Cart Url with javascript/jquery [closed]

You can pass it to the script via the functions.php file or a plugin using the wp_localize_script function. <?php function my_load_scripts() { wp_enqueue_script(‘my-script’, plugin_dir_url( __FILE__ ) . ‘js/my-script.js’); wp_localize_script(‘my-script’, ‘my_script_vars’, array( ‘woo_cart_url’ => get_permalink( wc_get_page_id( ‘cart’ ) ) ) ); } add_action(‘wp_enqueue_scripts’, ‘my_load_scripts’); Then it will be available in your script ( in the example: … Read more

Woocommerce section name? [closed]

WOO custmizer settings are under ‘woocommerce’ customizer panel ( panel has been added since WP 4.0) add_action(‘customize_register’,”SE_add_options_t_woo_customizer”); function SE_add_options_t_woo_customizer($wp_customize ){ $wp_customize->add_section( “my_new_section” , array( ‘title’ => “My new section”, ‘priority’ => 20, ‘panel’ => ‘woocommerce’, // here is where you grab the woocommerce panel to add settings and controls to ) ); $wp_customize->add_setting(‘my_new_setting’, array( ‘default’ … Read more

Disaply products from category

If you’re actually using categories (and not a custom taxonomy) then your category-name needs to be the slug, not the actual name. If, however, you are using a custom taxononomy (and you’ll know if you are) then you should use ‘name-of-your-custom-tax’ => ‘slug’ You can also see the below links for details. http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

Using category and its sub-categories products attributes as filter in products pages

It’s possible to do it with Advanced AJAX Product Filters plugin. It allows you to use attributes in the filter. Follow these steps: Install and activate the plugin. In the right sidebar, click on Widgets. Under Filter By option, select Attribute. Under Atrribute option, which is located beside Filter By, choose the attribute of your … Read more