Scheduled Sale Manager is a WordPress plugin for WooCommerce that allows you to easily set up your shop sales. Choose exactly when the sale should start and finish, what product groups will be affected and what the discount will be.
5% off the entire shop? Free shipping on Sundays? End of the year sale on all large T-shirts? It's simple to set up and the possibilities are endless.
Since the WPML documentation is terrible and all its support forum’s topics are closed prematurely it’s always difficult to get something done with WPML.
As a result of some research, here’s a snippet to help inserting a post (of any post type) in multiple languages programmatically. The resulting posts will be linked to each other just like if you’d create a translation in the graphical interface.
global $sitepress; $post_type = 'post'; $primary_language = 'en'; $secondary_language = 'nl'; // Insert the original post $primary_post_id = wp_insert_post( array( 'post_type' => $post_type, 'post_title' => 'Title', 'post_content' => 'Content', ) ); // Insert the translated post $secondary_post_id = wp_insert_post( array( 'post_type' => $post_type, 'post_title' => 'Titel', 'post_content' => 'Inhoud', ) ); // Get original post's "trid" (translation ID) $trid = $sitepress->get_element_trid( $primary_post_id, 'post_' . $post_type ); // Tell WPML the second post is a translation of the first $sitepress->set_element_language_details( $secondary_post_id, 'post_' . $post_type, $trid, $secondary_language );
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>