Import download attachment from woocommerce product

Here is the solution i’ve found : in wordpress-importer plugin function process_posts : // try to use _wp_attached file for upload folder placement to ensure the same location as the export site // e.g. location is 2003/05/image.jpg but the attachment post_date is 2010/09, see media_handle_upload() $postdata[‘upload_date’] = $post[‘post_date’]; if ( isset( $post[‘postmeta’] ) ) { … Read more

Replace product link with just product name on WooCommerce downloads page

Remove the product link from the product name on MY Account Downloads // Display the product name without the link add_action( ‘woocommerce_account_downloads_column_download-product’, ‘custom_account_downloads_product_column’ ); function custom_account_downloads_product_column( $download ){ // Display the product name without the link echo esc_html( $download[‘product_name’] ); }

WooCommerce Class dosen’t exist

For official release installed or not, /** * Check if WooCommerce is active **/ $plugin_path = trailingslashit( WP_PLUGIN_DIR ) . ‘woocommerce/woocommerce.php’; if ( in_array( $plugin_path, wp_get_active_and_valid_plugins() ) || in_array( $plugin_path, wp_get_active_network_plugins() ) ) { // Custom code here. WooCommerce is active, however it has not // necessarily initialized (when that is important, consider // using … Read more

Integration widget Mondial Relay Js

You need to add this quick and dirty code in your functions.php if you’re trying to add mondial relay to checkout page : add_action(‘wp_footer’, function(){ if(is_checkout()) { ?> <!–On charge Google Map API–> <script type=”text/javascript” src=”https://maps.googleapis.com/maps/api/js?sensor=false”></script> <!–On charge le widget mondial relay depuis leurs serveurs–> <script type=”text/javascript” src=”https://widget.mondialrelay.com/parcelshop-picker/v3_0/scripts/jquery.plugin.mondialrelay.parcelshoppicker.min.js”></script> <script> $(document).ready(function () { // Charge le … Read more

WordPress Migration

WordPress has two ‘parts’: the code (WP core files, plus themes/plugin files), and the database. Both have to be placed in a new location for the ‘parts’ to work as they did on the source. So one way to transfer the site to a new host is to copy those two ‘parts’ to the new … Read more