Tag Info

New answers tagged

0

Here is a bit of code I am using for mine its for recent products but is doing the job. Just add to page you want to show them on. [recent_products per_page="4" columns="4" orderby="rand" order="rand"]


0

Solved: add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 ); function your_custom_menu_item ( $items, $args ) { if ($args->theme_location == 'top_navigation') { global $woocommerce; $quantity = $woocommerce->cart->cart_contents_count; $items .= '<li class="menu-cart"><a ...


0

The outdated files are in your theme's woocommerce folder (unless the theme has stored them elsewhere, but that is the default). You don't need this folder per se and can rename it (which is the more temporary way than flat-out deleting it) and WooCommerce will work. If you purchased the theme you could also contact their support and see about purchasing an ...


1

There is no actions/filters to hook to. You need to override standard WC_Email_Customer_New_Account class and implement your own logic. To do it you need to create your own class which will inherit that class and register it. class WPSE8170_Email_Customer_New_Account extends WC_Email_Customer_New_Account { function trigger( $user_id, $user_pass = '', ...


0

The solution for this is, in my opinion, divided into two steps. The first step is to set the variable, which defines the affiliate, that sends you the visitor. The second step is to display an appropriate logo based on the value of the first variable. The solution for the first step would probably look somewhat like this: if( isset($_GET['affiliate']) ...


0

Your $scr in your wp_register_script() function is wrong. Given that your functions.php is inside your plugin, and your removeArrows.js is in the root of your plugin, your $scr should look like this plugins_url( '/removeArrows.js' , __FILE__ ) Another point of note, it is always good practice to load your scripts and styles last. This will ensure that it ...


0

I would not add another external js file, its just an extra and unnecessary resource to fetch and that is something we want to cut down on in terms of page loading times. I would add this jQuery snippet in your websites head using the wp_head hook. You would paste the following in your theme or plugins functions file. I have also made sure jQuery is in ...


0

The following is the relevant WooCommerce code. It is hooking into the template_redirect WordPress hook. If the page id matches the page you've set as the shop page, WordPress will redirect to the product post type archive. /** * Handle redirects before content is output - hooked into template_redirect so is_page works. * * @return void */ function ...


0

You could add a rewrite rule to improve the appearance of the URL while maintaining the same functionality: As an example: add_action('init', 'custom_shop_param'); function custom_shop_param() { add_rewrite_tag('%param%','([^&]+)'); add_rewrite_rule('^shop/([^/]+)/?$','index.php?page=shop&param=$matches[1]','top'); } When you visit ...


1

Nope, the WP is pretty flexible about this and will perfectly handling omitted fields. Including assigning IDs (which is actually best left to it, outside of edge cases when exact IDs must be imported). The only situation that natively won't let you create post is if neither of title/content/excerpt is provided and post type supports any of them. Even then ...


0

You'll probably find your post is flagged as off-topic but if it isn't, I'd strongly suggest using one of the WooCommerce import plugins rather than a manual import. WooThemes have one on their site specifically for importing CSV. Another very powerful tool is WP All Import (and WooCommerce extension). I've tried the manual path - these tools are a much ...


0

For anyone looking for an answer on this, I found that setting the max_allowed_packets to 32 helped as well as turning off mod security on the host side. I hope this helps.


0

Use get_term_by: $id = 42; if( $term = get_term_by( 'id', $id, 'product_cat' ) ){ echo $term->name; }


1

Thanks Pieter, that solved the issue. I'm writing below some details just in case someone comes here in future. As stated by Pieter in answer above, using !is_page is for excluding the page in opposite of using is_page for including functions for that page. In my case, I noticed two things. <?php if(!is_shop() && (!is_front_page())) {?> I ...


1

The opposite of is_page() will be ! is_page(). In php the ! is used as negative, so ! is_page( 42 ) will means something like if we are not on page ID 42, do something, in other words exclude page ID 42


0

As Mark Davidson said to over ride mini-cart.php you need to place it in a file that you have to name in your theme yourtheme / woocommerce / cart / mini-cart.php But you have to remember that for changes to take effect you need to go back into the widgets page of wp-admin and re-save the shopping cart widget each time you make a change or they will not ...



Top 50 recent answers are included